How to Change Your Server’s Port at Contabo 

Changing the default port on your server is a simple but effective way to improve security. Standard ports are often targeted by brute-force attacks, making your system more vulnerable to unauthorized access. By switching to a custom port, you add an additional layer of protection without limiting functionality. 

Contabo offers full flexibility in port selection, so you can choose the port that best suits your needs. Below are step-by-step instructions for Windows and Linux servers. 

Why Change the Default Port? 

Servers typically run on standard ports, such as port 22 for SSH. Attackers often scan these ports to attempt brute-force logins. Changing the port does not eliminate all threats, but it significantly reduces the likelihood that automated attacks will reach your system. 

How to Change the Port on Windows Servers 

  1. Open the Registry Editor 
  • Search for ragedit  in the Windows Search box and open it. 
  1. Navigate to the Port Number Entry 
  • Find the location specified in the system registry. 
  1. Modify the Port 
  • Right-click the entry, select Edit → Modify, choose Decimal, and enter your new port number. 
  1. Restart the Server 
  • Confirm the change, close the Registry Editor, and restart your server for the new port to take effect. 
  1. Update Windows Firewall 
  • Open Firewall settings. 
  • Go to Inbound Rules → New Rule → Port. 
  • Add the new port to the allowed list. 

Please note that when using Remote Desktop Connection (RDC), include the new port number after the IP address in the format IPaddress:PortNumber

How to Change the Port on Linux Servers 

  1. Gain Admin Privileges 
  • Use the sudo command to ensure you have sufficient permissions. 
  1. Edit the SSH Configuration Style 
  • Open the configuration file in a text editor such as nano. 
  • Look for the line Port 22 and replace 22 with a new number between 1024 and 65536. 
  • If the line begins with a #, remove it to activate the setting. 
  1. Restart the SSH Service 
  • Apply the changes by restarting the SSH service. 
  1. Adjust the Firewall 
  • Make sure the firewall allows traffic through your newly chosen port. 

Final Tips and Video Instructions 

After you have made changes to your server’s port, it is important that all related settings are properly updated. Adjusting the firewall rules and confirming the connection settings helps prevent accidental blockages and ensures that your server remains accessible while being protected. By following these steps for Linux and Windows, you can maintain smooth operation without compromising security. 

If you’d like a Step-to-Step guide, we have a YouTube Video ready for you. 

Conclusion 

Changing the default port on your server is an easy way to strengthen security against brute-force attacks. Whether you use Windows or Linux, the process only takes a few minutes and offers long-term benefits.  

By adjusting your server’s port, you make it less predictable for attackers and better secured for your hosting needs. 

Scroll to Top