FiveM5 minutes

    FiveM server.cfg Setup Guide

    How to set up your basic server settings

    The server.cfg file is the heartbeat of your server. From here you control the name, passwords, resources, and keys. Learn how to edit it correctly.

    1. 1
      Step 1

      Access the File

      Go to File Manager and look for 'server.cfg' in the main directory. Click to edit it.

    2. 2
      Step 2

      Change Server Name

      Find the 'sv_hostname' line and change the name. You can use color codes to style the name.

    3. 3
      Step 3

      Add Resources

      To start any mod or script, add 'ensure resource_name' or 'start resource_name' at the end of the file.

      endpoint_add_tcp "0.0.0.0:30120"
      endpoint_add_udp "0.0.0.0:30120"
      
      sv_hostname "^1SNG ^7Roleplay"
      sets sv_projectName "SNG Roleplay"
      sets sv_projectDesc "Serious roleplay server"
      sv_maxclients 48
      set onesync on
      
      ensure mapmanager
      ensure chat
      ensure spawnmanager
      ensure sessionmanager
      ensure basic-gamemode
      ensure hardcap
      # your own resources after their dependencies
      ensure oxmysql
      ensure my-script
      
      set steam_webApiKey "your_steam_web_api_key"
      sv_licenseKey "your_cfx_license_key"
    4. 4
      Step 4

      Set Keys

      Ensure your License Key and Steam Web API Key are placed in their designated spots at the bottom of the file.

    Common Mistakes

    • Do not delete lines starting with # unless you know what you are doing.
    • Ensure resource start order (dependencies first).
    • Save the file after every edit and restart the server to apply changes.
    • Do not share your full server.cfg as it may contain passwords.

    Frequently asked questions

    Where is the server.cfg file of a FiveM server?

    It sits in your server data folder, next to the resources folder. If you use txAdmin, open the server profile and edit it from the CFG Editor page without touching the file manager.

    What is the difference between ensure and start?

    start only starts a resource that is stopped. ensure starts it, or restarts it if it is already running, which is why most server.cfg files use ensure for every resource.

    My changes to server.cfg are not applied. Why?

    server.cfg is only read when the server starts. Save the file and restart the server from txAdmin. For a single new resource you can also run refresh and then ensure resource_name in the server console.

    How many players can join my FiveM server?

    sv_maxclients sets the player limit. Up to 48 players works without OneSync; for more you need set onesync on, and the highest slot counts depend on your Cfx.re subscription tier.

    Run this guide on a ready server

    Need a server for this guide? FiveM server hosting from SNG comes with txAdmin, OneSync and DDoS protection, and the SNG CDN for FiveM delivers your server files to players from inside Saudi Arabia.

    Related FiveM guides

    Need help?

    Facing startup issues?

    Contact Support