So, you’ve gotten your FiveM Server setup, this guide is going to walk you through the steps assuming that you have your server on a VPS. If you are hosting with a GSP, they may have removed some lines of this file to better control your server, the configuration will be similar especially in the first half, however.
In the screenshots throughout this tutorial, I have used the text editor Atom.
IP and Port Configuration
Beginning on Lines 1-4 you are able to edit the IP and Port of your server. You likely will want to keep this default, particularly if you only have one server.
To edit, simply modify the default “30120” to your new desired port. For example, if I wish to change the port to 30130, I would modify both lines 3 and 4 to:
If you are on a VPS, remember to allow the port through your firewall.
If you have multiple servers on the same IP, you will need to make each port unique so it can be connected to. The default port of a FiveM Server is 30120, simply making your second server 30121 or 30130 will suffice.
Optional File Executions
The next items you will need in your cfg are file executions. This is where you can configure permission, licensing, and other files to execute.
It’s likely you will not have any of these files without some prior knowledge of them, and this guide will not cover how to create these files.
Next, you’ll want to tell your server which resources to start. By default, there will be a list of 8 resources that come with your server, and it’s strongly recommended you start these first before any others, so begin adding your resources after this first set.
To start a resource, simply type the following:
If I add a resource that contained all of my police vehicles named “leo_cars” to my resources folder, I would simply type the following into the server.cfg:
Each start command should be on its own line.
The next line is very simple. You’re telling the server whether or not you want script hook to be allowed for players on your server. This will disable most client-sided trainers, such as Lambda and Simple Native.
Use the table below to figure out which number to use. Do not modify the “sv_scriptHookAllowed” in the beginning.
As recommended by FiveM, you will want to change this before launching your server. Simply modify the default value to the password you wish to use.
Do not modify the “rcon_password” in the beginning, only the value one space after this. In case there is a “#” in front of the rcon_password line, remove it.
For example, let’s say I am wanting to change the password to “modern” my line would be:
This next section allows you to configure your server’s tags. These tags can be searched by players to help them find a server that matches their interests. You can put in as many as you wish that you feel are most relevant to your server.
Let’s take an example server that uses Los Angeles based departments such as the LAPD, uses the ESX framework, and is keen on serious roleplay. When configuring tags, I would use the following.
set tags "los angeles, serious, lapd, roleplay"
Be sure to separate tags by commas and make sure the tags are typed after “set tags” and are in between the quotation marks.
The next area of the cfg file is the banners. This is where you can configure banners to display to users when they view your server’s information, and when they connect to your server.
The “Detail” Banner (banner_detail)
The “Connecting” Banner (banner_connecting)
As FiveM states, the size does not matter. We recommend uploading your image to Imgur, this will allow you to get a hosted image to put into your CFG. Once uploaded, right-click on the image and “Copy Image Address” and paste this in between your quotation marks in the CFG.
The hostname is the name of your server as it will be displayed in the Direct Connect and the Server List tabs. This is an opportunity for you to tell the public what your server is all about. Try viewing some other server’s names for inspiration.
Please note that color and effects do require payment to FiveM’s Patreon.
Simply modify the text inside the quotation marks to change your server name.
Refer to the Optional File Executions section, this is an area pre-configured to additional CFG files, which is not covered in this guide.
Unlike the banners, the server icon should be housed in the same directory that your server.cfg is located. Simply provide the file name of the icon you wish to use, as FiveM requires, it must be a 96×96 PNG file. Put the name of the file after the “load_server_icon” line, and be sure to remove any “#” in front.
The icon appears in the following places:
This section allows you to configure whether or not your server appears on the public server list. Your server will still be accessible via direct connect even if not visible on the server list. Use the table below to decide whether or not to remove the “#” in front of the “sv_master1” line.
|“#” in front||Server WILL appear|
|No “#” in front||Server WILL NOT appear|
This area allows you to enable administrator/moderator permissions for users on your server. This gives users the ability to execute any server commands. It isn’t necessary to give your admins access here, you can install server moderation resources that allow for kicking & banning to better regulate your server.
The next area is the “sv_maxclients” line. This line allows you to configure how many people can be connected to your server at the same time. Simply enter an integer between 1 and 32 after “sv_maxclients” to configure your slots.
To gain more than 32 slots, you can subscribe to FiveM’s Patreon.
The license key configuration is where you are going to enter your server’s license key. You will need to get a license key from the FiveM Keymaster. This likely was already done when you originally installed your server.
Once you have the key, simply enter it after the “sv_licensekey” text. Do not place it in brackets.
If you’re needing assistance with installation, check out our Installing a FiveM Server on a Windows VPS Guide.
The server.cfg is a vital file in running a successful FiveM Server. By successfully understanding and then configuring it, you’re well on your way to starting the next best FiveM Server.
If anything in the server.cfg file was not covered in this guide, we recommend you keep it default.
Other Useful Information
- Adding a # in front of any line tells the CFG to read the line as text, and thus will not execute anything.