GTA 6 Server Config

The config files are where most server owners leave a mess. Secrets mixed with settings, no version history, no environments. This is the setup your future self will thank you for.
The three types of configuration
- Runtime config: server name, max players, game type. Checked into git.
- Feature flags: which scripts are enabled, which jobs are active. Checked into git, often different per environment.
- Secrets: database credentials, API keys, tokens. Never checked into git.
Directory structure that works
server/
server.cfg # runtime config, in git
resources.cfg # which resources to load, in git
.env # secrets, in .gitignore
.env.example # template for secrets, in git
resources/
[script-name]/
fxmanifest.lua
config.lua # public script config, in git
Secrets handling
Never put tokens, passwords, or API keys in files that git tracks. Use environment variables loaded from a .env file that is in your .gitignore.
Your .env.example file documents what variables exist without containing real values. New developers can copy it to .env and fill in real values locally.
Feature flags for environments
Different environments (dev, staging, production) need different settings. Use feature flags to toggle:
- Debug mode (verbose logging on dev, off on production).
- Test commands (admin quick-spawn on staging, never on production).
- Rate limits (strict on production, loose on staging).
- External integrations (use test Discord on staging, real Discord on production).
Version control for configs
- Commit config changes with descriptive messages. "Tuned max_players to 96 for Friday tournament" beats "update config".
- Review config changes in PRs. A typo in production config is a Saturday night outage.
- Tag production releases. When you need to find "what was running last Wednesday" you can.
Common config mistakes
- Secret leakage. Rotate immediately.
- Production values on staging (hitting the real database from dev).
- Unversioned manual edits. Drift from git over time.
- Monolithic config files 2000 lines long. Split by concern.
Related reading
For version control specifics, see our version control guide. For the staging workflow, read our staging environment guide. For the broader setup stack, the RP startup guide covers the pieces that connect to config.
Frequently Asked Questions
What goes in server.cfg vs resources.cfg?
Runtime settings (server name, max players, game type) go in server.cfg. Which scripts to load go in resources.cfg. Secrets like database passwords go in .env, never in either file.
Should I put my server config in git?
Yes, except for secrets. Commit server.cfg, resources.cfg, and any script config files. Keep a .env.example template in git and the real .env locally ignored.
How do I manage different configs for dev and production?
Use environment variables for anything that differs, and feature flags for toggles. Dev mode sets different verbosity, test commands, rate limits. A single well-structured config beats two diverged configs.


