Configure FiveNet
Use this guide after choosing a deployment method and before setting up DBSync or the FiveM plugin. It covers the minimum configuration required for a working FiveNet installation.
For every option and its default value, see the Config File Reference. The example file in the FiveNet repository remains the source of truth for the complete configuration.
Before You Begin
Make sure you have:
- A supported MySQL or MariaDB database.
- A NATS server with JetStream enabled.
- A public HTTPS URL for FiveNet, or a plan for exposing it through a reverse proxy.
- A storage location for uploads, either a persistent local directory or S3-compatible storage.
- The FiveNet
config.example.yamlfile from the same release as the FiveNet image or binary you are deploying.
If you are using Docker or Helm, follow the deployment guide first so you know where the configuration file is mounted and which services are available by their internal hostnames.
1. Create config.yaml
Copy the example file and keep it with the deployment files. Do not edit the example file in place:
cp config.example.yaml config.yaml
For containerized deployments, mount the completed config.yaml into the location expected by the deployment template. FiveNet searches for the file in the current working directory and then in /config.
2. Configure the Public URL
Set the URL users will open in their browser:
http:
publicURL: "https://fivenet.example.com"
origins:
- "https://fivenet.example.com"
sessions:
domain: "fivenet.example.com"
The URL, browser origin, and session domain must match the domain used by your reverse proxy. If you use a separate hostname for API or plugin traffic, add that origin where required by your deployment.
Review http.trustedProxies when FiveNet is behind NGINX, Traefik, Cloudflare, or another proxy. Only list proxy addresses or networks you control.
3. Generate and Store Secrets
Generate unique values for the application secret, session cookie secret, and JWT secret. Keep them stable after deployment and do not commit them to a public repository.
For example, generate a value using the command for your operating system:
openssl rand -base64 32
[Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(32))
Set the generated values in the corresponding options:
secret: "CHANGE_ME"
http:
sessions:
cookieSecret: "CHANGE_ME"
jwt:
secret: "CHANGE_ME"
Changing these values later can invalidate sessions or tokens. Treat sync API tokens as secrets as well.
4. Configure the FiveNet Database
Set database.dsn to the MySQL or MariaDB database used by FiveNet:
database:
dsn: "DB_USER:DB_PASS@tcp(DB_HOST:DB_PORT)/DB_NAME?collation=utf8mb4_unicode_ci&parseTime=True&loc=Europe%2FBerlin"
Use a database user with the permissions required for FiveNet migrations and normal operation. The configured collation should match the database and tables. See Database Setup if migrations report collation or foreign-key errors.
5. Configure NATS
Set nats.url to the NATS server and make sure JetStream is enabled:
nats:
url: "nats://USER:PASSWORD@NATS_HOST:4222"
When FiveNet runs in Docker Compose, use the NATS service name as the hostname, such as nats, rather than localhost. When FiveNet runs in Kubernetes, use the NATS Service DNS name.
6. Enable the Sync API
DBSync and the FiveM plugin use the Sync API. Enable it and create at least one long, unique token:
sync:
enabled: true
apiTokens:
- "CHANGE_ME_TO_A_LONG_RANDOM_TOKEN"
Use the token only in the DBSync and plugin configuration that need it. If you rotate the token, update both integrations.
7. Configure Upload Storage
The default filesystem storage is suitable for a single instance when its directory is persistent:
storage:
type: filesystem
filesystem:
path: /data
Make sure /data is backed by a persistent volume in Docker or Kubernetes. For multiple instances or externally managed uploads, configure the S3-compatible storage options instead. See Advanced Configuration.
8. Grant Initial Configuration Access
Give the group used by your first administrator access to configuration settings:
auth:
configAdminGroups:
- admin
You can also use auth.configAdminUsers for specific users. The first account still needs to be created and registered as described in Complete Initial Setup.
9. Start and Validate FiveNet
Start the deployment using the command appropriate for your installation method. Then check:
- The server starts without database or NATS errors.
- Database migrations complete successfully.
- The configured public URL loads over HTTPS.
- The first account can register and sign in.
- The upload storage path is writable.
Once the core server is working, continue with DBSync and then Complete Initial Setup to connect the gameserver and configure FiveNet in the application.
Complete Initial Setup
Complete the first-admin setup and connect your gameserver after the FiveNet server is running.
DBSync: Install and Configure
Use this guide to install and configure DBSync when FiveNet should pull characters, vehicles, and other data from your gameserver database without requiring direct database access from the FiveNet server itself.
