How to Host a FiveM Server on Linux (FXServer + txAdmin Guide)

Running FXServer on a Linux machine is the standard approach for any production FiveM RP server. Linux gives you lower overhead, better uptime control, and full command-line access to every process — but the setup has a few Linux-specific steps that differ from the Windows docs. This guide covers the full path: downloading the proot Linux artifacts, writing a minimal server.cfg, keeping the server alive with screen, tmux, or systemd, and getting txAdmin running for day-to-day management.

Prerequisites

  • A Linux VPS or dedicated machine (Ubuntu 22.04 LTS or Debian 12 recommended)
  • A free FiveM server registration key from portal.cfx.re — one key per server, up to three active keys per account
  • A legal copy of GTA V associated with the same Cfx.re account
  • Packages: wget, git, xz-utils, and either screen or tmux
sudo apt update && sudo apt install -y wget git xz-utils screen tmux

Step 1 — Download the Linux Artifacts

FiveM’s Linux server builds live at the build_proot_linux artifact path — not the Windows path. The builds use proot, a user-space implementation of chroot that lets FXServer run in an isolated environment without root privileges. Always pull from the Recommended channel, which is the build that Cfx.re has actively QA’d for stability.

Visit runtime.fivem.net/artifacts/fivem/build_proot_linux/master/, copy the URL for the latest recommended build (labelled “LATEST RECOMMENDED”), and download it:

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

Replace XXXX-HASH with the actual build identifier from the artifacts page. The tar xf command requires the xz-utils package on Debian/Ubuntu systems.

Step 2 — Clone cfx-server-data

The server binaries and the server data (resources, config) live in separate folders. Clone the official cfx-server-data repository into a sibling directory:

git clone https://github.com/citizenfx/cfx-server-data.git ~/FXServer/server-data

This gives you the default resources such as mapmanager, chat, spawnmanager, sessionmanager, and basic-gamemode — all referenced in the starter server.cfg.

Step 3 — Write Your server.cfg

Create server.cfg inside ~/FXServer/server-data/. The file uses FXServer’s convar syntax. A minimal working config looks like this:

endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# Default resources from cfx-server-data
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure rconlog

sets locale "en-US"
sv_hostname "My FiveM Server"
sets sv_projectName "My RP Server"
sets sv_projectDesc "A FiveM roleplay server"

# OneSync — enable for state awareness; required once sv_maxclients is 32+
set onesync on

sv_maxclients 48
sv_licenseKey "YOUR_LICENSE_KEY_HERE"

Key points: ensure (not start) is the current directive for loading resources. OneSync must be enabled once sv_maxclients is 32 or higher — set it to on (recommended) or legacy; on is specifically required for slots above 64. Your sv_licenseKey comes from the Cfx.re portal — never share it or use the same key on two servers simultaneously. For a full breakdown of every convar, use the FiveM server.cfg generator to build a config interactively. Our FiveM server documentation covers deeper configuration options including voice, database, and framework setup.

Step 4 — First Start with run.sh

Always launch the server from the server-data directory, passing +exec server.cfg so FXServer loads your config on startup:

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

If you see “permission denied”, make the script executable first: chmod +x ~/FXServer/server/run.sh.

Step 5 — Keep It Running: screen, tmux, or systemd

Without a process manager, the server dies when your SSH session ends. You have three options:

Option A — screen (simplest)

screen -S fivem bash -c 'cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +exec server.cfg'

Detach with Ctrl+A then D. Reattach later with screen -r fivem.

Option B — tmux (recommended for systemd compatibility)

tmux new-session -s fivem -d 'cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +exec server.cfg'

Reattach with tmux attach -t fivem. tmux is important if you also want systemd management — see below.

Option C — systemd service (auto-start on reboot)

There is a known compatibility issue between newer FXServer Linux artifacts and direct systemd execution: the Mono runtime can segfault when launched directly under systemd. The reliable workaround is to have systemd launch the server inside a tmux session:

[Unit]
Description=FiveM FXServer
After=network.target

[Service]
Type=forking
User=fivem
ExecStart=/usr/bin/tmux new-session -s fivem -d 'cd /home/fivem/FXServer/server-data && bash /home/fivem/FXServer/server/run.sh +exec server.cfg'
ExecStop=/usr/bin/tmux kill-session -t fivem
Restart=on-failure

[Install]
WantedBy=multi-user.target

Save this as /etc/systemd/system/fivem.service, then enable it:

sudo systemctl daemon-reload
sudo systemctl enable fivem
sudo systemctl start fivem

Step 6 — Setting Up txAdmin on Linux

txAdmin is bundled with every FXServer build from 2524 onward — you do not install it separately. To launch with txAdmin, run FXServer without the +exec argument. On Linux, use screen or tmux:

screen -S fivem bash -c 'cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +set serverProfile default +set txAdminPort 40120'

The +set serverProfile convar tells txAdmin which profile folder to load from the txData directory (the default profile name is default). On first boot, txAdmin prints an access PIN to the console; open http://YOUR_SERVER_IP:40120 in your browser, enter the PIN, and complete the setup wizard. txAdmin then manages starting and stopping FXServer and gives you a web UI for resource management, scheduled restarts, and player bans.

Make sure port 40120 is open in your firewall if you need to access txAdmin remotely. Port 30120 (TCP + UDP) must also be open for players to connect.

Linux vs. Managed Hosting: Quick Comparison

FactorSelf-hosted Linux VPSManaged FiveM hosting
Setup time1–3 hoursUnder 5 minutes
Root accessFullPanel access
txAdminManual install via run.shIncluded, preconfigured
Artifact updatesManual wget + re-extractOne-click or automated
DDoS protectionDepends on VPS providerBuilt-in on quality hosts
CostVPS cost onlyBundled, predictable pricing

If managing artifacts, systemd quirks, and Linux firewalls sounds like overhead you’d rather skip, a managed provider handles all of it. Our FiveM server hosting plans include txAdmin out of the box, DDoS-filtered network endpoints, and one-click artifact updates — so you spend time building your server, not maintaining the stack.

Next Steps

Once your server is running, the most common next tasks are adding a framework (QBCore or ESX), installing voice, and locking down administration. These guides pick up exactly where this one ends:

Frequently Asked Questions

Why does FXServer crash under systemd on Linux?

This is a known issue with newer Linux artifacts where the Mono runtime triggers a segmentation fault (SIGSEGV) when launched directly as a systemd service. The fix is to have systemd launch the server inside a tmux session (ExecStart=/usr/bin/tmux new-session -s fivem -d '...') rather than calling run.sh directly. Running the server in a plain screen or tmux session without systemd also avoids the problem entirely.

What is the difference between the “Recommended” and “Latest” artifact channels?

The Recommended channel at runtime.fivem.net/artifacts/fivem/build_proot_linux/master/ contains builds that Cfx.re has put through internal QA — these are the safest to run on production servers. The Latest (optional) channel contains the most recent build but may include regressions. For a live RP server, always run Recommended and update deliberately rather than chasing Latest automatically.

Do I need to open any ports on my Linux firewall?

Yes. FXServer needs port 30120 TCP and UDP open for player connections. If you are using txAdmin remotely, also open port 40120 TCP (or whichever port you set with +set txAdminPort). On Ubuntu/Debian with ufw: sudo ufw allow 30120/tcp && sudo ufw allow 30120/udp && sudo ufw allow 40120/tcp. Never expose port 40120 to the public internet without additional access controls — restrict it to your IP or use an SSH tunnel.

Ready to play?

Run your own FiveM server with XGamingServer

Spin up an always-on FiveM server your friends can join in minutes — no port-forwarding, no tech headaches.

99.9%Uptime SLA
< 5 minInstant setup
24/7Human support
DDoSProtected
Instant setup Your server is live in minutes with a one-click control panel.
Mods & plugins Install mods, plugins and workshop content in a few clicks.
DDoS protected Enterprise DDoS mitigation keeps your server online 24/7.
Low-latency hardware Premium CPUs & NVMe SSDs for lag-free multiplayer.
Free backups Automatic backups so your world is never lost.
Real human support Gamers helping gamers — 24/7, no bots, no scripts.

Pick your FiveM plan & play in minutes

See all plans
Starter $8.40/mo 4 GB RAM Renews $12/mo Buy now
Rookie $17.50/mo 8 GB RAM Renews $25/mo Buy now
Pro $24.50/mo 12 GB RAM Renews $35/mo Buy now