Back to Minecraft

Configure Server Port

Learn how to change your Minecraft server port and configure port forwarding.

Minecraft
saan.dev
4 min read
...

What is a Server Port?

A port is a network endpoint that allows connections to your server. Minecraft's default port is 25565, but you can change it to any available port.

Changing the Server Port

Step 1: Access Server Properties

  1. Log in to your panel
  2. Navigate to your Minecraft server
  3. Open the File Manager
  4. Locate and open server.properties

Step 2: Modify the Port

  1. Find the server-port= line
  2. Change the port number:
server-port=25565

Change to your desired port, for example:

server-port=25566
  1. Save the file

Note

If you change the port, players must connect using your-server-ip:port. If using the default port (25565), players can connect without specifying the port.

Step 3: Restart Server

  1. Restart your server for changes to take effect
  2. The server will now listen on the new port

Important Notes

Port Range

  • Valid ports: 1-65535
  • Avoid well-known ports (below 1024)
  • Recommended range: 25565-25600 for Minecraft

Make sure the port you choose is not already in use by another service, or your server won't start.

Make sure the port you choose is not already in use by another service, or your server won't start.

Player Connection

After changing the port, players must connect using:

your-server-ip:new-port

For example, if you changed to port 25566:

yourserver.com:25566

If using the default port (25565), players can connect without specifying the port.

Port Forwarding

When Port Forwarding is Needed

Port forwarding is typically handled by your hosting provider, but you may need to configure it if:

  • Running a server on your own network
  • Using a VPS with firewall restrictions
  • Hosting from home

Configuring Port Forwarding

  1. Access Router: Log into your router's admin panel
  2. Find Port Forwarding: Locate port forwarding settings
  3. Add Rule: Create a new port forwarding rule:
    • External Port: The port players will use
    • Internal Port: Your server's port (usually same)
    • Protocol: TCP (and UDP if needed)
    • Internal IP: Your server's local IP address
  4. Save: Save the port forwarding rule
  5. Test: Test the connection

Panel Port Configuration

Some panels allow port configuration through the interface:

  1. Navigate to server settings
  2. Find Network or Port settings
  3. Change the port number
  4. Save changes
  5. Panel may handle port forwarding automatically

Firewall Configuration

Allowing Port Through Firewall

If you have firewall restrictions:

  1. Access Firewall Settings: In your panel or server settings
  2. Add Rule: Create firewall rule for your port
  3. Allow TCP: Allow TCP connections on your port
  4. Save: Apply firewall rules

Common Firewall Locations

  • Panel firewall settings
  • Server operating system firewall
  • Network firewall
  • Cloud provider security groups

Testing Port Configuration

Check if Port is Open

  1. Use online port checker tools
  2. Enter your server IP and port
  3. Check if port is accessible
  4. Verify from different networks

Test Connection

  1. Try connecting from Minecraft client
  2. Use the format: server-ip:port
  3. Verify connection succeeds
  4. Check server console for connection logs

Troubleshooting

Port Already in Use

If you get a "port already in use" error:

  1. Check Other Servers: Another server may be using the port
  2. Change Port: Use a different port number
  3. Stop Conflicting Service: Stop the service using the port
  4. Check Panel: Panel may have port restrictions

Players Can't Connect

  1. Verify Port: Check that port is correct in server.properties
  2. Check Firewall: Ensure firewall allows the port
  3. Verify Port Forwarding: Check port forwarding configuration
  4. Test Port: Use port checker to verify accessibility
  5. Check IP: Ensure players are using correct IP and port

Port Not Saving

  1. Verify Format: Ensure no extra spaces or characters
  2. Check Permissions: Verify file write permissions
  3. Restart Server: Changes require server restart
  4. Check Panel: Some panels override server.properties

Multiple Servers on Same IP

If hosting multiple servers:

  1. Use Different Ports: Assign unique port to each server
  2. SRV Records: Use DNS SRV records for easier connection
  3. Proxy: Use a proxy server to route connections
  4. Document Ports: Keep track of which server uses which port

Best Practices

  • Use Default When Possible: Default port (25565) is easiest for players
  • Document Changes: Note any port changes
  • Test After Changes: Always test connectivity after port changes
  • Keep Ports Consistent: Don't change ports unnecessarily
  • Secure Configuration: Ensure firewall is properly configured