How to add Two Factor Authentication (2FA) to your Nextcloud install

Quick tutorial on how to enable two factor authentication for your Nextcloud installation.

You will need to login to admin interface on your Nextcloud installation.

Click on your username in upper right corner and select +Apps from the menu.

Select “Security” from the left side menu, and scroll until you find Two-Factor TOTP Provider. Select Download and enable.

You will need to enter your admin password to confirm the download.

After app is downloaded and installed you should see it on top of the Security list of apps as enabled.

Click again on your username in top right corner and select Settings

Select Security from the left menu and click on Enable TOTP

You will get TOTP QR code or secret, which you will then enter in your mobile app, or scan it with your mobile phone. I like Authy as my TOTP client, so check it out. You can also use google authenticator…

After I scanned QR code with my phone, I got code, which I then entered in the field at the bottom of the screen and selected Verify.

TOTP is now enabled

Now, to test if it works, I logged out. After I entered my username and password, I was then asked for TOTP.

After I entered my code and clicked on Submit, I was successfully logged back in.

Optionally, if you would like to enforce 2FA for all users you can done so from Settings | Security and click on Two-factor Authentication | Enforce two-factor authentication

Click on Save changes.

That would be it for the 2FA on Nextcloud.

Success, we are done.

Disclaimer