Installing the server
A complete step-by-step guide to installing and configuring a FiveM server on a Linux VPS.
Prepare the server
First, get the VPS ready for FiveM.
Update the system
Update all system packages to their latest versions for stability and security.
sudo apt update && sudo apt upgrade -yInstall the dependencies
Install screen, curl and unzip. You need them in the next steps.
sudo apt install screen curl unzip -yCreate the server directory
Create a directory for the FiveM server files and go into it.
mkdir -p ~/fivem_server
cd ~/fivem_serverInstall the FiveM server
Next, download and unpack the FiveM server files.
Download the server files
Download the latest recommended build of the FiveM server artifacts.
The command below downloads server build 17000, the recommended build as of 23 July 2025. You can find every available build on the official FiveM artifacts page.
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/17000-e0ef7490f76a24505b8bac7065df2b7075e610ba/fx.tar.xzCreate the data directory
Create the server-data directory, which holds your server's configuration.
mkdir ~/fivem_server/server-dataSet up and start the server (txAdmin)
Set up the server with txAdmin, which makes managing it much easier.
Start the server in a screen session
Use screen so the server keeps running in the background after you close the terminal. Then run the start script with the flag that opens the txAdmin setup.
cd ~/fivem_server
screen -S fivem bash run.sh +set txAdminPort 40120Finish the setup in your browser
Open http://<YOUR_VPS_IP>:40120 in your browser and follow the on-screen instructions. You will need the PIN shown in the console.
Start the server
When the setup is done, start the server with the button in txAdmin.
Manage the server
Here is how to keep the server running in the background and start it automatically.
Why screen?
screen creates a virtual terminal session. Processes in it, such as the FiveM server, keep running even if your SSH connection drops.
Basic screen commands:
- Detach from the session:
Ctrl + A, thenD - Reattach to the session:
screen -r fivem - List sessions:
screen -ls - Stop the server: reattach to the session and press
Ctrl + C
Start the server automatically (systemd)
To start the server automatically after the VPS restarts, set up a systemd service.
Create the service file
sudo nano /etc/systemd/system/fivem.serviceAdd the configuration
Paste the content below into the file. Make sure the paths (WorkingDirectory and ExecStart) are correct.
[Unit]
Description=FiveM Server
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/fivem_server
ExecStart=/bin/bash /root/fivem_server/run.sh +exec server.cfg +set txAdminPort 40120
Restart=always
[Install]
WantedBy=multi-user.targetSave the file with Ctrl + S, then close the editor with Ctrl + X.
Enable the service
Reload systemd, start the service and enable it at boot.
sudo systemctl daemon-reload
sudo systemctl start fivem.service
sudo systemctl enable fivem.service