Creating a FiveM server could be a struggle for some people who don't have any experience with it. We're here to help! This guide will show you how to install and configure FiveM on your Ubuntu 18.04 VPS. In this guide, we work with a freshly installed server.

System Requirements

FiveM needs more processing power then it needs RAM. Some specific resources could be very intensive on your CPU (=processor).
It's important you always keep in mind that depending on what resources you use, the server's specifications could vary. This also
counts for the CPU's clock speed. The storage is also dependant on your server. If you stream many vehicles or outfits,
the storage could go up quite a bit.

We recommend the following system specifications (32 players considered):
4 GB Ram
2 Cores (Threads)
20 GB SSD

Configurating the VPS

First, we're going to work on safety of your VPS. The default superuser called root can perform sensitive tasks. By making a sudo user you can prevent this. The user created can't perform any tasks in the /root directory, however it can still run commands by using sudo <command> which grants the privilege to run the command.

How to create a new user and provide sudo access:

Log into your VPS using your root account and add a new user with the command:
adduser mynewusername
The command adduser creates a new user and home directory for that user.
The system will ask you to create a new password for the user.

Strong passwords should include atleast 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include atleast one special character. We don't recommend using repeated characters, anything related to you or your server and try to keep the password on a secure location people can't access.
The system will now prompt you asking for additional information, you can press ENTER on all of them. If the system asks you if the information is correct press Y and ENTER
Now grant your user sudo privileges. Use the following command:
usermod -aG sudo mynewusername

You have now created a new user with sudo privileges!

Installing FiveM

Now we're going to download, install and configure FiveM's FX-Server to work.

Note: This is only the basic set-up for FX-Server without any other scripts then the ones provided by FiveM.

Requirements:
The sudo user we created above
Installed git on the system
sudo apt install git
Updated and upgraded all packages:
sudo apt update && sudo apt upgrade -y
If the system prompts asking to restart services during package upgrades without asking, select Yes and press ENTER. If the prompt is asking you what you want to do about modified configuration file, select install the package maintainer's version and press ENTER.
Make sure to log out of the root user in your terminal, instead connect using the information of the sudo user you created above.
Downloading & Installing FX-Server

Now we're going to install FX-Server on your VPS. Let's make the directory where your serverfiles will be at first.

Head over to your home directory.
cd /home/
Make a FiveM folder to avoid crossing diffrent programs you might install in the future and enter the folder.
sudo mkdir fivem/ && cd ./fivem
Create two folders: one for the server's resources and configurations and one for the server's runtime/fx-server.
sudo mkdir fxserver && sudo mkdir server-data
Copy the URL of the latest version of the FiveM Linux Artifacts Library. Now download the file by using the wget command:
sudo wget pastethelinkhere
Unpack the FiveM Artifact into the fxserver folder we created earlier by running this command:
sudo tar -xvf fx.tar.xz -C /home/fivem/fxserver
Grab the default resources provided by FiveM using the following command:
sudo git clone https://github.com/citizenfx/cfx-server-data.git server-data
Use the following command to make a new file called server.cfg in the server-data directory.
sudo nano /home/fivem/server-data/server.cfg
If the screen opened paste this inside by pressing RIGHT MOUSE BUTTON
# 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 fivem
ensure hardcap
ensure rconlog
ensure scoreboard

# 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 rcon_password "YOURPASSWORD"
#rcon_password ""

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

# A valid locale identifier for your server's primary language.
# For example "en-US", "fr-CA", "nl-NL", "de-DE", "en-GB", "pt-BR"
sets locale "root-AQ"
# 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't matter, any banner sized image will be fine.
#sets banner_detail "https://url.to/image.png"
#sets banner_connecting "https://url.to/image.png"

# Set your server's hostname
sv_hostname "FXServer, but unconfigured"

# 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 "hey world!"

# Uncomment this line if you do not want your server to be listed in the server browser.
# Do not edit it if you *do* want your server listed.
#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

# Hide player endpoints in external log output.
sv_endpointprivacy true

# enable OneSync with default configuration (required for server-side state awareness)
onesync_enabled true

# Server player slot limit (must be between 1 and 32, unless using OneSync)
sv_maxclients 32

# 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://keymaster.fivem.net)
sv_licenseKey changeme

Now save the file by pressing CTRL + X, then press Y and ENTER.
Was this article helpful?
Cancel
Thank you!