askbuy/guides/vpn-security
Last audited 02 Jun 2026·● live
▶ The question

best self-hosted 2fa apps in 2025

Stop trusting Google Authenticator or Authy with your 2FA secrets. Here are the best self-hosted 2FA apps — from simple OTP generators (2FAuth) to full identity providers (Authentik) — so you control your own security, backups, and recovery.

Jump to →§ the picks§ how we ranked§ who should skip what§ sources§ ask follow-up
▲ How this page was builtangle_scoutauditedproduct_mining4 picks · 3 sourcespage_writergemma-4-31baudit_scorefreshrewrite_countv1
§ 01The picks

The picks

best dedicated self-hosted otp web app
2
2FAuth
Lightweight, web-based, runs on any device via browser, supports TOTP/HOTP with backup/restore. The simplest way to replace Google Authenticator with something you control.
/go/30b3f412-1d3c-4cb6-962a-1a2200697a53Check ↗
best authentication server for reverse proxy setups
A
Authelia
Adds 2FA + SSO in front of any web service behind a reverse proxy. Ideal for self-hosters running multiple apps who want a unified login layer.
/go/0275b09e-38cb-44af-b570-9a85757c44eaCheck ↗
best full identity provider
A
Authentik
Enterprise-grade MFA, SSO, LDAP, SAML, and OAuth2 in a self-hosted package. For advanced users who need more than just 2FA codes.
/go/e4b26e94-84ab-419d-b7bb-ece013d059b5Check ↗
best integrated password manager + 2fa
B
Bitwarden Authenticator
Self-hosted Bitwarden includes built-in TOTP authenticator. Perfect if you already run (or plan to run) your own password manager.
/go/edca4a60-b31b-4809-bb8f-ff14ee4ece49Check ↗
§ 02Why this list

Why
this list

if you're still using google authenticator or authy, you're trusting someone else's server with your 2fa secrets. self-hosting means you control the encryption keys, the backups, and the recovery process no vendor lock-in, no surprise sunset announcements, and no "lost phone" disaster that requires weeks of account recovery.

here are the best self-hosted 2fa apps, from a simple otp generator to a full identity provider.

what to look for in a self-hosted 2fa solution

before we get into the picks, it helps to think about what you actually need:

  • just otp codes? you want a lightweight app that stores your totp/hotp secrets and generates codes on demand.
  • sso + 2fa? you want an authentication server that sits in front of your self-hosted services and handles login, 2fa, and session management.
  • all-in-one? you want a password manager that also handles 2fa, so you have one less service to manage.

the picks below cover all three scenarios.

the best self-hosted 2fa apps

1. 2fauth best dedicated otp web app

2fauth is a web-based, self-hosted alternative to google authenticator that runs on both mobile and desktop via a browser.1 it stores your otp secrets on your own server, supports totp and hotp, and includes a backup/restore feature so you never lose access if your phone dies.

best for: anyone who wants a simple, dedicated 2fa code generator that they can access from any device without vendor lock-in.

deployment: docker or manual php setup. lightweight runs on a raspberry pi.

2. authelia best authentication server for reverse proxy setups

authelia is an open-source authentication and authorization server that provides 2fa and sso for web applications via a reverse proxy.2 it sits in front of your services (nginx, traefik, caddy) and enforces authentication before users reach the app.

best for: self-hosters running multiple web services behind a reverse proxy who want a unified login + 2fa layer.

deployment: docker, kubernetes, or bare metal. requires a reverse proxy.

3. authentik best full identity provider

authentik is a flexible, self-hosted identity provider that handles mfa, sso, and can enforce authentication in front of legacy apps.3 it's more feature-rich than authelia think keycloak-level capabilities without the java overhead.

best for: advanced self-hosters or small organizations that need ldap integration, saml, oauth2 providers, and detailed access policies alongside 2fa.

deployment: docker-compose or kubernetes. moderate complexity.

4. bitwarden best integrated password manager + 2fa

bitwarden is primarily a password manager, but its self-hosted version includes a built-in authenticator (totp) that syncs across all your devices. you get password management and 2fa codes in one self-hosted stack.

best for: users who already self-host bitwarden (or want to) and prefer a single dashboard for passwords and 2fa codes.

deployment: docker via the official bitwarden unified image. heavier than 2fauth but still manageable.

comparison

feature2fauthautheliaauthentikbitwarden
deploymentdocker / phpdocker + reverse proxydocker-compose / k8sdocker
primary use caseotp codessso + 2fa proxyidentity providerpassword mgr + otp
complexitylowmediumhighmedium

which one should you choose?

  • start with 2fauth if you just want to replace google authenticator with something you control.
  • use authelia if you have a reverse proxy setup and want to add 2fa to all your services at once.
  • pick authentik if you need enterprise features (ldap, saml, detailed policies) alongside 2fa.
  • go with bitwarden if you're already self-hosting your passwords and want 2fa in the same place.

all four are open-source, actively maintained, and respect your privacy. pick the one that matches the complexity you're comfortable with.

disclosure: some links on this page are affiliate links. we only recommend tools we've researched and verified. you're never charged extra, and it helps keep the site running.

§ 03Who should skip what

Who should skip what

Skip 2FAuth if…
Lightweight, web-based, runs on any device via browser, supports TOTP/HOTP with backup/restore.
→ consider Authelia
Skip Authelia if…
Adds 2FA + SSO in front of any web service behind a reverse proxy.
→ consider Authentik
Skip Authentik if…
Enterprise-grade MFA, SSO, LDAP, SAML, and OAuth2 in a self-hosted package.
→ consider Bitwarden Authenticator
§ 05keep going

Got a follow-up?

This page was written by the engine and the engine is still on the line. The conversation below picks up where the article stops.

▶ Live conversation · context loaded
Does the engine have anything to add to “best self-hosted 2fa apps in 2025”?
askbuy~1s · cited every claim

Yes — the picks above are the engine's current verdicts. Ask a sharper version of this question below and you'll get a custom answer with the latest pricing.

▸ Or try one of these
⌘↵
§ 04Sources · 3

Sources
· 3

1
GitHub - Bubka/2FAuth
open ↗
2
Compare 10 Open Source MFA Tools - AIMultiple
open ↗
3
Authentik Official Site
open ↗
ⓘ links above are tracked through /go/<id> · we earn a commission, price unchanged for youhow askbuy makes money →
best self-hosted 2fa apps in 2025