Install and First Boot
Install a FiveM server on Windows or Linux step by step: artifacts, licence key, server.cfg, txAdmin setup and your first successful join.
Download the recommended artifact for your platform, clone cfx-server-data next to it, register a free licence key on the Cfx portal, and run FXServer with +exec server.cfg. txAdmin does most of this for you through a browser panel on port 40120 and is the recommended path for a first install. This is the GTA V FiveM process; GTA 6 has no equivalent.
This is the install. Follow it in order and do not add custom content until the vanilla server accepts a connection — nearly every “my server won’t start” problem is caused by someone doing step nine before step three.
Everything here describes FiveM/FXServer for GTA V, the working model this track teaches. GTA 6 private-server support is not announced, so there is no GTA 6 equivalent of any of this yet.
1. Get a licence key
Register a free key on the Cfx Portal at portal.cfx.re, as instructed in the vanilla setup guide, then set it in your config as sv_licenseKey "licenseKeyGoesHere". (Older guides call this Keymaster; the Portal is the current name.)
Treat the key like a password. It is tied to your account, it identifies your server to the platform, and people do leak them in screenshots of their configs constantly.
2. Download an artifact
Get the current recommended master build for your platform from the server download page. There is a Windows build and a Linux build; take the recommended one, not the newest.
Keep the artifact in its own directory, separate from your content. The docs use this layout, and you should copy it:
- Windows:
C:\FXServer\serverfor the binaries,C:\FXServer\server-datafor everything else. - Linux:
~/FXServer/serverand~/FXServer/server-data.
On Linux you will need git and xz/xz-utils installed, and you extract with tar xf fx.tar.xz inside the server directory.
3. Get the base resources
Clone the official base resource pack into your data folder:
git clone https://github.com/citizenfx/cfx-server-data.git server-data
That gives you the essential resources — the chat box, the spawn manager, the session manager and a basic gamemode — that a bare server needs to be playable at all.
4. Write server.cfg
Create server.cfg inside server-data. The minimum, following the vanilla setup guide:
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
sv_hostname "My Server"
sv_maxclients 48
sv_licenseKey changeme
set onesync on
Three notes on that file:
sv_licenseKeytakes the key from step 1.sv_maxclientsaccepts 1–2048 per the server commands reference, but stay at or below 48 unless you have a paid Element Club tier — see choose your hosting.- The
ensurelines are your start list, and order matters: anything that depends on another resource must be started after it.
5. Start it
Windows:
cd /d C:\FXServer\server-data
C:\FXServer\server\FXServer.exe +exec server.cfg
Linux:
cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +exec server.cfg
You are looking for a clean console with no red errors and a line confirming the server is listening. Read the errors you do get — they name the resource that failed, which is almost always the fix.
The easier path: txAdmin
Everything above is worth understanding, but for a first install Cfx.re’s own docs point at txAdmin as the recommended route, and they are right.
txAdmin ships inside the artifact. Start the artifact without a config and it opens a web panel — by default on port 40120 — that walks you through creating an admin account, pointing at a data folder, entering your licence key, and deploying a server.
Its recipe deployer is the headline feature: pick a recipe and it downloads a whole framework server, sets up the database, imports the SQL and writes a working config, in one flow. That is how most people get a QBCore or ESX server running for the first time. Pick a framework covers which one to choose.
Once running, txAdmin also gives you the console, live player list, kick/warn/ban tools, permission roles for your staff, scheduled restarts and a Discord integration — all of which you will use daily. Staff and moderation goes into how to configure those permissions properly.
6. Prove you can join
Connect from the same machine first, using the FiveM client’s connect 127.0.0.1:30120. If that works, the server is fine and anything else is networking.
Then connect from outside. If it fails:
- Firewall: open TCP and UDP on 30120. Both. Missing UDP is the single most common cause.
- Port forward, if you’re behind a home router.
- Endpoints: confirm the
endpoint_add_*lines exist and bind to0.0.0.0. - Licence key: an invalid key will start the server and refuse everyone.
On a managed host, most of this is already handled and the port is fixed for you.
7. Lock it down before you add anything
The moment a vanilla server works, do these:
Checklist
- Copy the working
server.cfgsomewhere safe.- Move secrets — licence key, database password, any API keys — into a separate config file that is not in your Git repository. See performance and security.
- Set an artifact update policy: pin the version, keep the previous build, never update on a busy night.
- Turn on scheduled restarts (txAdmin does this) — long uptimes and script leaks do not mix.
- Configure automated database backups before you have a database worth losing.
Now, and only now, start adding content. Add resources one at a time, restarting between each, and you will always know which one broke your server. Add fifteen at once and you will spend the evening bisecting.
Where to get those resources safely — and how to avoid the leaked and backdoored ones — is scripts, MLOs and vehicles.
- Keep the server binaries and your server-data folder strictly separate
- You need a free licence key from the Cfx portal before anyone can join
- txAdmin's guided setup is genuinely the fastest correct install
- Prove you can connect locally before opening any ports
- Take a backup of a working config before you add a single custom resource
Frequently asked
Do I need a licence key?
Yes, and it is free. You register one on the Cfx portal and put it in server.cfg as sv_licenseKey. Without a valid key the server will not accept connections. Keys are tied to your account — never paste yours into a screenshot, a Discord message or a public config.
What is txAdmin?
txAdmin is the web-based management panel bundled with the server artifact. It runs on port 40120 by default and gives you guided setup, a console, player management, permission roles, scheduled restarts and one-click recipe deployment for frameworks. Cfx.re's own docs call it the easy setup route.
The server starts but nobody can join. Why?
In order of likelihood: no valid sv_licenseKey, the firewall is blocking TCP and UDP on 30120, endpoint_add lines are missing or bound to the wrong address, or you are behind a NAT that needs a port forward. Test a local connect first to isolate whether it is the server or the network.
- Setting up a server (vanilla) · Cfx.re
- Setting up a server with txAdmin · Cfx.re
- Server download · Cfx.re
- Server commands · Cfx.re
Get recruited when GTA 6 private servers open.