If you are setting up a FiveM for GTAV Enhanced server, the Microsoft Visual C++ 2017 Redistributable must be installed. Download and install it before running the server.
Note that if you are setting up a FiveM for GTAV Enhanced server, server.7z is named cfx-server_win_x64 instead.
Create a new directory (for example C:\FXServer\server), this will be used for the server binaries.
Download the current recommended master branch build for Windows from the Server Download page.
Extract the build into the directory previously created.
Clone cfx-server-data in a new folder outside of your server binaries folder, for example, C:\FXServer\server-data.
git clone https://github.com/citizenfx/cfx-server-data.git server-data (To type this command you need to open a command prompt, press Win + R, once the run dialog shows type cmd and hit enter, remember to switch directories to the directory you plan to clone to by typing cd C:\FXServer.)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 C:\FXServer\server-data
C:\FXServer\server\FXServer.exe +exec server.cfg
(the /d flag is only needed when changing directory to somewhere on a different drive)
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.
xz or xz-utils package.Note that if you are setting up a FiveM for GTAV Enhanced server, fx.tar.xz is named cfx-server-linux_x64 instead.
mkdir -p ~/FXServer/server), this will be used for the server binaries.master branch build for Linux from the Server Download page (copy the URL for the recommended server version and use wget <url> to download it).cd ~/FXServer/server && tar xf fx.tar.xz (you need to have xz installed, on Debian/Ubuntu this is in the xz-utils package).git clone https://github.com/citizenfx/cfx-server-data.git ~/FXServer/server-dataserver-data folder (copy the example server.cfg file below into that file).server.cfg using sv_licenseKey "licenseKeyGoesHere".server-data folder.cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +exec server.cfgAn example server.cfg follows.
# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# These resources will start by default.
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure rconlog
# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.
sv_scriptHookAllowed 0
# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like set rcon_password "YOURPASSWORD"
#set rcon_password ""
# Set Game Build (https://docs.fivem.net/docs/server-manual/server-commands/#sv_enforcegamebuild-build)
#sv_enforceGameBuild 2802
# Nested configs!
#exec server_internal.cfg
# convars which can be used in scripts
set temp_convar "hey world!"
# Remove the `#` from the below line if you want your server to be listed as 'private' in the server browser.
# Do not edit it if you *do not* want your server listed as 'private'.
# Check the following url for more detailed information about this:
# https://docs.fivem.net/docs/server-manual/server-commands/#sv_master1-newvalue
#sv_master1 ""
# Add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.fivem:1 group.admin # add the admin to the group
# enable OneSync (required for server-side state awareness)
set onesync on
# Server player slot limit (see https://fivem.net/server-hosting for limits)
sv_maxclients 48
# Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
# -> replace "" with the key
set steam_webApiKey ""
# License key for your server (https://portal.cfx.re)
sv_licenseKey changeme
To set the FXServer to host a RedM server, apply the following to the server.cfg.
set gamename rdr3