How do I change my Droplet's SSH port?

Validated on 1 Nov 2022 • Last edited on 18 Mar 2026

You can change your Droplet’s default SSH port by editing its SSH configuration file. To do this, open the /etc/ssh/sshd_config file in a text editor:

nano /etc/ssh/sshd_config

Remove the comment hash (#) in the # Port 22 line and then replace the 22 value with your desired port value. In the following example, the Port line is uncommented and the 22 value is replaced with 20202. This makes the Droplet only accessible via SSH using port 20202.

/etc/ssh/sshd_config
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Include /etc/ssh/sshd_config.d/*.conf

Port 20202
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

After editing the port number, save the file and close it. To implement the changes, reboot the Droplet:

reboot

Once the Droplet reboots, you can confirm the changes by logging in to the Droplet using the ssh command line tool and its port (-p) flag. Use the -p flag to specify the Droplet’s new SSH port:

ssh root@use_your_droplet_ip -p use_your_new_port

For example, if your Droplet has the IP address 192.88.99.255 and the Droplet’s new SSH port is 20202, you would format the command as ssh [email protected] -p 20202 .

A successful login to the Droplet confirms that SSH port has been successfully reassigned. If your login was unsuccessful, you can log in to the Droplet from the Droplet Console and troubleshoot the configuration file.

How do I fix a "system not initialized" error on multi-GPU Droplets?

Make sure NVIDIA Fabric Manager is running and has the same version number as the GPU drivers.

Why am I getting a Droplet autoscale pool error?

There may be an issue with the autoscale pool or Droplet configuration, the VPC network’s size, or resource limits on the team or datacenter.

How to Troubleshoot Load Balancer Health Check Issues

Health checks often fail due to firewalls or misconfigured backend server software.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.