Protecting a Terraria server
This guide configures the Terraria-specific protocol filter for a running Terraria server. Confirm the backend address and TCP port on which the server listens before continuing. Terraria commonly uses TCP port 7777, but you should use your server's configured port.
Configure the backend connection
Choose how X4B will deliver clean traffic to the backend:
- Use Reverse Proxy for a simple TCP forwarding setup; or
- Create a GRE/IP-in-IP tunnel and choose Encapsulated if the backend must receive the connecting client's source IP.
See the Port types guide for the forwarding differences and the tunnel setup guide if using encapsulation.
Add the Terraria port
On the service's Ports page, select Add Port and configure:
- The public Terraria port, normally
7777. - Terraria under Layer 7 (Game) as the protocol.
- The selected backend method, backend address or tunnel, and the backend Terraria port.
The integrated example below uses the default port:
The Terraria preset is TCP-only. Add separate port entries with their actual protocols for any additional services or plugins. See Layer 7 protection modes for what the Terraria filter protects.
Test and secure the backend
Wait for deployment to complete, then connect to the filtered IP and public port. Keep host and provider firewalls enabled and allow the Terraria port only from the current Backend Communication IP Addresses shown in the Dashboard. For a tunnel, also allow the selected tunnel protocol between its endpoints.
