How to Set the Game Server Port Correctly on Your FiveM Server
If you did not use the server.cfg from the main directory /home/container during the txAdmin setup, the default port 30120 will be used. Since your game server uses a different port, the following error occurs:
Connection refused - CURL error code 7Connection refused - CURL error code 7You need to manually enter the correct port of your game server in the server.cfg.
Where is the server.cfg located?
Depending on how you set up txAdmin, the server.cfg can be located in different places:
| Setup | Path |
|---|---|
| Default (recommended) | /home/container/server.cfg |
| txAdmin Recipe / Deployer | /home/container/txData/<ProfileName>/server.cfg |
| Manual import | The path you specified during import |
Tip
You can also edit the server.cfg directly via the CFG Editor in the txAdmin web interface.
Find the correct port
Open dashboard
Open the dashboard of your server.Note the port
Note the Default Port of your game server from the server information.
Set the port in server.cfg
Stop the server
Stop your server via the dashboard.Connect via SFTP
Connect to your server via SFTP.Open server.cfg
Open theserver.cfgyou used during the txAdmin setup (see table above).Adjust endpoints
Find the following lines and replace30120with your actual port:endpoint_add_tcp "0.0.0.0:YOUR_PORT" endpoint_add_udp "0.0.0.0:YOUR_PORT"endpoint_add_tcp "0.0.0.0:YOUR_PORT" endpoint_add_udp "0.0.0.0:YOUR_PORT"Warning
The
endpoint_add_udpmust be placed before theendpoint_add_tcp, otherwise the port change will not work correctly.Start the server
Save the file and start your server.
Tip
We recommend always using the server.cfg from the main directory /home/container during the txAdmin setup. It is already pre-configured with the correct port of your game server.