How to set up 2FA on Cloudflare

Checked against Cloudflare's own help on 24 October 2026. Menus change, so follow the nearest label if yours differs.

Short answer

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

Before you start

Have KeyNesta open and unlocked before Cloudflare 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 Cloudflare offers those you set them up in Cloudflare directly.

Steps

  1. Sign in to the Cloudflare dashboard, open Profile, then select Authentication.
  2. From Two-Factor Authentication, select Set up.
  3. Under Mobile App Authentication, select Add. Cloudflare shows the QR code.
  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 six-digit code KeyNesta shows, type your Cloudflare password, then select Next. Cloudflare asks for the password a second time.
  6. Select Next to review your backup codes, save them with Download, Print or Copy, then select Next to finish.
CloudflareWhat to know
Where to startProfile, Authentication, Two-Factor Authentication
Setup key as textOn the QR screen, select Can't scan QR code, Follow alternative steps, which is Cloudflare's own route to configuring the entry by hand in KeyNesta.
Recovery materialCloudflare generates backup codes during setup and lets you download, print or copy them; each one is single use.
SourceCloudflare Docs: Two-factor authentication

Backup and recovery for Cloudflare

Cloudflare generates backup codes during setup and lets you download, print or copy them; each one is single use. You can make a fresh set later from Profile, Authentication, Two-Factor Authentication, Manage, Regenerate, which invalidates the previous codes. Cloudflare's page does not say how many codes a set holds.

Save whatever Cloudflare 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 Cloudflare

Source

Menu paths on this page come from Cloudflare Docs: Two-factor authentication, read on 24 October 2026. Cloudflare's page gives the menu path, the alternative-steps link, the security-key options and the backup-code handling; it does not state how many backup codes a set contains, so this page does not either. KeyNesta is not affiliated with Cloudflare.

Frequently asked questions

Can I use KeyNesta as the authenticator app for Cloudflare?

Yes. Cloudflare 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. Cloudflare 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 Cloudflare 2FA if I lose my phone?

Use one of your backup codes, or read the code out of the authenticator app itself if you still have access to it. 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 Cloudflare to KeyNesta if I cannot scan the QR code?

On the QR screen, select Can't scan QR code, Follow alternative steps, which is Cloudflare's own route to configuring the entry by hand in KeyNesta. 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 Cloudflare 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 Cloudflare stops showing it, you cannot get it back without re-enrolling.

Can I use a security key with Cloudflare as well as KeyNesta?

Cloudflare supports security keys through the WebAuthn protocol: a built-in authenticator such as Apple Touch ID, an Android fingerprint reader or Windows Hello, or an external key such as a YubiKey over USB-A, USB-C, NFC or Bluetooth. It recommends registering more than one so a missing key does not cost you access. KeyNesta has no passkey or hardware security key support, so register those in Cloudflare and keep KeyNesta for the authenticator-app code.

Does Cloudflare ask for my password while I set up the authenticator?

Yes, twice. Cloudflare's steps have you enter the code from the authenticator app, then your Cloudflare password, then the password again before it shows the backup codes. Have the password to hand before you start: the QR code is already on screen by that point.

Where does Cloudflare keep the option to regenerate backup codes?

Profile, then Authentication, then Manage beside Two-Factor Authentication, then Regenerate next to Backup codes. Cloudflare warns that regenerating invalidates the previous codes, so replace the copy you stored at the same time.

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

Open the web app All platforms