How to Add SSH Keys to New or Existing Droplets

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 manage your Droplets using password-based logins, but we strongly recommend using SSH key pairs instead. SSH keys are more secure than passwords and can help you log in without having to remember long passwords.

To use SSH keys with your Droplets, you need to:

  1. Create an SSH key using an SSH client installed on your local computer. OpenSSH is included on Linux, macOS, and Windows Subsystem for Linux. Windows users without Bash can use PuTTY.

    Use OpenSSH to create new SSH keys on MacOS, Linux, or Windows Subsystem for Linux.
    Use PuTTY to create SSH keys on Windows systems without Bash.

  2. Add your SSH key to your Droplets. On DigitalOcean, you can upload your SSH public key to your team, which lets you add it to your Droplets at creation time. This lets you log in to your servers without a password while still remaining secure. You can also add your keys to a Droplet manually after creation.

    Add public SSH keys to a DigitalOcean team to be able to automatically configure SSH key authentication during Droplets creation.
    Add an SSH public key to an existing Droplet to be able to log in using that keypair.

After you create and upload your keys, you can connect using them.

Use a terminal to connect to Droplets using OpenSSH or PuTTY for shell access to your remote server.