Result: A fully functional, joinable FiveM server with QBCore framework running and database persistence enabled.
This comprehensive guide will walk you through how to create a 5M server (FiveM server) from scratch. By the end of this tutorial, you’ll have a working FiveM server that players can join, complete with a framework, database, and proper configuration.
Before you start learning how to create a 5M server, ensure you have:
30120 (TCP/UDP) for game server, 40120 (TCP) for txAdminEstimated time: 30-45 minutes
Difficulty: Beginner
The first step in learning how to create a 5M server is preparing your system with the necessary dependencies and firewall rules.
A Cfx.re license key is required to create a 5M server. This is a critical step that many tutorials skip.
Important: Keep your license key secure. Never commit it to version control or share it publicly.
Now we’ll download the FiveM server files. This is the core of your 5M server.
Before starting your 5M server, you must configure the license key. This is essential for server operation.
A database is required for frameworks like QBCore. Let’s set up MariaDB/MySQL.
Now we’ll start the FiveM server and complete the txAdmin setup. This is where your 5M server comes to life.
After the wizard completes, you need to verify and configure your server.cfg file. This file controls your 5M server’s behavior.
Now let’s verify that your server is fully functional and joinable.
Server Console
txAdmin Web Interface
http://your-server-ip:40120Database Connection
Network Connectivity
Test if server is listening on port 30120:
Join Test
your-server-ip:30120For production servers, set up a systemd service so your 5M server starts automatically on boot.
When learning how to create a 5M server, you may encounter these issues:
Problem: Server shows “Invalid license key” or “License key required”
Solution:
echo $FIVEM_LICENSE_KEY (Linux) or $env:FIVEM_LICENSE_KEY (Windows)server.cfg: set sv_licenseKey "your-key"Problem: Framework fails to connect to database
Solution:
sudo systemctl status mariadb (Linux)mysql -u fivem -p fivem_dbserver.cfg matches database credentialsmysql -u root -p -e "SHOW DATABASES;"Problem: “Port 30120 already in use”
Solution:
sudo netstat -tulpn | grep 30120 (Linux) or Get-NetTCPConnection -LocalPort 30120 (Windows)server.cfgProblem: Server shows online but can’t connect
Solution:
sv_lan is set to 0 in server.cfg (not LAN mode)telnet localhost 30120Problem: Resources fail to start or show errors
Solution:
resources/ directoryfxmanifest.lua files are validCongratulations! You’ve successfully learned how to create a 5M server. Now explore these topics:
This tutorial covered the complete process of how to create a 5M server:
Your FiveM server is now ready for players to join!