How to Set Up a FiveM Server on a Windows VPS: Step-by-Step Guide

Learn how to set up a FiveM server from scratch on a Windows VPS: artifact download, license key, port configuration, and the first production connection.

Spinning up a FiveM server on a Windows VPS isn’t mysterious, but it has details that trip up beginners: license key forgotten in server.cfg, port 30120 opened only on UDP, antivirus blocking FXServer, or txAdmin picked as the main mode without understanding that it’s a layer on top of the same binary. This tutorial covers the full path from zero — official download, minimal working configuration, firewall, and connectivity validation.

The target audience is anyone who has never run an FXServer and wants to start on a solid base to later evolve to ESX, QBCore, or a custom framework. Estimated time: about 40 minutes from your first RDP session until the server appears in the game client.

Choosing Windows Server makes sense if you prefer a familiar stack, direct RDP to adjust configs, and the .NET tooling ecosystem for automation. Linux is equally valid and usually lighter, but it’s out of scope for this guide.

Prerequisites

What you need before starting

Windows Server 2019 or 2022 VPS with at least 4 vCPUs, 8 GB of RAM, and 40 GB of SSD storage. Administrative RDP access, a free Cfx.re portal account (keymaster.fivem.net) to generate the license key, and the FiveM client installed on your local machine to test the connection.

Recommended OS Windows Server 2022
FXServer port 30120 (TCP+UDP)
txAdmin port 40120 (TCP)
Minimum RAM 8 GB
Minimum vCPU 4 cores

If you’re sizing capacity, plan for each active slot to consume 30 to 80 MB of RAM depending on which resources are loaded. SSD storage is mandatory — HDDs cause noticeable stutter when streaming assets to players.

Download the official FXServer artifact

The artifact is the FiveM server binary, distributed as a ZIP archive by Cfx.re. Always download it from the official source: unofficial builds frequently ship with backdoors injected into resources.

01

Connect to the VPS via RDP using the credentials you received during provisioning. Open PowerShell as administrator and create the folder structure:

New-Item -ItemType Directory -Path "C:\FXServer\server" -Force
New-Item -ItemType Directory -Path "C:\FXServer\server-data" -Force

Separating server (binary) from server-data (configuration + resources) is the structure recommended by Cfx.re — it makes updating the artifact easy without disturbing your setup.

02

Visit runtime.fivem.net/artifacts/fivem/build_server_windows/master/ and copy the link of the build marked as recommended (not latest).

In PowerShell, download and extract it directly:

cd C:\FXServer\server
Invoke-WebRequest -Uri "https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/XXXX-HASH/server.7z" -OutFile "server.7z"

Replace the URL with the current build. You’ll need 7-Zip to extract it (winget install 7zip.7zip if you don’t have it).

03

Extract the artifact into C:\FXServer\server:

& "C:\Program Files\7-Zip\7z.exe" x server.7z -oC:\FXServer\server

After extraction, you should see FXServer.exe in the folder root. That’s the server executable.

Clone the server-data base and generate the license

Cfx.re maintains an example repository with the minimal server-data structure already prepared. This saves you from having to build the resources/ tree from scratch with the default scripts.

04

Install Git for Windows if you don’t already have it:

winget install --id Git.Git -e --source winget

Reopen PowerShell so the updated PATH is loaded, then clone the official template:

cd C:\FXServer\server-data
git clone https://github.com/citizenfx/cfx-server-data.git .

The trailing dot on clone matters — it clones the content directly into the current folder instead of creating a subfolder.

05

Generate the license key at keymaster.fivem.net in your local browser. Log in with your Cfx.re account, click New, and fill in:

  • Server name: internal name (not shown to players)
  • IP Address: select “I will deploy and run the server using a changing IP address”

Selecting a fixed IP only works if you’re absolutely sure of the VPS IP — if the VPS IP changes (rare on Hostini VPS, but possible with other providers), the license gets invalidated.

The generated key has the format cfxk_XXXXXXXX_XXXXX. Save it — you’ll paste it into server.cfg next.

One license per server

Each license key is bound to a single server instance. If you run the same key on two VPS instances simultaneously, Cfx.re deactivates both and you need to open a ticket to recover them. For local development, generate a separate key.

Configure server.cfg

server.cfg is the file that defines identity, license, slots, and which resources load at boot. It’s located at C:\FXServer\server-data\server.cfg after the clone.

06

Open server.cfg in Notepad++ or VS Code (avoid plain Notepad — it breaks encoding). Find the sv_licenseKey changeme line and replace it with your real key:

sv_licenseKey cfxk_XXXXXXXX_XXXXX

Also configure identity and capacity on the nearby lines:

sv_hostname "Test Server - EN"
sv_maxclients 32
sets locale "en-US"
sets tags "roleplay, english"

The maximum sv_maxclients depends on the license — standard keys allow up to 48 slots; patron keys allow 64 or more.

07

Confirm that endpoint_add_tcp "0.0.0.0:30120" and endpoint_add_udp "0.0.0.0:30120" are both present and uncommented. They control which interface the server listens on — 0.0.0.0 means all network interfaces on the VPS, which is correct for production.

If you want to run on a port other than 30120 (useful for hosting multiple servers on the same VPS), change 30120 on both lines and remember to mirror the change in the firewall later.

Open ports in Windows Firewall

Without firewall rules, FXServer runs but nobody can connect. The ports need to be open for inbound traffic on both TCP and UDP.

08

In PowerShell as admin, create the rules with one command per protocol:

New-NetFirewallRule -DisplayName "FiveM TCP 30120" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP 30120" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "txAdmin 40120" -Direction Inbound -Protocol TCP -LocalPort 40120 -Action Allow

The txAdmin rule (40120) is optional but recommended — you’ll use the web interface to manage the server without having to stay in RDP.

Provider firewall also counts

Some hosting providers run an external firewall (security group) on top of the Windows firewall. If you opened it on Windows and traffic still doesn’t pass, check whether ports 30120 TCP/UDP are released at the datacenter level in the provider panel. On Hostini VPS, that opening is automatic for common game ports.

Start the server for the first time

With artifact, server-data, license, and firewall in place, it’s time to bring the process up.

09

Create a start.bat script at C:\FXServer\server-data\start.bat with this content:

cd /d C:\FXServer\server-data
C:\FXServer\server\FXServer.exe +exec server.cfg
pause

pause keeps the window open after the server stops — useful so you can read boot errors instead of having the CMD window close instantly.

10

Run start.bat by double-clicking it or via PowerShell:

cd C:\FXServer\server-data
.\start.bat

The console will print several boot lines. Look for:

  • Authenticating server license key... followed by Server is now available — license is valid and registered
  • Started resource sessionmanager and other base resource logs
  • svAdhesive: server can be heartbeating, mode 2 — server is visible in the public list

Verification: connect for the first time

The final confirmation is trying to join the server with the FiveM client.

11

On your local PC, open the FiveM client. Press F8 to open the console and type:

connect YOUR_VPS_IP:30120

Replace YOUR_VPS_IP with your VPS IP. If everything is correct, you’ll land on the GTA loading screen with messages about downloading base resources, then spawn on the map in Los Santos.

If the server is on the public list (normal gameplay, license OK), you can also find it by searching for the sv_hostname you configured.

Troubleshooting

”Couldn’t load resource: sessionmanager”

The resources/ folder is missing or corrupted. This usually happens when git clone failed silently. Run git status inside C:\FXServer\server-data — if it says “not a git repository”, redo the clone from step 04.

Console shows “License authentication failed”

License key is invalid, has extra whitespace, or is still set to changeme. Open server.cfg, confirm the line is exactly sv_licenseKey cfxk_... with no quotes and no whitespace before or after the key. If the key was generated for a different IP, generate a new one with “changing IP” selected.

Server comes up but nobody can connect

Test from your own local PC via the F8 console in FiveM. If it connects locally but not from outside, it’s the firewall. Run Get-NetFirewallRule -DisplayName "FiveM*" in PowerShell to confirm the rules exist and are Enabled: True.

”Server is hibernating” in the console

Normal on Windows VPS instances that fall asleep when idle. Disable sleep mode with:

powercfg /change standby-timeout-ac 0
powercfg /change hibernate-timeout-ac 0

Next steps

With the base server running, the typical evolution paths are:

  • Install txAdmin fully: visit http://YOUR_VPS_IP:40120 for the guided setup flow, admin creation, and prebuilt templates (vanilla, ESX, QBCore)
  • Add a framework: ESX Legacy and QBCore are the most popular for roleplay servers — installation is documented in their respective GitHubs
  • Configure a MySQL database: required for any framework to persist player and vehicle data
  • Set up automatic backups: schedule a task in Windows Task Scheduler to export the database daily
  • Consider dedicated DDoS protection: popular FiveM servers are a constant target of attacks on the UDP gameplay port

If you’re planning for production and want infrastructure optimized for FiveM with DDoS protection included and low-latency IPs, you can start directly on the specialized plans for Hostini game server hosting.

Frequently asked questions

What's the difference between the recommended and latest artifact builds?

Recommended is the most recent build flagged as stable by Cfx.re, tested against the majority of public resources. Latest is the newest build and may include fixes or features that haven't been audited yet. For a production server, stay on recommended unless you have a specific reason to upgrade.

Do I need to open port 30120 on TCP, UDP, or both?

Both. FiveM uses TCP 30120 for the initial handshake and HTTP resource downloads, and UDP 30120 for real-time gameplay traffic. If you open only UDP, players can't even join the server.

Why doesn't my server show up in the public FiveM list?

Three common causes: invalid or missing license key in server.cfg, sv_hostname not configured, or the server is running in legacy onesync mode without a proper sv_maxclients. Check the FXServer console — it clearly logs when registration with the public list fails.

How many slots can 8 GB of RAM and 4 vCPUs handle?

A vanilla server with basic resources runs 32 slots comfortably at that spec. With a full framework (ESX or QBCore) plus 30 to 40 custom resources, expect 16 to 24 stable slots. RAM is the main bottleneck — each heavy Lua resource consumes 50 to 200 MB at runtime.

Can I use txAdmin to manage the server?

Yes, and it's recommended. txAdmin has been bundled with the artifact since 2021 — just run FXServer.exe and it exposes the web interface on port 40120 to create templates, manage players, and view logs. It's the cleanest way to operate the server without depending on the raw console.

Do I need Windows Server, or is regular Windows 10 enough?

Windows Server 2019 or 2022 is the technically correct choice: better scheduler for long-running workloads, no inbound connection cap like Windows 10/11, and official support for running as a service. Desktop Windows works for local development, but in production you'll hit the 20 TCP connection limit.

Topics:
Next steps VPS, dedicated or managed panel for FiveM, SAMP, MTA, Tibia and more.Host your game server with Hostini →
Was this tutorial helpful?
Chat on WhatsApp