Skip to content

How to setup your server as a windows service

Updated July 02, 2026
FiveM
Running FiveM as a Service | GameServerKings KB

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?

NSSMtxAdmin
Setup effortModerateEasy
Web UINoYes (console, players, restarts)
Scheduled restartsVia Task SchedulerBuilt in
Player management UINoYes
Best forMinimal, headless setupsMost 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.

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:

POWERSHELL
cd C:\FXServer-data
C:\FXServer\FXServer.exe

FXServer launches into txAdmin setup mode and prints a URL like:

Code
[c-scripting-core] Started resource txAdmin
[txAdmin] Starting...
[txAdmin] Web Panel is running at: http://localhost:40120

Step 2: Complete the Web Setup

  1. Open that URL in a browser (use the server's public IP instead of localhost if you are setting up remotely, and open port 40120 in the firewall temporarily).
  2. txAdmin walks you through:
    • Linking your Cfx.re account
    • Importing your existing C:\FXServer-data folder
    • Pointing at your server.cfg
    • Starting the server
  3. 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

  1. Extract nssm.exe to C:\nssm\.
  2. From PowerShell as Administrator:
POWERSHELL
cd C:\nssm
.\nssm.exe install FXServer
  1. In the GUI that opens:
    • Path: C:\FXServer\FXServer.exe
    • Startup directory: C:\FXServer-data
    • Arguments: +exec server.cfg
  2. On the I/O tab, set:
    • Output (stdout): C:\FXServer-data\logs\stdout.log
    • Error (stderr): C:\FXServer-data\logs\stderr.log
  3. Click Install service.

Step 2: Start the Service

POWERSHELL
Start-Service FXServer

It will now auto-start when the Windows server reboots.

Managing the NSSM Service

POWERSHELL
Start-Service FXServer       # Start
Stop-Service FXServer        # Stop
Restart-Service FXServer     # Restart
Get-Service FXServer         # Check status

To remove the service later:

POWERSHELL
C:\nssm\nssm.exe remove FXServer confirm

Scheduled Restarts With NSSM

NSSM does not schedule restarts on its own. Use Windows Task Scheduler:

  1. Open Task Scheduler.
  2. Create a task that runs Restart-Service FXServer (via powershell.exe -Command "Restart-Service FXServer").
  3. 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.cfg error or a missing license key.
  • txAdmin web panel unreachable remotely: Port 40120 is not open, or you are using localhost from 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.
Made with 💜 by GameServerKings