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
- What you need
- 1. Get a license key
- 2. Download the server files
- 3. Set up with txAdmin (recommended)
- 4. Or set it up by hand
- 5. Join it from your own PC
- 6. Let friends join
- Give the server PC a fixed address
- Forward port 30120
- Allow it through Windows Firewall
- Test from outside
- If your IP keeps changing
- 7. Keep it safe
- 8. Add resources
- 9. Update and back up
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.
- Sign in to the Cfx.re Portal at portal.cfx.re.
- Open the server section and create a new registration key.
- Give it a name, copy the key, and keep it somewhere private. It starts with
cfxk_.
2. Download the server files#
- Make a folder called
C:\FXServer. - Open the Windows server builds page and download the newest build marked as recommended.
- Extract the zip into
C:\FXServer\server.
You should now have C:\FXServer\server\FXServer.exe.
3. Set up with txAdmin (recommended)#
txAdmin installs the base resources for you and gives you a dashboard.
- Double-click
FXServer.exe. A console opens and prints a PIN and a link, usuallyhttp://localhost:40120. - Open the link in your browser and enter the PIN.
- Create your txAdmin account when asked.
- Choose a name, then pick a recipe. CFX Default FiveM is a good first choice. Frameworks like QBCore or ESX also have recipes.
- Set the data folder to
C:\FXServer\server-data. - Paste your license key when it asks and click through to deploy.
- 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.
cd 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"
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 hardcapThen start it from the server-data folder:
cd C:\FXServer\server-data
..\server\FXServer.exe +exec server.cfg5. Join it from your own PC#
- Open FiveM and press F8 to open the console.
- Type
connect 127.0.0.1:30120and 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:
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 AllowTest 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#
- Put the resource folder in
server-data\resources. The folder must containfxmanifest.luadirectly. - Add
ensure folder-nametoserver.cfg. - In the live console, run
refreshand thenensure folder-name.
9. Update and back up#
- Update the server by stopping it, downloading a newer build, and extracting it over
C:\FXServer\server. Leaveserver-dataalone. - 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.