RexZenn Docs Back to site

Host a FiveM server at home

Set up a FiveM server on your own Windows PC, test it, and let friends join.

On this page

This guide takes you from a blank folder to a running FiveM server on your own PC. It uses Windows and txAdmin, the web panel that ships with the server.

What you need#

  • A Windows 10 or 11 PC (a spare one is best). A modern 4-core CPU, 8 GB of RAM and an SSD is plenty for a small test server.
  • A wired internet connection. Upload speed matters more than download speed.
  • A Cfx.re account (free) to get a license key.
  • A copy of FiveM installed on the PC you play from.
  • Access to your router's settings if friends will join from outside your home.

1. Get a license key#

Every server needs its own key.

  1. Sign in to the Cfx.re Portal at portal.cfx.re.
  2. Open the server section and create a new registration key.
  3. Give it a name, copy the key, and keep it somewhere private. It starts with cfxk_.

2. Download the server files#

  1. Make a folder called C:\FXServer.
  2. Open the Windows server builds page and download the newest build marked as recommended.
  3. Extract the zip into C:\FXServer\server.

You should now have C:\FXServer\server\FXServer.exe.

txAdmin installs the base resources for you and gives you a dashboard.

  1. Double-click FXServer.exe. A console opens and prints a PIN and a link, usually http://localhost:40120.
  2. Open the link in your browser and enter the PIN.
  3. Create your txAdmin account when asked.
  4. Choose a name, then pick a recipe. CFX Default FiveM is a good first choice. Frameworks like QBCore or ESX also have recipes.
  5. Set the data folder to C:\FXServer\server-data.
  6. Paste your license key when it asks and click through to deploy.
  7. Press Start on the dashboard.

When the dashboard says the server is online, move on to step 5.

4. Or set it up by hand#

Skip this if you used txAdmin. You need Git installed.

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

Create C:\FXServer\server-data\server.cfg:

server.cfg
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

sv_hostname "My Home Server"
sv_maxclients 8
sv_licenseKey "PASTE_YOUR_KEY_HERE"
sv_endpointPrivacy true
set onesync on

ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap

Then start it from the server-data folder:

PowerShell
cd C:\FXServer\server-data
..\server\FXServer.exe +exec server.cfg

5. Join it from your own PC#

  1. Open FiveM and press F8 to open the console.
  2. Type connect 127.0.0.1:30120 and press Enter.

If you can load in, the server works. If not, read the errors FAQ before touching your router.

6. Let friends join#

Everything so far only works on your own PC. To let people outside your home in, do these in order.

Give the server PC a fixed address#

Open Command Prompt on the server PC, run ipconfig, and note the IPv4 Address, like 192.168.1.50. In your router, reserve that address for this PC (often called DHCP reservation or static lease). Otherwise the router may change it later and break the next step.

Forward port 30120#

Log in to your router, usually at 192.168.0.1 or 192.168.1.1, and find Port Forwarding. Add a rule:

  • External port: 30120
  • Internal IP: the address from the previous step
  • Internal port: 30120
  • Protocol: both TCP and UDP

Allow it through Windows Firewall#

Run PowerShell as Administrator:

PowerShell (Administrator)
New-NetFirewallRule -DisplayName "FiveM TCP" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow

Test from outside#

Look up your public IP by searching "what is my IP". Ask a friend to press F8 and run connect YOUR.PUBLIC.IP:30120. Testing with your own public IP from inside your house often fails even when everything is right, so use a friend or your phone's mobile data on another device.

If your IP keeps changing#

Most home connections get a new IP now and then. A free dynamic DNS service such as DuckDNS or No-IP gives you a stable name, like myserver.duckdns.org. Install their updater on the server PC and friends connect with connect myserver.duckdns.org:30120.

7. Keep it safe#

  • Never forward port 40120. That's the txAdmin panel. Use it only from the server PC.
  • Use a long, unique txAdmin password.
  • Don't share server.cfg. It holds your license key and later your database password.
  • Share a DuckDNS-style name or the join link txAdmin shows, not your raw home IP.
  • Keep Windows updated, and don't run random downloaded resources without reading them first.

8. Add resources#

  1. Put the resource folder in server-data\resources. The folder must contain fxmanifest.lua directly.
  2. Add ensure folder-name to server.cfg.
  3. In the live console, run refresh and then ensure folder-name.

9. Update and back up#

  • Update the server by stopping it, downloading a newer build, and extracting it over C:\FXServer\server. Leave server-data alone.
  • Copy server-data (and your database, if you use one) somewhere else on a schedule.
  • txAdmin can schedule restarts for you under its settings.

Next: if something breaks, open the errors FAQ.