How to Connect to Droplets with SSH

DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure.


You can connect to DigitalOcean Droplets using an SSH client, typically from a terminal.

To do so, you need to have an SSH client, like OpenSSH or PuTTY, and the following three pieces of information:

  • The Droplet’s IP address.

    After your Droplet is created, its IP address displayed in the DigitalOcean Control Panel.

  • The username on the server that you want to connect as.

    The default username on initial creation is root on most operating systems, like Ubuntu and CentOS. If you add another user, you can use that username instead.

  • The authentication method for that user.

    If you add SSH keys to your Droplet, you can connect using those keys, which we strongly recommend for its additional security. Otherwise, if you use password authentication, use the password you chose.

Once you have your Droplet’s IP address, username, and password or SSH keys, follow the instructions for your SSH client. OpenSSH is included on Linux, macOS, and Windows Subsystem for Linux. Windows users with Bash also have access to OpenSSH. Windows users without Bash can use PuTTY.

Use a terminal on a Linux, macOS, or Windows computer to connect to Droplets with SSH.
Use PuTTY on a Windows computer to connect to Droplets with SSH.

Alternatively, you can use doctl, the DigitalOcean command-line tool, to connect to your Droplet with SSH.

How to Access a Droplet Using SSH Using the DigitalOcean CLI
  1. Install doctl, the DigitalOcean command-line tool.
  2. Create a personal access token and save it for use with doctl.
  3. Use the token to grant doctl access to your DigitalOcean account.

                        doctl auth init
                    
  4. Finally, run doctl compute ssh. Basic usage looks like this, but you can read the usage docs for more details:

                    doctl compute ssh <droplet-id|name> [flags]
                
In this article...