Skip to content

Commit fe9a138

Browse files
authored
Merge branch 'BasisVR:main' into fumadocs
2 parents 6d671b8 + ed798fb commit fe9a138

1 file changed

Lines changed: 176 additions & 0 deletions

File tree

content/docs/server/configuration.mdx

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,181 @@ title: Configuration
33
---
44

55
import { Callout } from 'fumadocs-ui/components/callout';
6+
{/*
7+
## Introduction
8+
9+
The focus here is on Basis Server specific configuration and not the many ways
10+
you can host game servers in the cloud.
11+
12+
The multithreading on the server runs best the more cores avaiable but it has been shown to work well
13+
on as little as two cores. Social VR demands a lot of bandwidth so you'll want to keep that in mind when picking your
14+
service provider.
15+
16+
This doc applies to an Unmodified Basis Server: Version 6 from the LTS branch as of May 2025 of lts branch
17+
18+
:::tip Helpful Tip about Server Version
19+
You can find the **ServerVersion** in the code you cloned from the repo.
20+
Client and server code **must agree** on the version.
21+
22+
```csharp
23+
BasisNetworkCore\BasisNetworkVersion.cs
24+
5: public static ushort ServerVersion = 6;
25+
```
26+
:::
27+
28+
<br />
29+
<br />
30+
31+
### Run with Docker
32+
33+
Using docker-compose is the easiest and fastest way to spin up a Basis server. Docker images of the server are published to github on both `long-term-support` and `developer` branches, under `latest` and `nightly` respectively.
34+
35+
```yml
36+
services:
37+
basis-server:
38+
image: ghcr.io/basisvr/basis-server:latest # or :nightly for most recent changes
39+
container_name: basis-server
40+
init: true # handle process termination
41+
restart: unless-stopped
42+
environment:
43+
SetPort: 4296 # basis port
44+
HealthCheckPort: 10666 # http healthcheck port
45+
PromethusPort: 1234 # exists but is unused
46+
Password: default_password
47+
PeerLimit: 1024 # 1024 is the maximum supported
48+
EnableStatistics: true
49+
EnableConsole: false
50+
ports:
51+
- "4296:4296/udp"
52+
- "10666:10666/tcp"
53+
- "1234:1234/tcp" # unused
54+
volumes:
55+
- ./initialresources:/app/initialresources:ro
56+
- ./config:/app/config
57+
- ./logs:/app/logs
58+
# exercise health endpoint (optional)
59+
healthcheck:
60+
# http GET request
61+
test: ["CMD", "curl", "-f", "http://localhost:10666/health"]
62+
interval: 30s
63+
timeout: 10s
64+
retries: 3
65+
start_period: 2s
66+
```
67+
Run once to create `config.xml` (under `./config` in the example). Settings in xml will be overridden by enviornment variables.
68+
69+
### Compile and Run on Windows
70+
71+
Assuming you have cloned the LTS branch of the repo.
72+
`git clone -b long-term-support https://github.com/BasisVR/Basis.git`
73+
74+
You will find the Visual Studio Solution file (sln) in the `Basis Server` directory.
75+
These steps assume Windows 11 using Microsoft Visual Studio Community 2022 (64-bit) - Version 17.12.3
76+
77+
78+
The BasisNetworkConsole is the csproj you will need to target for compiling.
79+
You should be able to select that project from the start up item menu at the top.
80+
Once selected click the green arrow to build.
81+
82+
Once compiled, navigate to `\Basis\Basis Server\BasisServerConsole\bin\Debug\net9.0\`
83+
to find the server exe and compiled dependencies.
84+
85+
To run the server on Windows locally, open a command shell in this directory and run `.\BasisNetworkConsole.exe`
86+
87+
`\Basis\Basis Server\BasisServerConsole\bin\Debug\net9.0> .\BasisNetworkConsole.exe`
88+
89+
This should open a console and show something like the following:
90+
91+
``` title="Example Server Console Output"
92+
[20:07] [INFO] Logs are saved to C:\Basis\Basis Server\BasisServerConsole\bin\Debug\net9.0\Logs\2025-05-10.log
93+
[20:07] [INFO] Server Booting
94+
[20:07] [INFO] HTTP health check started at 'http://localhost:10666/health'
95+
[20:07] [INFO] Loaded Admins 0
96+
[20:07] [INFO] DidAuthIdentity initialized.
97+
[20:07] [INFO] Server Wiring up SetPort 4296
98+
[20:07] [INFO] Server Worker Threads Booted
99+
[20:07] [INFO] CombinedURL: https://example.com/502c8e6c8405d50418.BEE, LoadAssetPassword: c661cfeaf9757e
100+
[20:07] [INFO] Adding Object world
101+
```
102+
103+
104+
Be sure to point to `localhost` when running the Basis Demo Client. The option is in the advanced panel when
105+
you first start the client.
106+
107+
<br />
108+
<br />
109+
*/}
110+
### Compile and Run on Linux
111+
112+
#### Prerequisits Assuming Debian/Ubuntu
113+
114+
For Ubuntu 22.04,
115+
`sudo add-apt-repository ppa:dotnet/backports`
116+
117+
For Debian or other qurirky setups:
118+
119+
```
120+
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
121+
sudo dpkg -i packages-microsoft-prod.deb
122+
rm packages-microsoft-prod.deb
123+
```
124+
125+
Then continue installation:
126+
127+
`sudo apt-get update && sudo apt-get install -y dotnet-sdk-9.0`
128+
129+
#### Get Basis
130+
131+
Change to the folder you wish to download Basis to, and execute the following command:
132+
133+
`git clone -b long-term-support https://github.com/BasisVR/Basis`
134+
135+
#### Build Basis Server
136+
137+
Open a new terminal and cd /to/directory/with/Basis Server/, i.e. `cd Basis/Basis\ Server`
138+
139+
`dotnet restore`
140+
141+
Then build, with either:
142+
143+
`dotnet build` (for debug)
144+
145+
or
146+
147+
`dotnet build --configuration Release` (For release)
148+
149+
#### Executing
150+
151+
Navigate to the BasisServerConsole directory (Something like `/BasisServerConsole/bin/Debug/net9.0/BasisNetworkConsole`)
152+
and run:
153+
154+
`dotnet .\BasisNetworkConsole.dll`
155+
156+
:::tip For More Targeted Linux Release
157+
158+
You may compile with the following:
159+
160+
`dotnet publish -f net9.0 --self-contained --os Linux`
161+
162+
The `--self-contained` switch is added to allow running on a OS without dotnet installed.
163+
164+
If you compile via this method (Or your build targeted the system) are on a you should be able to run
165+
166+
`./BasisNetworkConsole`
167+
168+
from `BasisServerConsole/bin/Debug/net9.0/BasisNetworkConsole`.
169+
170+
:::
171+
172+
## Firewall
173+
174+
You may want to open ports:
175+
* 1234/tcp
176+
* 10666/tcp
177+
* 4296/udp
178+
179+
<br />
180+
<br />
6181

7182
## Configuration Files
8183

@@ -220,3 +395,4 @@ One avenue you can use to test out a new scene is to create a scene in Unity, ex
220395

221396
</BasisLoadableConfiguration>
222397
```
398+
*/}

0 commit comments

Comments
 (0)