New

EmeraldHost 2.0 is here: faster, more intuitive, and made for everyone - the new panel!

Learn more
Guides
How to Set the Game Server Port Correctly on Your FiveM Server
FiveMFiveMSet Port

How to Set the Game Server Port Correctly on Your FiveM Server

Set the game server port correctly on a FiveM server

2 min read
Apr 9, 2026

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 7

You 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

Find the correct port

  1. Open dashboard
    Open the dashboard of your server.

  2. Note the port
    Note the Default Port of your game server from the server information.

Set the port in server.cfg

  1. Stop the server
    Stop your server via the dashboard.

  2. Connect via SFTP
    Connect to your server via SFTP.

  3. Open server.cfg
    Open the server.cfg you used during the txAdmin setup (see table above).

  4. Adjust endpoints
    Find the following lines and replace 30120 with your actual port:

    endpoint_add_tcp "0.0.0.0:YOUR_PORT"
    endpoint_add_udp "0.0.0.0:YOUR_PORT"
    
  5. Start the server
    Save the file and start your server.

Written byEmeraldHost Team
Last updated on Apr 9, 2026 Edit on GitHub

Did this article help you?

Your feedback helps us improve our guides.

Help shape the guides

€10.00 in credit for every new guide, €5.00 for every improvement.

Contact Support

Create a support ticket and our team will get back to you as soon as possible – personal and professional.

Go to Support
1257 members online

Discord Community

Connect with other players, get quick help from the community, and stay up to date with the latest news.

Join Discord
FiveM

Ready to get started?

Rent your FiveM Server now

Join our Discord community 1257 members online right now