How to setup your server as a windows service
Running FiveM as a Service
Running the server in a PowerShell window means it dies when you close the window or log out of RDP. For production, run FXServer either as a Windows service (via NSSM) or under txAdmin's process manager. This guide covers both. Complete Setup and Configuration first.
Which Option Should I Use?
| NSSM | txAdmin | |
|---|---|---|
| Setup effort | Moderate | Easy |
| Web UI | No | Yes (console, players, restarts) |
| Scheduled restarts | Via Task Scheduler | Built in |
| Player management UI | No | Yes |
| Best for | Minimal, headless setups | Most production servers |
Most production FiveM setups use txAdmin. It is the recommended approach for almost everyone. Use NSSM if you specifically want a bare Windows service with no web layer.
Option A: txAdmin (Recommended)
txAdmin is a web-based admin panel that ships inside FXServer. It adds restart scheduling, player management, a live console, and resource management.
Step 1: Launch Into txAdmin Setup Mode
Start the server without the +exec server.cfg argument:
cd C:\FXServer-data C:\FXServer\FXServer.exe
FXServer launches into txAdmin setup mode and prints a URL like:
[c-scripting-core] Started resource txAdmin [txAdmin] Starting... [txAdmin] Web Panel is running at: http://localhost:40120
Step 2: Complete the Web Setup
- Open that URL in a browser (use the server's public IP instead of
localhostif you are setting up remotely, and open port 40120 in the firewall temporarily). - txAdmin walks you through:
- Linking your Cfx.re account
- Importing your existing
C:\FXServer-datafolder - Pointing at your
server.cfg - Starting the server
- Set an admin username and password for txAdmin itself (separate from your in-game admin identifiers).
Step 3: Use txAdmin
From the txAdmin panel you get:
- A live console (send commands, watch output)
- Player list with kick, ban, warn
- Scheduled restarts (set a daily restart with in-game warnings)
- Resource start/stop/restart without a full server reboot
- Server performance graphs
txAdmin keeps the server process alive and can auto-restart it on crash. For it to survive a Windows reboot, run txAdmin's own FXServer process under NSSM (below) or set up a scheduled task that launches it on system startup.
Securing the txAdmin Port
Port 40120 (the txAdmin web UI) should not be left open to the public. Either:
- Close it in the firewall and access txAdmin only over RDP / localhost, or
- Restrict the firewall rule to your own IP address
Option B: NSSM (Bare Windows Service)
NSSM (Non-Sucking Service Manager) wraps any executable as a Windows service. Download from nssm.cc.
Step 1: Install the Service
- Extract
nssm.exetoC:\nssm\. - From PowerShell as Administrator:
cd C:\nssm .\nssm.exe install FXServer
- In the GUI that opens:
- Path:
C:\FXServer\FXServer.exe - Startup directory:
C:\FXServer-data - Arguments:
+exec server.cfg
- Path:
- On the I/O tab, set:
- Output (stdout):
C:\FXServer-data\logs\stdout.log - Error (stderr):
C:\FXServer-data\logs\stderr.log
- Output (stdout):
- Click Install service.
Step 2: Start the Service
Start-Service FXServer
It will now auto-start when the Windows server reboots.
Managing the NSSM Service
Start-Service FXServer # Start Stop-Service FXServer # Stop Restart-Service FXServer # Restart Get-Service FXServer # Check status
To remove the service later:
C:\nssm\nssm.exe remove FXServer confirm
Scheduled Restarts With NSSM
NSSM does not schedule restarts on its own. Use Windows Task Scheduler:
- Open Task Scheduler.
- Create a task that runs
Restart-Service FXServer(viapowershell.exe -Command "Restart-Service FXServer"). - Trigger it daily at a low-population hour (e.g., 5 AM).
For player-facing restart warnings, txAdmin is much better. NSSM restarts are abrupt.
Combining Both
A common production pattern: run txAdmin for its web UI and scheduling, and wrap txAdmin's launch under NSSM so the whole thing survives reboots. Point the NSSM service at the txAdmin launch command instead of the direct +exec server.cfg.
Common Issues
- Service starts then immediately stops: Check the stdout/stderr logs you configured. Usually a
server.cfgerror or a missing license key. - txAdmin web panel unreachable remotely: Port 40120 is not open, or you are using
localhostfrom a remote browser. Open the port (temporarily and restricted to your IP) or tunnel over RDP. - Server does not restart after Windows reboot: The NSSM service startup type may be Manual. Set it to Automatic in
services.msc.
What to Read Next
- Database and Frameworks for ESX, QBCore, and MySQL
- OneSync, Updates, and Backups for scaling and maintenance
- Configuration to revisit
server.cfgsettings