Guide

How to Change Your Hytale Server’s Port Number

How to Change Your Hytale Server's Port Number

Hytale servers use port 5520 by default and communicate via QUIC over User Datagram Protocol (UDP). Changing your server’s port involves modifying its launch command and configuring your network’s firewalls and routers to allow UDP traffic on the new port. This guide provides the direct steps to perform this essential server administration task.

How to Change Your Hytale Server’s Port Number

Changing your Hytale server’s port involves modifying its launch command and configuring your network environment to accommodate the new port.

Step-by-Step Guide

  1. Stop Your Hytale Server

    Always stop your Hytale server completely before making any changes. Modifying files or commands while the server is running can cause data corruption or instability. Use the appropriate command or control panel option to shut it down safely.

  2. Locate Your Server’s Launch Command or Configuration

    The method for changing the port depends on how your server is hosted:

    • Direct Launch: If you run your Hytale server directly from a command line or a script (e.g., a .bat or .sh file), you will need to locate and modify this specific command or script.
    • Game Server Hosting Panel: If you use a third-party game server provider, they typically offer a web-based control panel. Within this panel, look for sections like “Startup Parameters,” “Configuration Files,” or “Command Line Arguments” to adjust these settings.
  3. Modify the Server Port

    The primary method for specifying a new port for your Hytale server is through the --bind argument in its startup command. This argument instructs the server on which IP address and port to listen for incoming connections.

    • Using the --bind Argument: You will add or modify this argument in your server’s launch command.

      Syntax: java -jar HytaleServer.jar --assets Assets.zip --bind <IP_ADDRESS>:<NEW_PORT_NUMBER>

      Replace <IP_ADDRESS> with 0.0.0.0 to bind to all available network interfaces (recommended for most users), and <NEW_PORT_NUMBER> with your desired port (e.g., 3500).

      Example: To set the port to 3500 and bind to all interfaces:

      java -jar HytaleServer.jar --assets Assets.zip --bind 0.0.0.0:3500

      If you omit the IP address (e.g., --bind :3500 or --bind 3500), the server will default to binding to 0.0.0.0.

    • Configuration File (config.json) Uncertainty: While Hytale servers use config.json files for various settings, the official Hytale Server Manual explicitly recommends the --bind argument for port configuration. It is currently uncertain if a direct port setting within config.json is supported or overrides --bind. For reliable port changes, always prioritize the --bind argument.
  4. Configure Firewall Rules

    Once the server is configured for a new port, ensure your operating system’s firewall allows incoming UDP traffic on that port. Hytale’s use of UDP is critical.

    • Windows Defender Firewall (PowerShell):

      Open PowerShell as an administrator and execute the following command, replacing <NEW_PORT_NUMBER> with your chosen port:

      New-NetFirewallRule -DisplayName "Hytale Server Custom Port" -Direction Inbound -Protocol UDP -LocalPort <NEW_PORT_NUMBER> -Action Allow

    • Linux (iptables):

      If you are using iptables, open your terminal and run the following command, replacing <NEW_PORT_NUMBER>:

      sudo iptables -A INPUT -p udp --dport <NEW_PORT_NUMBER> -j ACCEPT

      Remember to save your iptables rules if they are not persistent by default (e.g., sudo netfilter-persistent save).

    • Linux (ufw – Uncomplicated Firewall):

      For systems using ufw, execute this command in your terminal, replacing <NEW_PORT_NUMBER>:

      sudo ufw allow <NEW_PORT_NUMBER>/udp

  5. Configure Port Forwarding (if behind a router)

    If your server is behind a router (common for home networks), you must configure port forwarding. This directs incoming internet traffic on your chosen UDP port to your server machine’s local IP address.

    • Access your router’s administration interface.
    • Find the “Port Forwarding,” “NAT,” or “Virtual Servers” section.
    • Create a new rule with the following settings:
      • External/Public Port: Your chosen <NEW_PORT_NUMBER>.
      • Internal/Local Port: Your chosen <NEW_PORT_NUMBER>.
      • Protocol: Select UDP (not TCP or Both).
      • Internal/Local IP Address: The static local IP of your server machine (e.g., 192.168.1.100).
    • Save changes and restart your router if necessary.

    Ensure your server machine has a static local IP address to maintain consistent port forwarding.

  6. Restart Your Hytale Server

    After modifying the launch command, updating firewall rules, and configuring port forwarding, restart your Hytale server. It should now listen on the new port.

Tips for Managing Your Hytale Server Port

  • Choose an Unused Port: Select a port number not commonly used by other applications (ports above 1023 are generally safe).
  • Document Your Changes: Keep a record of the new port, firewall rules, and router configurations for future reference.
  • Inform Your Players: Communicate the new connection details to all players (e.g., yourserver.com:NEW_PORT_NUMBER).
  • Test Connectivity: After changes, attempt to connect to your server from a different machine (preferably outside your local network) to verify configuration.
  • Emphasize UDP Specificity: Always double-check that you are configuring firewalls and port forwarding for UDP traffic, as this is a common pitfall.

Common Mistakes When Changing Server Ports

  • Forgetting to Stop the Server: Modifying settings while the server is running can cause configuration issues or prevent changes from applying.
  • Incorrect Protocol (TCP vs. UDP): Hytale uses UDP. Configuring firewalls or port forwarding for TCP instead of UDP will prevent connections.
  • Not Opening Firewall Ports: A restrictive operating system firewall will block connections unless a specific rule is added for the new port.
  • Incorrect Port Forwarding Configuration: Mistakes include forwarding to the wrong internal IP, wrong port, or incorrect protocol on your router.
  • Syntax Errors in Launch Commands: Typos or incorrect formatting in the --bind argument can prevent the server from starting or applying the new port.
  • Dynamic Local IP Addresses: If your server machine’s local IP address changes, port forwarding will break. Assigning a static local IP is highly recommended.
  • Symmetric NAT Issues: While QUIC handles NAT traversal well, complex network setups with symmetric NAT can cause issues. In such cases, a Virtual Private Server (VPS) or dedicated server might be more reliable.