Skip to main content

Install a FiveM server

This guide explains how to install a FiveM server on your Linux VPS.

Prerequisites​

  • VPS with minimum 4 GB RAM
  • FiveM license (Cfx.re key)

Installation​

1. Create a user​

adduser fivem
usermod -aG sudo fivem
su - fivem

2. Download FiveM Server​

mkdir -p ~/FXServer/server
cd ~/FXServer/server
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/LATEST/fx.tar.xz
tar xf fx.tar.xz

3. Create the data folder​

mkdir -p ~/FXServer/server-data
cd ~/FXServer/server-data
wget -O server.cfg https://raw.githubusercontent.com/plebmasters/cfx-default-serverconfig/master/server.cfg

4. Configuration​

Edit server.cfg:

nano server.cfg

Modify:

  • sv_hostname: Your server name
  • sv_licenseKey: Your Cfx.re key
  • sv_maxclients: Maximum number of players

5. Startup​

cd ~/FXServer/server-data
bash ~/FXServer/server/run.sh +exec server.cfg

Automatic startup with Screen​

screen -S fivem
bash ~/FXServer/server/run.sh +exec server.cfg

Detach with Ctrl+A then D.

To resume: screen -r fivem

tip

For more FiveM configurations, see our FiveM section.