Setup guide
Get your server online
Never run a FiveM server before? No problem. Follow these six steps – most people are done in about 30 minutes.
1Download & unzip your server
Open your account and click Download server. Unzip the file – you get a folder called
5mstart-serverwith yourresources, a readyserver.cfg, asqlfolder with the database files and aREADME.mdwith notes for each script.Put the folder wherever your server will run: your own PC for testing, or a Windows/Linux VPS or dedicated server for a public server.
2Get FXServer (the FiveM server software)
FXServer is not part of the package – download it for free from the official FiveM artifacts page. Pick your system (Windows or Linux) and download the latest recommended build.
Unzip it into its own folder next to your server, for example:
my-fivem/ artifacts/ ← FXServer (FXServer.exe or run.sh) 5mstart-server/ ← your download (server.cfg, resources, sql)3Get a free license key
Every FiveM server needs a license key. Sign in at portal.cfx.re with your Cfx.re (FiveM forum) account, open Server Keys and create a new key. Copy it – you'll need it in step 5. It's free.
4Create the database and import the SQL files
Your server stores players, jobs, vehicles and more in a MariaDB (recommended) or MySQL database. Install MariaDB, then use a tool like HeidiSQL (Windows) or phpMyAdmin (often provided by your host):
- Create a new, empty database, e.g.
fivem(charsetutf8mb4). - Import every file from the
sqlfolder in filename order (they're numbered – start with000_base_…). In HeidiSQL: File → Run SQL file. In phpMyAdmin: select the database → Import.
- Create a new, empty database, e.g.
5Edit server.cfg
Open
5mstart-server/server.cfgin a text editor (e.g. Notepad++ or VS Code). Fill in your license key and your database connection – replace user, password and database name with your own:sv_licenseKey "YOUR_LICENSE_KEY" set mysql_connection_string "mysql://user:password@localhost/fivem?charset=utf8mb4"While you're there you can change the server name shown in the server list. Save the file.
6Start the server
Open a terminal inside the
5mstart-serverfolder and start FXServer with your config:# Windows ..\artifacts\FXServer.exe +exec server.cfg # Linux bash ../artifacts/run.sh +exec server.cfgWait until the console shows the resources starting, then open FiveM, press F8 and type
connect localhost(or your server's IP). Also check the per-script notes inREADME.md.
7Troubleshooting
Nobody else can join (port 30120)
FiveM uses port 30120 for both TCP and UDP. Open it in your firewall (Windows Defender Firewall or ufw on Linux) and, at home, forward it on your router. Many hosts also need the port opened in their control panel.
License key errors
Check that the key in sv_licenseKey is complete, inside quotes and has no extra spaces. Make sure it is still listed under Server Keys on portal.cfx.re (not deleted or regenerated).
Database connection failed
Make sure MariaDB/MySQL is running, the database exists and user, password and database name in mysql_connection_string are correct. If your password contains special characters like @ or #, URL-encode them or use a simpler password. Errors about missing tables usually mean an SQL file wasn't imported – import them again in filename order.
A script shows errors in the console
Read the notes for that script in README.md first. If a build looks broken, you can create a fresh copy with Rebuild in your account, or contact [email protected] with your order details.
Don't have a server yet?
Build your server