Self-Hosting the Server
You do not need this page to use vacs. The project runs a central server at vacs.network, and every vacs client connects to it by default. This page is for operators who want to run their own instance, for example for a closed test environment.
Controllers connected to your server cannot call anyone on the official server, and vice versa. Every controller who should reach you must point their client at your server.
What you need​
- The server image,
ghcr.io/vacs-project/vacs-server. Images are tagged by version (3.0.0), minor version (3.0) and major version (3). There is nolatesttag. - Valkey or Redis, reachable from the server. It stores sessions and tokens.
- A VATSIM Connect OAuth client. Controllers log in with their VATSIM account, so the server needs its own client ID and secret from VATSIM.
- A reverse proxy that terminates TLS, such as Caddy, nginx or Traefik. The server itself speaks plain HTTP, and its session cookie is marked secure by default, so it must be reached over HTTPS. The proxy must pass WebSocket upgrades through on
/ws. - Outbound internet access to VATSIM (login, data feed) and, if you use it, GitHub (dataset and release information).
Running the container​
The image exposes two ports and two volumes:
| Purpose | |
|---|---|
Port 3000 | The main HTTP and WebSocket listener. Put your reverse proxy in front of it. |
Port 9200 | Prometheus metrics at /metrics. Do not expose it publicly. |
/etc/vacs-server | Configuration. The server reads config.toml and release_policy.toml from here. |
/var/lib/vacs-server/data | State the server writes itself, currently the downloaded FIR dataset. Use a named volume. |
The container runs as a non-root user (UID 65532) and has a built-in health check that requests /health.
A minimal docker-compose.yml:
services:
valkey:
image: valkey/valkey:9-alpine
restart: unless-stopped
vacs-server:
image: ghcr.io/vacs-project/vacs-server:3
restart: unless-stopped
depends_on:
- valkey
ports:
- "127.0.0.1:3000:3000"
volumes:
- ./config:/etc/vacs-server:ro
- vacs-data:/var/lib/vacs-server/data
env_file:
- secrets.env
volumes:
vacs-data:
Configuration​
Settings are read from these sources, each overriding the one before it:
- Built-in defaults.
/etc/vacs-server/config.toml.config.tomlin the working directory.- Environment variables.
Every file is optional. Environment variables start with VACS-, use - between levels and keep the _ inside a key name. For example, session.signing_key is set by VACS-SESSION-SIGNING_KEY. Variable names are not case sensitive. Because the names contain hyphens, set them through an env file or your orchestrator, not through export in a shell.
The server refuses to start if auth.oauth.client_id, auth.oauth.client_secret or session.signing_key is empty.
Minimal configuration​
config/config.toml:
[redis]
addr = "redis://valkey:6379"
[auth.oauth]
auth_url = "https://auth.vatsim.net/oauth/authorize"
token_url = "https://auth.vatsim.net/oauth/token"
redirect_url = "https://vacs.example.org/auth/vatsim/redirect"
[vatsim.user_service]
user_details_endpoint_url = "https://auth.vatsim.net/api/user"
[server]
client_ip_source = "RightmostXForwardedFor"
[admin.dataset]
owner = "vacs-project"
repo = "vacs-data"
deployed_tag = "deployed/production"
secrets.env:
VACS-AUTH-OAUTH-CLIENT_ID=your-client-id
VACS-AUTH-OAUTH-CLIENT_SECRET=your-client-secret
VACS-SESSION-SIGNING_KEY=at-least-64-random-characters
The VATSIM URLs default to the VATSIM Connect sandbox (auth-dev.vatsim.net). Set them to production as shown above unless you registered your OAuth client in the sandbox.
Settings​
Durations are written as a table of seconds and nanoseconds, for example { secs = 30, nanos = 0 }.
[server]​
| Key | Default | Description |
|---|---|---|
bind_addr | "0.0.0.0:3000" | Address and port of the main listener. |
metrics_bind_addr | "0.0.0.0:9200" | Address and port of the metrics listener. |
client_ip_source | "ConnectInfo" | Where the server reads a client's IP address from, used for rate limiting and logs. ConnectInfo uses the TCP peer and is only right without a proxy. Behind a proxy, use the header your proxy sets: RightmostXForwardedFor, XRealIp, RightmostForwarded, CfConnectingIp, TrueClientIp, FlyClientIp, CloudFrontViewerAddress or XEnvoyExternalAddress. |
debug_endpoints | false | Enables endpoints under /debug that show the loaded coverage data. Leave off in production. |
[redis]​
| Key | Default | Description |
|---|---|---|
addr | "redis://127.0.0.1:6379" | Connection URL of the Valkey or Redis instance. |
[session]​
| Key | Default | Description |
|---|---|---|
signing_key | none, required | Secret used to sign session cookies. Must be at least 64 bytes long, or the server fails at startup. Keep it stable: changing it logs out every controller. |
secure | true | Marks the session cookie as HTTPS-only. |
http_only | true | Hides the session cookie from scripts. |
expiry_secs | 604800 (7 days) | How long a session stays valid without activity. |
[auth] and [auth.oauth]​
| Key | Default | Description |
|---|---|---|
auth.oauth.client_id | none, required | Client ID of your VATSIM Connect OAuth client. |
auth.oauth.client_secret | none, required | Client secret of your VATSIM Connect OAuth client. |
auth.oauth.auth_url | VATSIM sandbox | VATSIM Connect authorization endpoint. |
auth.oauth.token_url | VATSIM sandbox | VATSIM Connect token endpoint. |
auth.oauth.redirect_url | "http://localhost:3000/auth/vatsim/redirect" | Your server's public address followed by /auth/vatsim/redirect. Register exactly this URL with VATSIM. |
auth.oauth.deep_link_url | "vacs://auth/vatsim/callback" | Where the server hands the login back to the vacs client. Leave unchanged. |
auth.login_flow_timeout_millis | 10000 | Time allowed for a login to complete. |
auth.api_token.expiry_secs | 86400 (24 hours) | Lifetime of API tokens. |
[vatsim]​
| Key | Default | Description |
|---|---|---|
require_active_connection | true | Only lets controllers connect while they are logged in to VATSIM as ATC. |
user_service.user_details_endpoint_url | VATSIM sandbox | VATSIM Connect user details endpoint. |
slurper_base_url | "https://slurper.vatsim.net" | VATSIM slurper, used to look up a controller's position. |
data_feed_url | "https://data.vatsim.net/v3/vatsim-data.json" | VATSIM data feed. |
data_feed_timeout | 2 seconds | Request timeout for the data feed. |
data_feed_cache_ttl | 15 seconds | How long a data feed response is reused. Should not exceed controller_update_interval. |
data_feed_position_grace_period | 90 seconds | How long after connecting a controller's position is held while the data feed catches up. |
controller_update_interval | 30 seconds | How often online controllers are checked against the data feed. |
coverage_dir | "/var/lib/vacs-server/data/coverage" | Where the FIR dataset is stored. Must be a subdirectory of the data volume, not the volume root. |
[admin] and [admin.dataset]​
The server needs the FIR dataset from vacs-data to know which positions and stations exist. With [admin.dataset] set, it downloads the dataset from GitHub at startup whenever the deployed tag points to a newer commit, and falls back to the copy on disk if GitHub is unreachable. Without it, the server only loads whatever is already in coverage_dir. If that is empty, the server starts with no positions or stations, and no controller can be placed on a position.
| Key | Default | Description |
|---|---|---|
dataset.owner | "vacs-project" | GitHub owner of the dataset repository. |
dataset.repo | "vacs-data" | Name of the dataset repository. |
dataset.deployed_tag | "deployed/production" | Tag that marks the dataset version to use. |
dataset.app_id, dataset.app_private_key, dataset.installation_id | none | GitHub App credentials. Optional for a public repository. |
oidc_audience, oidc_allowed_sub, oidc_allowed_sub_releases | Authorize the /admin reload endpoints for GitHub Actions. Leave unset unless you run your own deployment pipeline. |
[updates]​
The server tells clients whether a newer vacs version is available. It needs a release catalog for that. Without one, clients connected to your server are never offered updates.
| Key | Default | Description |
|---|---|---|
policy_path | "/etc/vacs-server/release_policy.toml" | Optional file marking versions as required updates and limiting which client protocol versions may connect. Without it, every version is accepted and no update is required. |
catalog.backend | "File" | "File" reads releases from a local TOML file, "GitHub" reads them from a repository's GitHub releases. |
catalog.path | "releases.toml" | With File: path to the release file. |
catalog.owner, catalog.repo | With GitHub: repository to read releases from. | |
catalog.release_cache_ttl | 4 hours | With GitHub: how long the release list is cached. |
catalog.signature_cache_ttl | 24 hours | With GitHub: how long the signatures of release files are cached. |
To offer the official vacs releases:
[updates.catalog]
backend = "GitHub"
owner = "vacs-project"
repo = "vacs"
[ice]​
Calls are set up over WebRTC, which needs STUN and usually TURN servers. The server hands their addresses to clients.
| Key | Default | Description |
|---|---|---|
provider | "StunOnly" | "StunOnly", "Cloudflare" or "Coturn". STUN alone fails for controllers behind strict NATs or firewalls. |
stun_servers | Cloudflare STUN | With StunOnly: list of STUN URLs. |
cloudflare_turn_key_id, cloudflare_turn_key_api_token | none | With Cloudflare: Cloudflare Realtime TURN credentials. |
turn_credential_ttl | 6 hours | With Cloudflare: lifetime of issued TURN credentials. |
coturn.auth_secret | With Coturn: the shared secret configured as static-auth-secret in coturn. | |
coturn.stun_urls, coturn.turn_urls, coturn.turns_urls | With Coturn: lists of URLs to hand out. | |
coturn.ttl | With Coturn: lifetime of issued TURN credentials, in seconds. |
[call] and [rate_limiters]​
| Key | Default | Description |
|---|---|---|
call.max_conf_size | 8 | Maximum number of participants and invited targets in a conference call. |
rate_limiters.enabled | true | Turns all rate limits on or off. The individual limits (call_invite, failed_auth, version_update, vatsim_token) rarely need changing. |
Logging​
Logs go to standard output. Set RUST_LOG to change the log filter, for example RUST_LOG=info, and set RUST_LOG_JSON=1 for one JSON object per line.
Endpoints​
These are the paths your reverse proxy must forward. All are served on the main listener.
| Path | Purpose |
|---|---|
/ws | WebSocket connection of the vacs client, plus token and disconnect requests under /ws/.... |
/auth/... | Login with VATSIM, including the OAuth redirect. |
/version/update | Update check. |
/webrtc/ice-config | STUN and TURN servers for calls. |
/health | Health check. Answers with a success status while the server is running. |
/version | Server version. |
/assets/... | Static files used by the login pages. |
/admin/... | Dataset and release reload, only usable with GitHub OIDC configured. |
The protocol between the client and the server is internal to vacs. It changes together with the client and is not meant for third-party clients.
Connecting clients​
Each controller sets both addresses in their client's config.toml, as described in Using a different server:
[backend]
base_url = "https://vacs.example.org"
ws_url = "wss://vacs.example.org/ws"