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.
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:
- Visual C++ Redistributable 2019 or newer.
- Git to assure a correct installation.
Install the FiveM server:
- Create a new directory folder (for example
D:FXServerserver
), this will be used for the server binaries. - Download the current recommended
master
branch build for Windows from the artifacts server. - Extract the build into the directory previously created.
3b. Use any archiving tool (such as WinRAR or 7-Zip). - Clone cfx-server-data in a new folder outside of your server binaries folder, for example,
D:FXServerserver-data
.
4b.git clone https://github.com/citizenfx/cfx-server-data.git server-data
- Make a server.cfg file in your
server-data
folder (copy the example server.cfg file below into that file). - Set the license key in your server.cfg using
sv_licenseKey "licenseKeyGoesHere"
. - Run the server from the
server-data
folder. For example, in a plain Windows command prompt (cmd.exe) window:cd /d D:FXServerserver-data D:FXServerserverFXServer.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.
- Create a new folder (for example
mkdir -p /home/username/FXServer/server
), this will be used for the server binaries. - Download the current recommended
master
branch build for Linux from the artifacts server(copy the URL for the latest server version and usewget <url>
to download it). - Extract the build to the directory that was previously created, using
cd /home/username/FXServer/server && tar xf fx.tar.xz
(you need to havexz
installed, on Debian/Ubuntu this is in thexz-utils
package). - Clone cfx-server-data in a new folder outside of your server binaries folder.
4b. For examplegit clone https://github.com/citizenfx/cfx-server-data.git /home/username/FXServer/server-data
- Make a server.cfg file in your
server-data
folder (copy the example server.cfg file below into that file). - Set the license key in your
server.cfg
usingsv_licenseKey "licenseKeyGoesHere"
. - 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.