Shopping Cart
how to create a fivem server

Setting up a FiveM server

The first step: Create a key

Make sure you have registered a license key on the Cfx.re Keymaster service. You need to have the IP match the IP on which you’re going to first use the key. Afterwards, the key can be used on any IP, but only on one server at a time.

You can also buy a FiveM patreon key from us, if its available!

Also create a Steam API key – here: http://steamcommunity.com/dev/apikey

Using the Steam API key manually on the server

Go to http://steamcommunity.com/dev/apikey 14.8k and in Domain name you put what you want then copy the key and then go to your server.cfg and put this:

# Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
# -> replace "" with the key
set steam_webApiKey "KEYS"

Installation of the FiveM server

Windows

You need:

  1. Visual C++ Redistributable 2019 or newer.
  2. Git to assure a correct installation.

Install the FiveM server:

  1. Create a new directory folder (for example D:\FXServer\server), this will be used for the server binaries.
  2. Download the current recommended master branch build for Windows from the artifacts server.
  3. Extract the build into the directory previously created.
    3b. Use any archiving tool (such as WinRAR or 7-Zip).
  4. Clone cfx-server-data in a new folder outside of your server binaries folder, for example, D:\FXServer\server-data.
    4b. git clone https://github.com/citizenfx/cfx-server-data.git server-data
  5. Make a server.cfg file in your server-data folder (copy the example server.cfg file below into that file).
  6. Set the license key in your server.cfg using sv_licenseKey "licenseKeyGoesHere".
  7. Run the server from the server-data folder. For example, in a plain Windows command prompt (cmd.exe) window:cd /d D:\FXServer\server-data D:\FXServer\server\FXServer.exe +exec server.cfg (the /d flag is only needed when changing directory to somewhere on a different drive)

Linux

Note that the Linux version of FXServer is only provided as a courtesy port due to issues regarding Linux distribution compatibility and availability of diagnostic tools for native C++ code. If you’re experiencing any issues, you’re more likely to see them fixed if you use the Windows version.

  1. Create a new folder (for example mkdir -p /home/username/FXServer/server), this will be used for the server binaries.
  2. Download the current recommended master branch build for Linux from the artifacts server(copy the URL for the latest server version and use wget <url> to download it).
  3. Extract the build to the directory that was previously created, using cd /home/username/FXServer/server && tar xf fx.tar.xz (you need to have xz installed, on Debian/Ubuntu this is in the xz-utils package).
  4. Clone cfx-server-data in a new folder outside of your server binaries folder.
    4b. For example git clone https://github.com/citizenfx/cfx-server-data.git /home/username/FXServer/server-data
  5. Make a server.cfg file in your server-data folder (copy the example server.cfg file below into that file).
  6. Set the license key in your server.cfg using sv_licenseKey "licenseKeyGoesHere".
  7. Run the server from the server-data folder.
    7b. bash /home/username/FXServer/server/run.sh +exec server.cfg

Common issues of a FiveM server

  • If you don’t get any ‘resources found’, and it says ‘Failed to start resource’, you didn’t ‘cd’ to the right folder.
  • If no resources get started, and you can’t connect, you didn’t add +exec.
  • If you get ‘no license key was specified’, one of the above things applies.

Download a plug&play server?

You can also buy a premade server with pre-made scripts.

Leave a Reply

Your email address will not be published. Required fields are marked *

FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Stripe