<!-- fivemad.com, Markdown source of https://fivemad.com/docs/tools/server-cfg-generator -->
> Source: https://fivemad.com/docs/tools/server-cfg-generator
> Section: Tools
> Tags: server.cfg, OneSync, ACE permissions, txAdmin, oxmysql, sv_licenseKey
> Tool: https://fivemad.com/tools/server-cfg-generator
> Last updated: 2026-09-22
> Site map for assistants: https://fivemad.com/llms.txt

# server.cfg Generator

Build a working FiveM server.cfg from a form: endpoints, OneSync, game build, keys, oxmysql, pma-voice, resource load order and ACE permissions.

The server.cfg Generator turns a form into a clean, commented `server.cfg` for FXServer. It covers networking, server list identity, OneSync, the enforced game build, security convars, keys, the oxmysql connection string, pma-voice convars, the `ensure` order for Standalone, QBCore, Qbox or ESX, and ACE permissions for your admins.

## What it is for

Most broken servers fail on something small in `server.cfg`: a resource started before its library, a missing license key, an admin line with the wrong identifier prefix, or a database password with an `@` in it. The generator writes the file in a fixed, readable order and shows warnings next to the output while you fill in the form, so you catch those before you start FXServer.

Use it when you set up a new server, when you move a server to a new framework, or when you want a clean reference file to compare your old one against.

## Quick start

1. Pick a **Framework** at the top: **Standalone**, **QBCore**, **Qbox** or **ESX Legacy**. This fills the **Resources** list and the tags, and adds the permission lines that framework needs. Any framework other than Standalone also turns on the **Database** and **Voice (pma-voice)** panels.
2. In **Server identity**, set `sv_hostname`, **Project name**, **Project description**, **Locale** and **Tags**.
3. In **Slots, network & game**, set `sv_maxclients`, **OneSync**, **Bind IP**, **Port** and `sv_enforceGameBuild`.
4. In **Keys & branding**, paste your `sv_licenseKey` from [portal.cfx.re](https://portal.cfx.re).
5. Under **Permissions (ACE)**, add yourself in **Admins** with your license, Discord or other identifier.
6. Read the amber warnings above the output, fix what applies, then use the download button on the `server.cfg` code block and save the file in your server-data folder, next to the `resources` folder.

> [!NOTE]
> Everything runs in your browser. The license key, Tebex secret and database password never leave your machine. The form is saved in this browser's local storage so you can come back to it. **Reset** puts every field back to the defaults.

## Options

### Framework presets

| Preset | Resources it fills | Tags | Admin group |
| --- | --- | --- | --- |
| Standalone | `mapmanager`, `chat`, `spawnmanager`, `sessionmanager`, `basic-gamemode`, `hardcap`, `baseevents` | `default` | `group.admin` |
| QBCore | the cfx defaults, then `oxmysql`, `ox_lib`, `qb-core`, `[qb]`, `[standalone]`, `[voice]`, `[defaultmaps]` | `roleplay, qbcore, qb-core` | `qbcore.god` |
| Qbox | `chat`, `hardcap`, `oxmysql`, `ox_lib`, `qbx_core`, `[ox]`, `[qbx]`, `[standalone]`, `[voice]` | `roleplay, qbox, ox` | `group.admin` |
| ESX Legacy | `chat`, `spawnmanager`, `sessionmanager`, `hardcap`, `oxmysql`, `ox_lib`, `es_extended`, `[core]`, `[standalone]`, `pma-voice` | `roleplay, esx` | `group.admin` |

Switching the framework replaces the **Resources** text and the tags. Admin rows that use a preset admin group are moved to the new framework's group; rows with a custom group are left alone.

### Server identity

| Field | Output | Notes |
| --- | --- | --- |
| `sv_hostname` | `sv_hostname "..."` | Shown in the server list. `^1` to `^9` are colour codes. Over 100 characters gets a warning. |
| Project name | `sets sv_projectName "..."` | Skipped when empty. |
| Project description | `sets sv_projectDesc "..."` | Skipped when empty. |
| Locale | `sets locale "en-US"` | 25 locales, including `root-AQ`. |
| Tags | `sets tags "..."` | Comma separated, trimmed and re-joined. |

### Slots, network and game

| Field | Output | Default |
| --- | --- | --- |
| `sv_maxclients` | `sv_maxclients 48` | 48 (slider and box, 1 to 2048) |
| OneSync | `set onesync on` | `on`. Also `legacy` or `off`. |
| Bind IP / Port | `endpoint_add_tcp` and `endpoint_add_udp` with `"0.0.0.0:30120"` | `0.0.0.0` and `30120` |
| `sv_enforceGameBuild` | `set sv_enforceGameBuild 3258` plus the DLC name as a comment | 3258 (Bottom Dollar Bounties). "Default (not enforced)" leaves the line out. |

The build list runs from 1604 (Arena War) to 3570 (Money Fronts). Setting a build unlocks the DLC vehicles, maps and clothing up to that update.

### Keys and branding

| Field | Output |
| --- | --- |
| `sv_licenseKey` | `sv_licenseKey "..."`, always written. Defaults to `changeme` with a comment pointing at portal.cfx.re. |
| `steam_webApiKey` | `set steam_webApiKey "none"` when empty. Only needed if you use Steam identifiers. |
| Server icon file | `load_server_icon logo.png`. A 96x96 PNG in the server-data folder. |
| Discord | `sets Discord "..."` |
| `banner_detail` URL | `sets banner_detail "..."` (1920x200 image on the server detail page) |
| `banner_connecting` URL | `sets banner_connecting "..."` (shown while connecting) |
| `sv_tebexSecret` | `sv_tebexSecret "..."`, only when filled in. |
| Extra sets variables | **Add variable** adds a key and value pair, written as `sets Key "value"`. Spaces in the key become underscores. |

### Security

| Option | Output | Default |
| --- | --- | --- |
| Running under txAdmin | Adds a txAdmin note at the top and leaves `rcon_password` out | On |
| `sv_endpointprivacy` | `sv_endpointprivacy true` (hides player IPs from other players) | On |
| `sv_scriptHookAllowed` | `sv_scriptHookAllowed 0` or `1` | Off |
| Private server | `sv_master1 ""` so the server is not listed in the server browser | Off |
| `sv_pureLevel` | Not set, `1` (blocks modified game files, allows audio and graphics mods) or `2` (blocks all modified files) | `1` |
| `sv_entityLockdown` | Not set, `relaxed` (blocks client created entities, allows script ones) or `strict` (only the server creates entities) | Not set |
| `rcon_password` | Only shown with txAdmin off. Empty writes a commented out line. | Empty |

### Database

The **Database** panel has an **Enabled** / **Off** switch. When on, it writes one line for oxmysql built from **Host**, **Port**, **User**, **Password** and **Database**. The user, password and database name are URL-encoded for you, and `charset=utf8mb4` is appended.

### Voice (pma-voice)

When enabled, it writes `setr` convars for pma-voice:

| Field | Convar |
| --- | --- |
| Audio mode | `voice_useNativeAudio true`, `voice_use2dAudio true`, or nothing for "pma-voice default" |
| Sending range only | `voice_useSendingRangeOnly` (default true) |
| Built-in UI | `voice_enableUi` (default 0) |
| Radio animation | `voice_enableRadioAnim` (default 1) |
| Range key / Radio key | `voice_defaultCycle "F11"` and `voice_defaultRadio "LMENU"` |

If voice is on but your resource list has neither `pma-voice` nor `[voice]`, the generator adds `ensure pma-voice` at the end of the resources.

### Resources

One entry per line. Plain names become `ensure name`. A `[folder]` name starts every resource in that folder. Lines starting with `#` stay as comments, and lines that already start with `ensure`, `start`, `stop`, `restart`, `exec`, `set`, `setr` or `sets` are kept as written. When `ox_lib` or `[ox]` is in the list, the generator adds `setr ox:locale "en"` above the resources and the ACE lines ox_lib needs.

### Permissions (ACE)

**Admins** rows take an identifier type (`license`, `license2`, `fivem`, `discord`, `steam`, `xbl`, `live`, `ip`), the identifier value, a group and an optional note. The `license:` style prefix in the value is optional; the tool strips it and writes the full `identifier.license:...` principal. **Custom rules** (toggle with **Show custom rules**) adds free `add_ace` rows with an allow/deny switch and `add_principal` rows.

## Output

The file is written in this order: header, Networking, Server identity, Slots and game, Security, Keys, Database, Voice, ox_lib, Resources, Permissions. With the default Standalone settings it looks like this:

```cfg title="server.cfg"
## Networking
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

## Server identity
sv_hostname "^5My Server ^7| Serious RP | Discord: example"
sets sv_projectName "My Server"
sets sv_projectDesc "Serious roleplay with custom jobs and an active staff team"
sets locale "en-US"
sets tags "default"

## Slots and game
sv_maxclients 48
set onesync on
set sv_enforceGameBuild 3258      # Bottom Dollar Bounties

## Security
sv_scriptHookAllowed 0
sv_pureLevel 1                 # blocks modified game files, allows audio and graphics mods
sv_endpointprivacy true

## Keys
set steam_webApiKey "none"   # https://steamcommunity.com/dev/apikey
sv_licenseKey "changeme"   # https://portal.cfx.re

## Resources (load order matters)
# Default cfx resources
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure baseevents

## Permissions
add_ace group.admin command allow            # all commands
add_ace group.admin command.quit deny        # but not quit
# add_principal identifier.license:xxxxxxxx group.admin   # add yourself here
```

With QBCore picked and an admin added, the extra sections look like this:

```cfg
## Database (oxmysql)
set mysql_connection_string "mysql://root:p%40ss@localhost:3306/fivem?charset=utf8mb4"

## Voice (pma-voice)
setr voice_useNativeAudio true
setr voice_useSendingRangeOnly true
setr voice_enableUi 0
setr voice_enableRadioAnim 1
setr voice_defaultCycle "F11"
setr voice_defaultRadio "LMENU"

## ox_lib
setr ox:locale "en"

## Permissions
add_ace group.admin command allow            # all commands
add_ace group.admin command.quit deny        # but not quit
add_ace resource.qb-core command allow
add_ace qbcore.god command allow
add_principal qbcore.god group.admin
add_principal qbcore.god qbcore.admin
add_principal qbcore.admin qbcore.mod
add_ace resource.ox_lib command.add_ace allow
add_ace resource.ox_lib command.remove_ace allow
add_ace resource.ox_lib command.add_principal allow
add_ace resource.ox_lib command.remove_principal allow

add_principal identifier.license:1a2b3c4d5e6f qbcore.god   # owner
```

### Starting the server

With txAdmin, point the deployer (or Settings, then FXServer) at this file. Without txAdmin, start FXServer from the server-data folder:

```bash
# Windows
C:\FXServer\server\FXServer.exe +exec server.cfg

# Linux
bash ~/FXServer/server/run.sh +exec server.cfg
```

## Warnings the tool shows

- `sv_licenseKey` is empty or still `changeme`.
- More than 32 slots with OneSync `off`.
- More than 48 slots: that needs an Element Club subscription linked to the license key.
- OneSync `legacy` is deprecated.
- A framework is picked but the database section is off.
- `sv_scriptHookAllowed 1` lets players run ScriptHook mod menus.
- The hostname is longer than 100 characters.
- The database has no password (fine for local testing only).
- No admin identifier is set.

## Tips

- Load order matters. Libraries such as `oxmysql` and `ox_lib` go before the framework core, and the core (`qb-core`, `qbx_core`, `es_extended`) goes before any script that uses it. `ensure [folder]` starts everything inside a bracketed folder in an order you do not control, so ensure dependencies by name before the folder.
- Check a permission in Lua with `IsPlayerAceAllowed(source, 'command.kick')`. After you change ACE lines you can paste them into the server console to apply them without a restart.
- Find identifiers in txAdmin (Players, then a player) or with `GetPlayerIdentifiers(source)`.
- `setr` convars are replicated to clients, `sets` convars are shown publicly in the server list, plain `set` stays on the server.

> [!WARNING] Keep secrets out of git
> `server.cfg` holds your license key and database password. Do not commit it to a public repo. Move secrets to a separate file and load it with `exec secrets.cfg`.

## Common mistakes

- **Starting FXServer with `+exec` while using txAdmin.** txAdmin starts the server itself. It still reads the port from the `endpoint_add_*` lines, so keep them.
- **Only opening TCP or only UDP.** The port needs both.
- **Changing `sv_enforceGameBuild` while players are on.** Clients download the matching game build on their next connect, so set it before launch.
- **Special characters in the database password.** They must be URL-encoded in `mysql_connection_string`. The generator does that, so do not encode them a second time.

## Limitations

The generator does not check that the resources you list exist in your `resources` folder, and it does not validate identifiers or keys. The framework presets are a starting point: rename folders to match your own server. The game build list stops at 3570.

## Related tools

- [fxmanifest.lua Generator](/docs/tools/fxmanifest-generator)
- [Server Status Checker](/docs/tools/server-status-checker)
- [Cfx Blacklist Checker](/docs/tools/cfx-blacklist-checker)
- [Artifacts](/docs/tools/artifacts)
