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.

If you’re struggling with SSH and server management, try our managed products Cloudways and App Platform. Cloudways deploys pre-installed software stacks onto Droplets, and App Platform deploys and scales apps directly from your code repository, along with databases and serverless functions, no SSH or server administration required.

DigitalOcean Droplets are managed using a terminal and SSH. You need to have an SSH client and, optionally, an SSH key pair. Clients generally authenticate either using passwords (which are less secure and not recommended) or SSH keys (which are very secure and strongly recommended).

To log in to your Droplet with SSH, you need three pieces of information:

  • The Droplet’s IP address
  • The default username on the server
  • The default password for that username, if you aren’t using SSH keys

To get your Droplet’s IP address, visit the DigitalOcean Control Panel. The IP address is displayed in the IP Address column after your Droplet has been created. You can mouse over it to copy it into your clipboard.

Screenshot of the IP address with the copy link highlighted

The default username is root on most operating systems, like Ubuntu and CentOS.

If you uploaded SSH keys to your team and chose Add SSH Keys upon Droplet creation, you can connect to the Droplet using your preferred SSH client or command line. If you did not use the SSH option, the Droplet’s password is the password you set during creation.

Once you have your Droplet’s IP address, username, and password (if necessary), 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]