Set up a FiveM server on Windows
Step by step: download the FXServer artifact, extract it, run txAdmin, link your Cfx.re account, deploy a recipe with your license key, and connect. Plus the vanilla way.
Diese Doku ist vorerst auf Englisch.
This guide sets up a FiveM server on Windows 10, 11 or Windows Server with txAdmin. It works the same on your own PC (for development) and on a Windows VPS. Plan about 15 minutes.
What you need
- A Cfx.re account and a license key from portal.cfx.re (see Server setup overview).
- 7-Zip or WinRAR to open
.7zfiles. - Git for Windows is optional but useful later.
- MariaDB only if you want a framework (QBCore, Qbox, ESX). Install it first, see Database setup.
1. Create the folders
Make a folder with a short path and no spaces, for example:
C:\FXServer\serverShort paths avoid problems with long resource paths and some tools. Don’t put the server in Program Files, Downloads or a OneDrive synced folder.
2. Download the artifact
- Open the official server download page (or
https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/). - Pick FiveM / RedM, Windows, Recommended and download
server.7z. - Check the build number against our Artifacts page, which flags builds with known problems.
Note
The Enhanced platform (Cfx Server) is a different download on the same page. Pick the FiveM / RedM (Legacy) build unless you know you want Enhanced. See Legacy and Enhanced.
3. Extract it
Open server.7z with 7-Zip and extract everything into C:\FXServer\server. You should now have C:\FXServer\server\FXServer.exe and a citizen folder next to it.
Tip
Windows Defender scanning every file makes FXServer start slowly. The official FAQ suggests excluding the folder: open PowerShell as administrator and run Add-MpPreference -ExclusionPath 'C:\FXServer\'.
4. Start txAdmin
Double click FXServer.exe. A console window opens and, because you did not pass +exec server.cfg, FXServer starts txAdmin. It creates C:\FXServer\txData and opens http://localhost:40120 in your browser. The console also prints a 4 digit PIN.
If the browser does not open, go to http://localhost:40120 yourself. On a VPS, use http://YOUR_VPS_IP:40120 from your own PC (and open TCP 40120 in the Windows firewall, ideally only for your IP).
5. Link your account
- Check that the PIN is filled in and click Link Account.
- Log in with your Cfx.re (forum) account and click Yes, Allow.
- Create a backup password. You will use it if Cfx.re login is ever down, so save it in a password manager.
This makes you the master admin of this txAdmin.
6. Run the setup and deployer
- Enter a server name and click Next.
- Choose Popular Recipes.
- Pick a recipe:
- FiveM Basic Server (Legacy), sometimes shown as CFX Default: a clean, framework free server. Best for learning and for vMenu servers.
- QBCore, Qbox or ESX Legacy: full roleplay frameworks. These need MariaDB running. See Popular recipes.
- Confirm the data location (the default
txData\<name>.baseis fine) and click Save. - The Recipe Deployer shows the recipe YAML. Click Next.
- Paste your license key. For framework recipes, fill in the database host (
localhost), port (3306), user (root) and password. Leave the database name empty and txAdmin generates one. - Click Run Recipe. txAdmin downloads the resources and, for frameworks, imports the SQL. This takes a minute or two.
- Review the generated
server.cfgand click Save & Run Server.
The live console in txAdmin now shows the server starting. When you see resources starting and no red errors, it is up.
Important
QBCore and some other recipes install NPM packages with yarn on first start. Let that finish before you restart. The QBCore docs say this explicitly.
7. Connect
- Start FiveM.
- Press F8 to open the client console.
- Type
connect localhost:30120(same PC) orconnect YOUR_PUBLIC_IP:30120and press Enter.
You can also use the direct connect box in the FiveM main menu with the same address. To let friends connect, see Ports and networking.
8. Make it start on its own
txAdmin restarts FXServer on crashes, but not the whole machine. On a VPS, start FXServer when Windows boots:
- Create
C:\FXServer\start.bat:
@echo off
cd /d C:\FXServer\server
FXServer.exe- Open Task Scheduler, create a task that runs
start.batAt startup, “Run whether user is logged on or not”, with the account that owns the folder. - In txAdmin, Settings > FXServer, turn on starting the server automatically when txAdmin starts.
Folder layout after setup
C:\FXServer\
├─ server\ FXServer.exe + citizen\ (replace to update)
├─ start.bat
└─ txData\
├─ admins.json txAdmin accounts
├─ default\ txAdmin config, logs, player database
└─ MyServer.base\
├─ server.cfg
└─ resources\Your own resources go in resources\[local]\ and get an ensure line in server.cfg. See Installing resources.
The vanilla way (no txAdmin)
Useful for a throwaway dev server or when you want to see exactly what runs. From the official vanilla guide:
cd /d C:\FXServer
git clone https://github.com/citizenfx/cfx-server-data.git server-dataCreate C:\FXServer\server-data\server.cfg:
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 dev server"
sv_maxclients 8
sv_licenseKey "cfxk_your_key_here"
sv_enforceGameBuild 3751
set onesync onThen start it from inside the data folder:
cd /d C:\FXServer\server-data
C:\FXServer\server\FXServer.exe +exec server.cfgWarning
Always start FXServer from inside the server data folder (or tell txAdmin where it is). If you start it from somewhere else, it cannot find resources and you get “no resources found” or “couldn’t find resource” errors.
Next steps
- Read server.cfg explained so you know what every line does.
- Set up txAdmin admins, bans and scheduled restarts.
- Add vMenu or other resources.
- Write your first resource.
