How to Add SSH Keys to New or Existing Droplets

Validated on 22 Aug 2019 • Last edited on 22 Nov 2024

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.

    How to Create SSH Keys with OpenSSH on MacOS or Linux

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

    How to Create SSH Keys with PuTTY on Windows

    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.

    How to Manage SSH Public Keys on DigitalOcean Teams

    Add public SSH keys to a DigitalOcean team to be able to automatically configure SSH key authentication during Droplets creation.

    How to Upload an SSH Public Key to an Existing Droplet

    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.

How to Connect to Droplets with SSH

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

We can't find any results for your search.

Try using different keywords or simplifying your search terms.