This guide walks you through setting up your FiveM (GTA V multiplayer) server hosted with Legion Hosting — from obtaining your CFX license key and configuring TXAdmin, to editing server.cfg and connecting players.
Prerequisites
- A Legion Hosting FiveM server (active in your account)
- A Cfx.re forum account (free — required to generate your license key)
- Access to GPanel
- FiveM client installed on your PC (fivem.net)
Step 1: Obtain Your CFX License Key
Every FiveM server requires a unique license key from Cfx.re (the developers of FiveM). This key is free and tied to your Cfx.re account.
- Go to https://keymaster.fivem.net/ and log in with your Cfx.re forum account.
- Click New Server (or Register a new server).
- Fill in the details:
- Label: A friendly name for your server (e.g. "My Legion FiveM Server")
- Server IP Address: Enter your server's IP address from GPanel (see How to Find Your Server IP and Port)
- Server Type: Select the appropriate type (usually "Other / Apache / nginx")
- Click Generate.
- Copy the generated license key — you will need it in the next steps.
Step 2: First Server Start and TXAdmin Setup
FiveM servers hosted with Legion Hosting include TXAdmin — a web-based management panel that runs alongside your FiveM server. On first start, TXAdmin will guide you through initial setup.
Starting the Server
- Log in to GPanel and select your FiveM server.
- Go to the Startup tab and locate the FIVEM_LICENSE (or similarly named) variable. Paste your CFX license key here and save.
- Go to the Console tab and click Start.
- Watch the console output. On first start, the server will download required FiveM artifacts — this can take a few minutes.
- Once TXAdmin is ready, you will see a message in the console containing the TXAdmin URL and a PIN code.
http://YOUR_SERVER_IP:TXADMIN_PORT.
Completing TXAdmin Setup
- Open the TXAdmin URL in your browser.
- Enter the PIN displayed in the GPanel console output.
- Create your TXAdmin admin account (username and password).
- TXAdmin will walk you through a setup wizard:
- Server Name: Choose the name displayed in the FiveM server browser.
- Deployment Type: Select a template (e.g. "Popular Recipes" for a preconfigured base, or "Remote URL / Template" if you have a custom setup).
- Server Data Folder: Leave this at the default unless you have a specific reason to change it.
- CFX Key: If prompted again, paste your license key.
- Complete the wizard and let TXAdmin finish deploying the server files. This may take a few minutes.
Step 3: Configure server.cfg
The server.cfg file is the main configuration file for your FiveM server. TXAdmin generates a basic one during setup, but you will want to review and customise it.
Accessing server.cfg
- In GPanel, click the Files tab.
- Navigate to your server data folder (typically the root directory or a folder created by the TXAdmin template).
- Click
server.cfgto open it in the inline editor.
Essential Settings
| Setting | Description | Example |
|---|---|---|
sv_hostname |
Server name shown in the FiveM server browser | "My Legion FiveM Server" |
sv_licenseKey |
Your CFX license key from Keymaster | "cfxk_xxxxxxxxxxxxxxxxxxxx" |
sv_maxclients |
Maximum players allowed on the server | 48 |
endpoint_add_tcp |
TCP listening address and port | "0.0.0.0:YOUR_PORT" |
endpoint_add_udp |
UDP listening address and port | "0.0.0.0:YOUR_PORT" |
sv_endpointprivacy |
Hides player IP addresses in the server list | true |
sets sv_projectName |
Short project name shown in the server browser details | "My RP Server" |
sets sv_projectDesc |
Short description shown in the server browser details | "A custom roleplay server" |
A minimal server.cfg example:
# Server Identity
sv_hostname "My Legion FiveM Server"
sets sv_projectName "My RP Server"
sets sv_projectDesc "A custom roleplay server hosted by Legion Hosting"
# License Key
sv_licenseKey "cfxk_YOUR_KEY_HERE"
# Network — use the port assigned in GPanel
endpoint_add_tcp "0.0.0.0:YOUR_PORT"
endpoint_add_udp "0.0.0.0:YOUR_PORT"
# Player Limit
sv_maxclients 48
# Privacy
sv_endpointprivacy true
# Resources
ensure mapmanager
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure chat
endpoint_add_tcp and endpoint_add_udp must match the game port assigned to your server in GPanel. Check the GPanel Network tab for your specific port.
Step 4: Connecting to Your FiveM Server
Once your server is configured and running, players can connect using either the FiveM server browser or a direct connect.
Direct Connect
- Open the FiveM client.
- Press F8 to open the FiveM console, or click the Direct Connect button on the home screen.
- Enter your server's IP and game port in the format
IP:PORT. - Click Connect.
Server Browser
- Open the FiveM client and click Play.
- In the server browser, search for your server name (the
sv_hostnamevalue from server.cfg). - Click your server and then click Connect.
sv_licenseKey is valid and the ports in server.cfg match your GPanel network configuration.
Managing Your Server with TXAdmin
After initial setup, TXAdmin provides a web dashboard for day-to-day server management. Access it at http://YOUR_SERVER_IP:TXADMIN_PORT.
| Feature | Description |
|---|---|
| Dashboard | View server status, player count, and performance metrics at a glance. |
| Players | See online players, kick or ban players, view player history. |
| Live Console | Execute server commands in real time, same as the in-game console. |
| Resources | Start, stop, and restart individual resources without restarting the entire server. |
| Server Log | View action logs for auditing player and admin actions. |
| CFG Editor | Edit server.cfg directly from TXAdmin without needing the GPanel file manager. |
| Scheduled Restarts | Configure automatic restarts at set intervals to keep the server fresh. |
Getting Help
If you have followed this guide and are still experiencing issues:
- Copy any error messages from the GPanel console or TXAdmin log.
- Note which step you are stuck on and what you have already tried.
- Open a support ticket at https://legionhosting.net/submitticket.php with this information. Our team will assist you as quickly as possible.