FiveM is the best-known multiplayer modification for GTA V. On your own FiveM server, you and your community can play roleplay, racing, or freeroam with your own rules, vehicles, and scripts. The server is managed through txAdmin, the official web interface from Cfx.re. There, you can set up the server, install resources, and manage players—all in your browser.
In this guide, we’ll show you two ways to do it: the easy way, as a One-Click App that gets your server, txAdmin, and database up and running in just a few clicks, and a manual installation with Docker from the console on your Linux server.
Prefer not to manage your own server? Don’t want to take care of the server and updates yourself? A FiveM server is the easier option.
With your VPS’s One-Click Apps, you can install a ready-to-use FiveM server along with txAdmin and a MariaDB database. The app automatically enters the database credentials in txAdmin, so you only need to confirm them during setup.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
- At least 4 GB RAM and 2 vCPUs for FiveM. 8 GB RAM, 4 vCPUs, and a 30 GB SSD are recommended. You’ll need more for many players, vehicles, and scripts.
- A free Cfx.re account. You’ll use it to sign in to txAdmin and generate your server’s license key.
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Find FiveM Server in the app catalog and click Install app.
- Use a custom subdomain or zap.cloud is already selected, with a random name. Leave this option enabled or enter your own name. With a domain, you can access txAdmin over HTTPS.
- You don’t need to enter anything under App configuration. All three fields are optional:
| Field | Description |
|---|---|
FIVEM_GAME_PORT | The port players connect through. The default is 30120. |
FIVEM_TXADMIN_PORT | The txAdmin port. The default is 40120. |
NO_DEFAULT_CONFIG | Must remain set to 1, otherwise the server starts without txAdmin. |
- Click Queue installation. It takes a few minutes for the server and database to be ready.
The app generates the RCON password and database credentials during installation. You can find them in the app settings (gear icon) under App environment > Automatically generated values.
The first time you open txAdmin, it asks for a four-digit PIN. Here’s how to find the PIN and set up your txAdmin account:
- Click the Logs icon on the app card. In the live logs, find the line “Use this PIN to add a new master account”; the PIN appears after it.
- Open the app’s Access link. Without a domain, you can access txAdmin at
http://<IP deines vServers>:40120. - Enter the PIN and click Link Account. You’ll be redirected to Cfx.re, where you can sign in with your Cfx.re account.
- Back in txAdmin, set a Backup Password. You can use this password to access txAdmin if signing in through Cfx.re doesn’t work. Your Discord ID is optional.
Next, the txAdmin setup wizard starts:
- Server name and template: Choose a name and select a template under Popular Recipes, such as a roleplay framework like QBCore or ESX. For details about the available options, see FiveM: txAdmin Setup.
- License key: Every FiveM server needs its own key. See FiveM: Add Your Own License Keys for instructions on generating one in the Cfx.re portal. Enter it in the wizard, and txAdmin will add it to
server.cfg. - Database: If the template requires a database, the fields are already filled in: host
fivem-db, port3306, databasefivem, and the generated credentials. Simply keep these values.
Finally, txAdmin starts your server.
You can find your server’s address on the app card under Connection, for example, <IP deines vServers>:30120. In the FiveM client, press F8 and enter connect <IP deines vServers>:30120. For other ways to connect, see FiveM: Connect to the Server.
Access txAdmin over HTTPS only
txAdmin is available over HTTPS through the app’s domain, and also over port 40120 without encryption. Always use the domain access link to sign in, so your password is transmitted securely.
- You can find new app versions in the app settings (gear icon) under App update > Check for updates. If a new version is available, install it by clicking Apply update.
- Your server data, resources, and database are stored in dedicated volumes and are retained when you update. Before uninstalling the app, back up anything you want to keep. You can also delete the volumes during uninstallation.
The rest of this guide covers manual installation using Docker Compose from the console. It uses the same spritsail/fivem image as the One-Click App and a MariaDB database. This guide is based on the image documentation and txAdmin environment variables.
Connect to your server using SSH. See First Access via SSH for instructions. Then install Docker and Docker Compose as described in Install Docker.
Create a folder for the server and navigate to it:
mkdir -p /opt/fivem && cd /opt/fivem
Use nano .env to create a file named .env with passwords for the database and RCON:
DB_USER=fivem
DB_PASSWORD=12345-ersetzen
DB_ROOT_PASSWORD=67890-ersetzen
RCON_PASSWORD=24680-ersetzen
Replace the example values with your own strong, long passwords.
Use nano docker-compose.yml to create a file named docker-compose.yml with the following contents:
services:
fivem:
image: spritsail/fivem:latest
restart: unless-stopped
tty: true
stdin_open: true
depends_on:
- fivem-db
ports:
- "30120:30120/tcp"
- "30120:30120/udp"
- "40120:40120/tcp"
environment:
- RCON_PASSWORD=${RCON_PASSWORD}
- NO_DEFAULT_CONFIG=1
- NO_LICENSE_KEY=1
- TXHOST_DEFAULT_DBHOST=fivem-db
- TXHOST_DEFAULT_DBPORT=3306
- TXHOST_DEFAULT_DBUSER=${DB_USER}
- TXHOST_DEFAULT_DBPASS=${DB_PASSWORD}
- TXHOST_DEFAULT_DBNAME=fivem
volumes:
- fivem-config:/config
- fivem-txdata:/txData
fivem-db:
image: mariadb:11.8
restart: unless-stopped
environment:
- MARIADB_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MARIADB_USER=${DB_USER}
- MARIADB_PASSWORD=${DB_PASSWORD}
- MARIADB_DATABASE=fivem
volumes:
- fivem-mariadb-data:/var/lib/mysql
volumes:
fivem-config:
fivem-txdata:
fivem-mariadb-data:
Here’s what the most important entries do:
tty: trueis required. Without a terminal, the container crashes on startup.NO_DEFAULT_CONFIG=1starts the server with txAdmin instead of a fixedserver.cfg.NO_LICENSE_KEY=1means the container won’t require a license key. You’ll enter the key later in the txAdmin wizard.- The
TXHOST_DEFAULT_DB...values prefill the database fields in the txAdmin wizard.
Start both containers:
docker compose up -d
The txAdmin PIN is in the server log:
docker compose logs fivem | grep PIN
Open http://<IP deines Servers>:40120 in your browser and set up txAdmin as described above under Set up txAdmin.
Players connect through port 30120 (TCP and UDP), while txAdmin runs on port 40120 (TCP). If you’re using a firewall such as ufw, open the ports:
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw allow 40120/tcp
txAdmin without HTTPS
With a manual installation, txAdmin runs over HTTP only. Instead of exposing port 40120 to the internet, you can secure txAdmin with a Cloudflare Tunnel. See Set Up a Cloudflare Tunnel for txAdmin for instructions.
The spritsail/fivem:latest image always contains the latest FiveM build. Pull it and restart the server:
cd /opt/fivem
docker compose pull
docker compose up -d
Your data in the volumes will be retained.
Congratulations, your FiveM server is up and running. For instructions on installing resources, managing players, and configuring your server, check out our FiveM guides, such as FiveM: txAdmin Setup and FiveM: Connect to the Server.
If you have any questions or run into problems, our support team is here to help every day.