How to set up 2FA on DigitalOcean

Checked against DigitalOcean's own help on 21 November 2026. Menus change, so follow the nearest label if yours differs.

Short answer

Open DigitalOcean's security settings (Control panel, My Account, Two-factor authentication), choose the authenticator app option, and scan the QR code DigitalOcean shows with KeyNesta (or enter the setup key by hand). Type the six-digit code KeyNesta shows back into DigitalOcean to finish, and save the recovery material DigitalOcean gives you before you close the page.

Before you start

Have KeyNesta open and unlocked before DigitalOcean shows the QR code, so the code is ready the moment it appears. KeyNesta needs no account to do this. It stores authenticator-app codes only: it does not do passkeys or hardware security keys, and where DigitalOcean offers those you set them up in DigitalOcean directly.

Steps

  1. Sign in to the DigitalOcean control panel and go to the My Account page.
  2. Scroll to the Two-factor authentication section, then click Set Up 2FA.
  3. In the Set up two factor authentication window, under Choose Method, choose the authentication-app method rather than SMS. DigitalOcean shows a QR code to scan.
  4. Add it to KeyNesta. Open the KeyNesta web app (or the app on your phone once it is released), unlock your vault, choose Scan QR and point the camera at the code on screen. If you cannot scan, use Import QR image, or choose Add entry to paste the setup key.
  5. Enter the PIN KeyNesta gives you in the field provided. DigitalOcean links the app to your account once the PIN is accepted.
  6. Add a backup method, which DigitalOcean requires. It recommends backup codes: a set of 20, shown on screen, with a digitalocean_backupcodes.txt download.
DigitalOceanWhat to know
Where to startControl panel, My Account, Two-factor authentication
Setup key as textIf you cannot scan, click the Try this instead link directly underneath the QR code to get a numerical code you can enter by hand.
Recovery materialDigitalOcean makes you add a backup method once the primary one is set, and recommends backup codes: it generates a set of 20, shows them on screen and lets you download them as digitalocean_backupcodes.txt.
SourceDigitalOcean Docs: How to Manage Two-Factor Authentication for DigitalOcean Accounts

Backup and recovery for DigitalOcean

DigitalOcean makes you add a backup method once the primary one is set, and recommends backup codes: it generates a set of 20, shows them on screen and lets you download them as digitalocean_backupcodes.txt. The codes are single use, so DigitalOcean suggests deleting or crossing one out once you have used it, and you can generate more when only a few valid ones are left. Regenerating invalidates every code remaining from the old set.

Save whatever DigitalOcean gives you somewhere that is not the phone holding your codes. Where to store your 2FA backup codes compares the options, and 2FA backup and sync covers backing up the KeyNesta vault itself.

Things to know about DigitalOcean

Source

Menu paths on this page come from DigitalOcean Docs: How to Manage Two-Factor Authentication for DigitalOcean Accounts, read on 21 November 2026. The menu path, the Choose Method window, the Try this instead link, the twenty backup codes and the digitalocean_backupcodes.txt filename, the support-ticket fallback and the Google/GitHub login rule all come from this page. It does not mention passkeys or hardware security keys, so this page makes no claim about them. KeyNesta is not affiliated with DigitalOcean.

Frequently asked questions

Can I use KeyNesta as the authenticator app for DigitalOcean?

Yes. DigitalOcean asks for a standard time-based code, and KeyNesta reads the same QR code or setup key and generates that code on your device, offline. DigitalOcean does not learn which app you chose. KeyNesta holds authenticator-app codes only; it has no passkey or hardware security key support. How to add the code is in How do I add a 2FA code to KeyNesta?

What happens to my DigitalOcean 2FA if I lose my phone?

Search your computer for the backup codes file, named digitalocean_backupcodes.txt by default; if your backup method is not working either, DigitalOcean asks you to submit a support ticket to have access to the account restored. If your KeyNesta vault is synced or you made an encrypted backup, you can restore the codes on another device; the lost phone guide covers the order to do things in.

How do I add DigitalOcean to KeyNesta if I cannot scan the QR code?

If you cannot scan, click the Try this instead link directly underneath the QR code to get a numerical code you can enter by hand. Put that key into KeyNesta with Add entry, then type the PIN KeyNesta shows back into DigitalOcean. In KeyNesta you can also upload a screenshot with Import QR image, paste an otpauth:// link, or add the entry by hand with the secret. Delete any screenshot of the QR afterwards: it works like a password.

Can I use the same DigitalOcean code on two devices?

Codes come from a shared secret, so any app that holds the secret shows the same codes. The tidy way is KeyNesta's optional end-to-end encrypted sync, which carries the vault to a second device. The alternative is to add the secret to a second app while the QR code is still on screen; once DigitalOcean stops showing it, you cannot get it back without re-enrolling.

Why does DigitalOcean insist on a backup method as well as my authenticator app?

Because it builds the backup into setup: once the primary method is configured you have to add one, and DigitalOcean describes it as how you regain access if the 2FA device is lost or stolen. It recommends backup codes, and gives you 20 of them.

I sign in to DigitalOcean with GitHub, so where do I turn on 2FA?

In GitHub. DigitalOcean says two-factor authentication is only available when you log in with a username and password, and that an account using Google or GitHub login manages 2FA through that provider instead. KeyNesta can still hold that code: the GitHub steps are on our GitHub setup page.

How do I move my DigitalOcean code to a different authenticator app?

DigitalOcean has no in-place swap. Its docs say to disable 2FA on the My Account page and then enable it again with your preferred app, scanning the fresh QR code. Delete the old KeyNesta entry at the same time so you cannot read a dead code out of it.

Try KeyNesta free. The web app needs no sign-up.

Open the web app All platforms