Configuring Query and RCON Ports
Understanding Minecraft Query and RCON Ports
Managing a Minecraft server effectively often requires more than just logging in as a player. For advanced administration, integration with external tools, and monitoring, Minecraft servers offer two crucial protocols: RCON (Remote Console) and the Query Protocol (GameSpy4). Configuring these correctly is fundamental for server owners looking to enhance control and visibility over their server. This guide will walk you through the comprehensive process of setting up both RCON and Query ports, ensuring your server is both powerful and secure.
![]()
What are RCON and Query?
- RCON (Remote Console): This powerful protocol enables remote execution of commands on your Minecraft server. It’s the backbone for external management tools, allowing you to integrate Discord bots for server announcements or moderation, use web dashboards for a graphical interface, or execute administrative commands without needing to log into the game. RCON typically operates over the TCP protocol. The default RCON port is 25575.
- Query Protocol (GameSpy4): The Query Protocol is designed to retrieve specific information about your Minecraft server. This includes vital details like the current player count, the server’s Message of the Day (MOTD), and various server settings. It’s widely utilized by server listing websites to display real-time server status and by status checkers to monitor server health. The Query Protocol operates over the UDP protocol. The default Query port is 25565.
Both RCON and Query configurations are primarily managed through the server.properties file, which serves as the central configuration hub for your Minecraft server.
Step-by-Step Configuration Process
Properly configuring RCON and Query involves a series of careful steps, from editing server files to adjusting network settings. Follow these instructions to ensure a smooth setup.
-
Stop Your Minecraft Server:
Before making any changes to the
server.propertiesfile, it is absolutely critical to stop your Minecraft server. Editing configuration files while the server is running can lead to data corruption or prevent your changes from taking effect. Ensure the server process is completely shut down. -
Locate
server.properties:The
server.propertiesfile is the core configuration file for your Minecraft server. It is typically found in the root directory where your server’s JAR file is located. You can open and edit this file using any standard text editor, such as Notepad on Windows, TextEdit on macOS, or Nano/Vim on Linux. -
Configure RCON:
Within the
server.propertiesfile, locate or add the following lines to configure RCON:-
enable-rcon=true: This setting activates the RCON protocol, allowing remote connections. If this is set tofalse, RCON will not function regardless of other settings. -
rcon.port=: Specify the port number for RCON. The default RCON port is 25575. You can choose a different, unused dedicated port if 25575 is already in use or if you prefer a custom port. Ensure this port is not used by any other service on your server. -
rcon.password=: Set a strong, unique password for RCON. This password grants full administrative access to your server, so it must be robust to prevent unauthorized control. -
broadcast-rcon-to-ops=false: (Optional but recommended) Setting this tofalseprevents the output of RCON commands from being displayed in the in-game chat to all online operators. This helps keep your server console clean and prevents sensitive command outputs from being publicly visible.
-
-
Configure Query:
Next, configure the Query Protocol in your
server.propertiesfile:-
enable-query=true: This setting activates the Query protocol, allowing external services to retrieve server information. -
query.port=: Specify the port number for Query. The default Query port is 25565. Notably, the Query port can often use the same number as your main Minecraft server port (25565). This is possible because the main server operates on TCP, while the Query Protocol operates on UDP, meaning they use different network protocols even if they share the same port number.
-
-
Save Changes:
After making all the necessary modifications to
server.properties, save the file. Double-check that all changes are correctly applied before proceeding. -
Start Your Server:
Once the
server.propertiesfile is saved, restart your Minecraft server. The server will read the updated configuration upon startup, and your RCON and Query settings will become active. -
Configure Firewall:
For RCON and Query to be accessible from outside your server’s local network, you must allow inbound connections on their configured ports through your server’s firewall. This applies to both server-side firewalls (e.g., Windows Firewall on Windows servers, UFW or iptables on Linux servers) and any network security appliances.
- For RCON, open the specified port for TCP traffic.
- For Query, open the specified port for UDP traffic. If the Query port is the same as your main game port (25565), you will need to ensure both TCP (for the game) and UDP (for Query) are allowed on that port.
-
Port Forwarding (if self-hosting):
If your Minecraft server is self-hosted behind a router (e.g., in your home network), you will need to configure port forwarding on your router. This directs incoming external connections on the specified RCON and Query ports to your server’s internal IP address. Without port forwarding, external tools and services will not be able to reach your server’s RCON or Query services.
Important Tips for Secure and Effective Configuration
Beyond the basic setup, consider these crucial tips to ensure the security and optimal functionality of your RCON and Query services.
- Use Strong RCON Passwords: RCON provides full console access, making a weak or easily guessable password a significant security risk. Always use a strong, unique, and complex password that combines letters, numbers, and symbols.
- Dedicated Ports: When choosing ports for RCON and Query, opt for numbers not already in use by other services. While Query can share a port with the game server due to different protocols, it’s generally good practice to use distinct ports for RCON to avoid conflicts. Your hosting provider might offer a list of available dedicated ports.
- Firewall Rules for Restriction: To enhance security, restrict access to your RCON and Query ports through your firewall rules. If possible, configure your firewall to allow connections only from specific, trusted IP addresses (e.g., your own IP, or the IP of a trusted bot host). This significantly reduces the attack surface.
- Test Connection: After configuring everything, always test your RCON connection using a dedicated RCON client (many are available online) to ensure it works correctly. Similarly, use a server status checker to verify that the Query protocol is returning accurate server information.
- RCON Authentication is Plaintext: Be aware that the RCON password is sent unencrypted (in plaintext) over the network. This makes it vulnerable to interception if not properly secured. For maximum security, avoid exposing RCON directly to the public internet without secure tunneling, such as through an SSH tunnel, or by strictly limiting access via firewall rules to trusted IPs only.
Common Mistakes to Avoid
Overlooking these common pitfalls can lead to security vulnerabilities or prevent your RCON and Query services from functioning as intended.
- Weak or Reused RCON Passwords: As emphasized, this is a critical security vulnerability. A compromised RCON password grants an attacker full administrative control over your server. Never reuse passwords from other services.
- Exposing RCON to the Public Internet Without Protection: Due to its plaintext authentication, exposing RCON without proper safeguards (like SSH tunneling or strict IP-based firewall rules) is highly risky. An attacker could potentially sniff the password from network traffic.
-
Not Restarting the Server: Changes made to the
server.propertiesfile will not take effect until the Minecraft server is fully restarted. Simply saving the file is not enough. - Firewall Blocking Ports: Forgetting to configure your server’s firewall or your router’s port forwarding rules is a common reason why RCON and Query services are inaccessible from outside your local network.
- Using the Same Port for Different Services (Incorrectly): While the Query protocol and the main game server can share port 25565 because they use different protocols (UDP for Query, TCP for the game), avoid reusing ports for other distinct services like RCON unless specifically designed to handle such configurations. Each service should ideally have its own dedicated port, especially when different protocols are involved.
-
Leaving
enable-rconorenable-querySet tofalse: If you intend to use these features, you must explicitly set their respective enable flags (enable-rconandenable-query) totruein theserver.propertiesfile. Otherwise, the services will remain inactive.
By meticulously following these steps and heeding the important tips and warnings, you can successfully configure RCON and Query ports for your Minecraft server, unlocking advanced management capabilities and ensuring your server remains secure and well-monitored.