Setting up a Vanilla FXServer

A step-by-step guide on setting up a Vanilla FXServer.

Vanilla Server Installation steps

Windows

Prerequisites

  1. Git if you want to follow the recommended way of cloning the base server data.

Installation

  1. Create a new directory (for example C:\FXServer\server), this will be used for the server binaries.

  2. Download the current recommended master branch build for Windows from the Windows server build listing.

  3. Extract the build into the directory previously created.

    • 3b. Use any third-party archiving tool (such as WinRAR or 7-Zip) to open the .7z file.
  4. Clone cfx-server-data in a new folder outside of your server binaries folder, for example, C:\FXServer\server-data.

    • 4b. 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.)
  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 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)


Linux

Prerequisites

  1. Git if you want to follow the recommended way of cloning the base server data.
  2. xz or xz-utils package.

Installation

  1. Create a new folder (for example mkdir -p ~/FXServer/server), this will be used for the server binaries.
  2. Download the current recommended master branch build for Linux from the Linux server build listing (copy the URL for the recommended server version and use wget <url> to download it).
  3. Extract the build to the directory that was previously created, using cd ~/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.
    For example: git clone https://github.com/citizenfx/cfx-server-data.git ~/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.
    cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +exec server.cfg

server.cfg

An example server.cfg follows.

# Only change the IP if you&#39;re using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp &#34;0.0.0.0:30120&#34;
endpoint_add_udp &#34;0.0.0.0:30120&#34;

# 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&#39;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 &#34;YOURPASSWORD&#34;
#set rcon_password &#34;&#34;

# A comma-separated list of tags for your server.
# For example:
# - sets tags &#34;drifting, cars, racing&#34;
# Or:
# - sets tags &#34;roleplay, military, tanks&#34;
sets tags &#34;default&#34;

# A valid locale identifier for your server&#39;s primary language.
# For example &#34;en-US&#34;, &#34;fr-CA&#34;, &#34;nl-NL&#34;, &#34;de-DE&#34;, &#34;en-GB&#34;, &#34;pt-BR&#34;
sets locale &#34;root-AQ&#34; 
# please DO replace root-AQ on the line ABOVE with a real language! :)

# Set an optional server info and connecting banner image url.
# Size doesn&#39;t matter, any banner sized image will be fine.
#sets banner_detail &#34;https://url.to/image.png&#34;
#sets banner_connecting &#34;https://url.to/image.png&#34;

# Set your server&#39;s hostname. This is not usually shown anywhere in listings.
sv_hostname &#34;FXServer, but unconfigured&#34;

# Set your server&#39;s Project Name
sets sv_projectName &#34;My FXServer Project&#34;

# Set your server&#39;s Project Description
sets sv_projectDesc &#34;Default FXServer requiring configuration&#34;

# Set Game Build (https://docs.fivem.net/docs/server-manual/server-commands/#sv_enforcegamebuild-build)
#sv_enforceGameBuild 2802

# Nested configs!
#exec server_internal.cfg

# Loading a server icon (96x96 PNG file)
#load_server_icon myLogo.png

# convars which can be used in scripts
set temp_convar &#34;hey world!&#34;

# Remove the `#` from the below line if you want your server to be listed as &#39;private&#39; in the server browser.
# Do not edit it if you *do not* want your server listed as &#39;private&#39;.
# Check the following url for more detailed information about this:
# https://docs.fivem.net/docs/server-manual/server-commands/#sv_master1-newvalue
#sv_master1 &#34;&#34;

# Add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don&#39;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)
# -&gt; replace &#34;&#34; with the key
set steam_webApiKey &#34;&#34;

# License key for your server (https://keymaster.fivem.net)
sv_licenseKey changeme

Common issues

  • 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 also can’t connect (i.e. ‘timed out’/‘connection refused’), you didn’t add +exec.
  • If you get ‘no license key was specified’, one of the above two mistakes may apply.
  • If you’re facing slow server startups on Windows, refer to this.