2fauth

2fauth

apps.detail.official

apps.detail.types.app from A75G's Repository

apps.detail.sections.overview

A web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes Before running container Unraid CLI mkdir /mnt/user/appdata/2fauth chown 1000:1000 /mnt/user/appdata/2fauth Register first username for admin user More info in https://github.com/Bubka/2FAuth/blob/master/docker/docker-compose.yml and advanced

2FAuth

Docker build status https://codecov.io/gh/Bubka/2FAuth https://github.com/Bubka/2FAuth/blob/master/LICENSE

A web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes

screens

2FAuth Demo
Credentials (login - password) : demo@2fauth.app - demo

Purpose

2FAuth is a web based self-hosted alternative to One Time Passcode (OTP) generators like Google Authenticator, designed for both mobile and desktop.

It aims to ease you perform your 2FA authentication steps whatever the device you handle, with a clean and suitable interface.

I created it because :

  • Most of the UIs for this kind of apps show tokens for all accounts in the same time with stressful countdowns (in my opinion)
  • I wanted my 2FA accounts to be stored in a standalone database I can easily backup and restore (did you already encountered a smartphone loss with all your 2FA accounts in Google Auth? I did...)
  • I hate taking out my smartphone to get an OTP when I use a desktop computer
  • I love coding and I love self-hosted solutions

Main features

  • Manage your 2FA accounts and organize them using Groups
  • Scan and decode any QR code to add account in no time
  • Add custom account without QR code thanks to an advanced form
  • Edit accounts, even the imported ones
  • Generate TOTP and HOTP security codes and Steam Guard codes

2FAuth is currently fully localized in English and French. See Contributing if you want to help on adding more languages.

Security

2FAuth provides several security mechanisms to protect your 2FA data as best as possible.

Single user app

You have to create a user account and authenticate yourself to use the app. It is not possible to create more than one user account, the app is thought for personal use.

Modern authentication

You can sign in 2FAuth using a security key like a Yubikey or a Titan key and disable the traditional login form.

Data encryption

Sensitive data stored in the database can be encrypted to protect them against db compromise. Encryption is provided as an option which is disabled by default. It is strongly recommended to backup the APP_KEY value of your .env file (or the whole file) when encryption is On.

Auto logout

2FAuth automatically log you out after an inactivity period to prevent long life session. The auto logout can be deactivated or triggered when a security code is copied.

RFC compliance

2FAuth generates OTP according to RFC 4226 (HOTP Algorithm) and RFC 6238 (TOTP Algorithm) thanks to Spomky-Labs/OTPHP php library.

Requirements

Installation guides

Upgrading

Migration

2FAuth supports importing from the following formats: 2FAuth (JSON), Google Auth (QR code), Aegis Auth (JSON, plain text), 2FAS Auth (JSON)

Contributing

You can contribute to 2FAuth in many ways:

License

AGPL-3.0

apps.marketingCta.appInstallTitle

apps.marketingCta.appInstallDescription

apps.installHelp.stepOpen apps.installHelp.stepSearchApp apps.installHelp.stepReview apps.installHelp.stepInstall

apps.detail.sections.requirements

Read Overview

apps.detail.sections.categories

apps.downloadStats.title

2,062,158
apps.downloadStats.metrics.totalDownloads
108,128
apps.downloadStats.metrics.thisMonth
97,527
apps.downloadStats.metrics.avgPerMonth

apps.downloadStats.chart.totalOverTime

apps.downloadStats.chart.loading

apps.detail.sections.related

apps.detail.related.exploreCategories

apps.detail.related.exploreAll

apps.detail.sections.details

apps.detail.details.repository
2fauth/2fauth:latest
apps.detail.details.registry
apps.detail.details.lastUpdated2026-07-05
apps.detail.details.firstSeen2022-01-23

apps.detail.sections.runtime

apps.detail.details.webui
http://[IP]:[PORT:8000]/
apps.detail.details.network
bridge
apps.detail.details.shell
sh
apps.detail.details.privileged
false

apps.detail.sections.configuration

PortPorttcp
apps.detail.config.target
8000
apps.detail.config.value
8805
Appdata PathPathrw
apps.detail.config.target
/2fauth
apps.detail.config.value
/mnt/user/appdata/2fauth/
APP_NAMEVariable

You can change the name of the app

apps.detail.config.value
2FAuth
SITE_OWNERVariable

This should be your email address

apps.detail.config.value
mail@example.com
APP_KEYVariable

The encryption key for our database and sessions. Keep this very secure.

apps.detail.config.value
SomeRandomStringOf32CharsExactly
APP_URLVariable

This variable must match your installation's external address.

apps.detail.config.value
http://Unraid_IP:8805
APP_ENVVariable
apps.detail.config.value
local
APP_DEBUGVariable
apps.detail.config.default
false|true
apps.detail.config.value
false
LOG_CHANNELVariable
apps.detail.config.value
daily
LOG_LEVELVariable
apps.detail.config.default
info|debug|notice|warning|error|critical|alert|emergency
apps.detail.config.value
info
DB_DATABASEVariable

Database config (can only be sqlite)

apps.detail.config.value
/srv/database/database.sqlite
CACHE_DRIVERVariable
apps.detail.config.value
file
SESSION_DRIVERVariable
apps.detail.config.value
file
MAIL_DRIVERVariable
apps.detail.config.value
log
MAIL_HOSTVariable
apps.detail.config.value
smtp.mailtrap.io
MAIL_PORTVariable
apps.detail.config.value
2525
MAIL_USERNAMEVariable
apps.detail.config.value
null
MAIL_USERNAMEVariable
apps.detail.config.value
null
MAIL_PASSWORDVariable
apps.detail.config.value
null
MAIL_ENCRYPTIONVariable
apps.detail.config.value
null
MAIL_FROM_NAMEVariable
apps.detail.config.value
null
MAIL_FROM_ADDRESSVariable
apps.detail.config.value
null
MAIL_VERIFY_SSL_PEERVariable
apps.detail.config.default
true|false
apps.detail.config.value
true
THROTTLE_APIVariable

Set to null to disable the API throttling.

apps.detail.config.value
60
LOGIN_THROTTLEVariable

This setting applies to both email/password and webauthn login attemps.

apps.detail.config.value
5
AUTHENTICATION_GUARDVariable
apps.detail.config.default
web-guard|reverse-proxy-guard
apps.detail.config.value
web-guard
AUTH_PROXY_HEADER_FOR_USERVariable
apps.detail.config.value
null
AUTH_PROXY_HEADER_FOR_EMAILVariable
apps.detail.config.value
null
PROXY_LOGOUT_URLVariable
apps.detail.config.value
null
WEBAUTHN_NAMEVariable
apps.detail.config.value
null
WEBAUTHN_IDVariable
apps.detail.config.value
null
WEBAUTHN_ICONVariable
apps.detail.config.value
null
WEBAUTHN_USER_VERIFICATIONVariable
apps.detail.config.default
preferred|required|discouraged
apps.detail.config.value
preferred
TRUSTED_PROXIESVariable
apps.detail.config.value
*
PROXY_FOR_OUTGOING_REQUESTSVariable
apps.detail.config.value
null