TUTORIALBEGINNERSSERVER-SETUPFXSERVERTXADMINHOSTINGSERVER CREATION2026 GUIDEVPS SETUPROLEPLAY SERVER March 6, 2026 · 7 min read

How to Set Up a FiveM Server in 2026

I’m going to walk you through setting up a FiveM server from nothing to a working RP server with a framework and scripts. No filler, no “what is FiveM” introduction — if you’re reading this, you already know what it is and you want to make a server.

This guide assumes you’re starting completely fresh. By the end you’ll have a running server with ESX (or QBCore if you prefer), a database, and a few scripts installed.

Step 1: Get a Server

You have two options:

VPS / Dedicated Server (Recommended) Rent a server from a hosting provider. For FiveM, you want:

  • At least 4 CPU cores (preferably high single-thread performance)
  • 8GB+ RAM (16GB is better)
  • SSD storage (NVMe if possible)
  • Linux (Ubuntu 22.04 or Debian 12) or Windows Server
  • Decent network — low ping matters more than raw bandwidth

Popular hosts that work well: OVH, Hetzner, Contabo, or any VPS provider with decent specs. Expect to pay €15-40/month for something solid.

Local hosting (Testing only) You can run a server on your own PC for testing and development. Don’t do this for a production server — your players will suffer from your home internet’s upload speed and your PC needs to be running 24/7.

FiveM-specific hosts (ZAP-Hosting, etc.) These work but you’re paying a premium for a managed interface. Fine if you don’t want to deal with server administration. Less fine if you want full control.

Step 2: Install FXServer

FXServer is the actual server software. Here’s how to get it running:

On Linux (recommended):

# Create a directory for your server
mkdir -p ~/fxserver && cd ~/fxserver

# Download the latest server build
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/latest/fx.tar.xz

# Extract it
tar -xf fx.tar.xz

On Windows: Download the latest Windows build from the FiveM artifacts page, extract the ZIP to a folder like C:\FXServer\.

Step 3: Get a License Key

You need a Cfx.re license key to run a server.

  1. Go to CFX.re Portal
  2. Sign in with your Cfx.re account (create one if you don’t have one)
  3. Click “New Server” and fill out the form
  4. Copy the license key — you’ll need it for server.cfg

Keep this key private. It’s tied to your server and your account.

Step 4: Set Up txAdmin

txAdmin is a web-based management panel that comes bundled with FXServer. It makes managing your server dramatically easier than doing everything through config files and command line.

Start FXServer:

Linux:

cd ~/fxserver
./run.sh +set serverProfile default

Windows:

FXServer.exe +set serverProfile default

or just run the file FXServer.exe

txAdmin will start automatically and give you a URL (usually http://localhost:40120) and a PIN in the console. Open that URL, enter the PIN, and follow the setup wizard.

During txAdmin setup:

  1. Create an admin account
  2. Choose “Popular Recipes” when asked about deployment
  3. Select your framework recipe (ESX Legacy is what I recommend — see my framework comparison for why)
  4. txAdmin will download and configure the framework for you
  5. Enter your license key when prompted

This is genuinely the easiest part. txAdmin’s recipes handle 90% of the setup automatically.

Step 5: Set Up the Database

Your server needs a MySQL-compatible database. Most scripts store data in it — player characters, inventories, vehicles, houses, money, everything.

Install MariaDB:

Linux (Ubuntu/Debian):

sudo apt update
sudo apt install mariadb-server
sudo mysql_secure_installation

Windows: Download MariaDB from mariadb.org and run the installer.

Create a database:

CREATE DATABASE fivem;
CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'your_strong_password_here';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'localhost';
FLUSH PRIVILEGES;

Configure the connection in server.cfg:

set mysql_connection_string "mysql://fivem:your_strong_password_here@localhost/fivem?charset=utf8mb4"

If txAdmin’s recipe already set this up, just make sure the credentials match.

Step 6: Configure server.cfg

Your server.cfg is the heart of your server configuration. The txAdmin recipe creates one for you, but here are the important settings to check:

# Your server name (shows in the server list)
sv_hostname "My RP Server"

# Your license key
sv_licenseKey "your_key_here"

# Max players
sv_maxclients 64

# OneSync (required for modern FiveM)
set onesync on

# Steam API key (optional, for Steam identification)
# set steam_webApiKey "your_steam_api_key"

# Database connection
set mysql_connection_string "mysql://fivem:password@localhost/fivem?charset=utf8mb4"

# Resource load order
ensure oxmysql
ensure es_extended
ensure ox_lib
# ... your scripts here

Step 7: Install Your First Scripts

Now you need to actually put stuff on the server. If you used a txAdmin recipe, you already have the framework and some basic scripts. But you’ll want to add more.

Read my complete installation guide for the detailed process, but the short version is:

  1. Download the script
  2. Put it in resources/
  3. Add ensure scriptname to server.cfg
  4. Import the SQL file if there is one
  5. Restart

For a list of what scripts you should install first, check out my must-have scripts guide.

Step 8: Port Forwarding and Going Live

If you’re on a VPS, your ports are probably already open. If you’re self-hosting, you need to forward these ports on your router:

  • TCP 30120 — game traffic
  • UDP 30120 — game traffic
  • TCP 40120 — txAdmin web panel (only if you want to access it remotely)

Your server should now appear in the FiveM server list. Players can also connect directly with your server’s IP: connect your.ip.here:30120

Step 9: The Stuff People Forget

Your server is running. But before you invite players, do these things:

Set up automatic restarts. Servers that run for days without restarting accumulate memory leaks and performance degradation. Schedule a restart every 6-12 hours through txAdmin.

Set up backups. Your database is your server’s memory. If it dies, everything dies. Set up automated daily backups of your MariaDB database. A simple cron job works:

mysqldump -u fivem -p fivem > /backups/fivem_$(date +%Y%m%d).sql

Test with a few people first. Don’t announce your server publicly until you’ve had 5-10 friends play on it for a few days. They’ll find the obvious bugs and broken configs so your first real players don’t have to.

Write server rules. Sounds obvious but so many servers skip this and then wonder why they have RDM problems. Clear rules, clearly displayed, enforced consistently.

Common Setup Problems

“Server not showing in server list” Make sure OneSync is enabled (set onesync on), your license key is valid, and your ports are open. Some VPS providers block FiveM ports by default — check their firewall settings.

“Can’t connect — connection timed out” Firewall issue. Make sure TCP and UDP 30120 are open. On Linux, check ufw status or iptables -L.

“Framework doesn’t load / errors on startup” Usually a database connection problem. Double-check your mysql_connection_string. Try connecting to the database manually with the same credentials to verify they work.

“Everything loads but I spawn in the ocean” Your spawn script isn’t working or isn’t installed. Make sure you have a spawn/multicharacter script and it’s ensured after the framework.

You’re Live

That’s a working FiveM server. From here it’s about adding content, building a community, and fine-tuning the experience. Here are some next reads:

Got questions? Discord is the fastest way to get help.

YBN
YBN Scripts
FiveM script developer at YBN. Building premium ESX, QBCore & Qbox resources.

Related Posts

Need scripts for your server?

Check out our premium FiveM resources — ESX, QBCore & Qbox supported.

Browse Premium Scripts → Free Scripts →