Atlantic.Net Blog

How to Install FiveM Game Server on Ubuntu

FiveM is a multiplayer game server that allows you to play on customized dedicated servers. It was specifically designed for creativity. You can create your server and make your dreams come true. It provides a set of tools to personalize the gameplay experience of your server. With FiveM, you can make anything, including roleplay, drifting, racing, deathmatch, or something completely original.

This tutorial will show you how to install FiveM on Ubuntu 20.04.


  • A fresh Ubuntu 20.04 Server (at least 2GB RAM)
  • A valid domain name pointed to your server IP
  • A root password configured on your server

In This Article

Step 1 – Install Required Dependencies

Before starting, you will need to install some dependencies on your server. You can install all of them with the following commands:

apt-get update -y
apt-get install screen wget git -y

Once all the packages are installed, you can proceed to the next step.

Step 2 – Install and Configure FiveM

First, create a directory for FiveM and download the latest version of FiveM inside the directory:

mkdir ~/fivem_server
cd ~/fivem_server

Once the download is completed, extract the downloaded file with the following command:

tar -xvf fx.tar.xz

Next, you must download the CFX server data to your system. You can download it with the following command:

git clone ~/fivem_resources

Next, you will need to create a FiveM configuration file.

You can create it with the following command:

nano ~/fivem_resources/server.cfg

Add the following lines, including your FiveM Licence:

# Only change the IP if you’re using a server with multiple network interfaces, otherwise 
change the port only.
endpoint_add_tcp "”
endpoint_add_udp "”

# 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”

# Set an optional server info and connecting banner image url.
# Size doesn’t matter, any banner sized image will be fine.
#sets banner_detail "”
#sets banner_connecting "”

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

# Nested configs!
#exec server_internal.cfg

# Loading a server icon (96×96 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.steam:110000100000000 group.admin # add the admin to the group

# Hide player endpoints in external log output.
sv_endpointprivacy true

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

# License key for your server (
sv_licenseKey i1mqzvi2eukui85p8cb0uddanqsru2lk

Save and close the file when you are finished.

Next, you can start the FiveM server with the following command:

cd ~/fivem_resources && bash ~/fivem_server/ +exec server.cfg

Once the server has started successfully, you should get the following output:

Note: This process will take several minutes to start

--------------------------------] 0/315Server license key authentication succeeded. Welcome!
Authenticating with Nucleus...
-------------------------------] 11/315 fff
cccc ff xx xx rr rr eee
cc ffff xx rrr r ee e
cc ff xx ... rr eeeee
ccccc ff xx xx ... rr eeeee

Authenticated with Nucleus:
-------------------------] 74/315-- [server notice: tebex_not_set]
Monetize your server using Tebex! Visit for more info.

Press CTRL + C to stop the server.

Step 3 – Create a Systemd Service File for FiveM

Creating a systemd service file to manage the FiveM service is a good idea. You can create it with the following command:

nano /lib/systemd/system/fivem.service

Add the following lines:

Description=FiveM server



Save and close the file, then create a FiveM start script:

nano /usr/bin/
Add the following lines:

screen -dm bash -c 'cd /root/fivem_resources && bash /root/fivem_server/ +exec 

Save and close the file, then set proper permission:

chmod +x /usr/bin/

Next, reload the systemd daemon with the following command:

systemctl daemon-reload

Next, start FiveM and enable it to start at system reboot:

systemctl start fivem
systemctl enable fivem

You can verify the status of FiveM with the following command:

systemctl status five

You should get the following output:

  • fivem.service - FiveM server
Loaded: loaded (/lib/systemd/system/fivem.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2021-01-13 15:09:13 UTC; 6s ago
Process: 24132 ExecStart=/usr/bin/ (code=exited, status=0/SUCCESS)
Main PID: 24136 (screen)
Tasks: 67 (limit: 4691)
Memory: 48.1M
CGroup: /system.slice/fivem.service
├─24136 SCREEN -dm bash -c cd /root/fivem_resources && bash /root/fivem_server/ +exec server.cfg
├─24148 /root/fivem_server/alpine/opt/cfx-server/ --
library-path /root/fivem_server/alpine/usr/lib/v8/:/root/f>
└─24151 /root/fivem_server/alpine/opt/cfx-server/ --
library-path /root/fivem_server/alpine/usr/lib/v8/:/root/f>

Jan 13 15:09:13 ubuntu2004 systemd[1]: Starting FiveM server...
Jan 13 15:09:13 ubuntu2004 systemd[1]: Started FiveM server.

By default, FiveM listens on port 30120. You can check it with the following command:

ss -antpl | grep 30120

You should get the following output:

LISTEN 0 128* users:(("ld-musl-x86_64.",pid=24148,fd=57))


Congratulations! You have successfully installed and configured a FiveM game server on Ubuntu 20.04. You can now download the FiveM client on your desktop system and play using FiveM on your virtual private server from Atlantic.Net!

Learn more about our VPS hosting services and Virtual private servers.

Get a $250 Credit and Access to Our Free Tier!

Free Tier includes:
G3.2GB Cloud VPS a Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year