Part 5 of 12: Game ConfigurationNext Part β†’
Game Configuration: Ports & Networking
Game ConfigurationIntermediate

Game Configuration: Ports & Networking

GameCP Team
2/21/2026
game-config, ports, networking, variables

This is Part 5 of the Game Configuration series. Ports define how players connect to your game server and how GameCP routes traffic.


How Ports Work

Every game server needs at least one port for players to connect. GameCP uses port mappings that connect a port on the host node to a port inside the Docker container.

When a game server is created, GameCP automatically assigns available ports on the node. The port mapping in the game config defines the defaults and variables β€” the actual assigned ports may differ per server.


Port Mappings

Each port mapping has three properties:

PropertyDescription
Host PortThe default port on the node (what players connect to)
Container PortThe port inside the Docker container
VariableAn environment variable name that holds the assigned port value

Example: Minecraft

A typical Minecraft config has one port:

  • Host: 25565 | Container: 25565 | Variable: PORT

When a server is created, if port 25565 is already in use, GameCP assigns the next available port (e.g., 25566). The PORT variable is set to 25566, and the startup command can reference ${PORT} to bind to the correct port.

Games with Multiple Ports

Some games need several ports. For example, ARK: Survival Evolved might need:

  • Game Port: Host 7777 | Container 7777 | Variable PORT
  • Query Port: Host 27015 | Container 27015 | Variable QUERY_PORT
  • RCON Port: Host 27020 | Container 27020 | Variable RCON_PORT

Port Linking

The Link Host Ports option keeps all host ports in sync β€” when the primary port changes, other ports shift by the same offset. This prevents port conflicts when running multiple servers.


Adding and Removing Ports

Click Add Port to create a new mapping. For each port:

  1. Set the default host and container port numbers
  2. Assign a variable name so startup commands and configs can reference the port
  3. The variable name should be uppercase (e.g., PORT, QUERY_PORT, RCON_PORT)

Tips

  • The first port mapping is typically the main game port with variable PORT
  • Always assign variable names β€” without them, your startup command can't dynamically reference the port
  • Use the variable in your command line arguments: -port ${PORT} or -queryport ${QUERY_PORT}
  • The Monitoring section can auto-populate ports when you select a query type β€” look for the clickable port badges