---
title: How Do I Change My Vultr Instance SSH Port?
url: https://docs.vultr.com/support/products/compute/instances/how-do-i-change-my-vultr-instance-ssh-port
description: Set a port from 1024 to 60000 in sshd_config, allow it in ufw, and restart sshd on your Vultr Compute instance.
publish_date: 2025-09-15T13:34:29.942612Z
last_updated: 2026-10-26T23:27:31.378912Z
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

Changing the default SSH port (22) enhances security by reducing automated attacks. Follow the steps below to safely change the SSH port on your Vultr instance:

1. SSH into your Vultr instance.
1. Open the SSH daemon config file.

    ```console
    $ sudo nano /etc/ssh/sshd_config
    ```

    Locate the following line:

    ```
    #Port 22
    ```

    Uncomment it and replace `22` with your desired port number (e.g., `2222`):

    ```ini
    Port 2222
    ```

    Use a port between `1024` and `60000` to avoid conflicts.

1. Allow the new port in the firewall.

    ```console
    $ sudo ufw allow 2222/tcp
    ```

1. Restart the SSH service to apply the changes.

    ```console
    $ sudo systemctl restart sshd
    ```

1. To SSH into your instance now you have to define the port as well.

    ```console
    $ ssh username@your_instance_ip -p 2222
    ```

    Once verified, you can optionally remove access to port `22`:

    ```console
    $ sudo ufw delete allow 22/tcp
    ```

The above steps are demonstrated on an **Ubuntu** instance. If you're using a different Linux distribution (like CentOS, AlmaLinux, or FreeBSD), refer to your system's specific documentation.
