--- title: 2FAuth created: 2026-06-06 updated: 2026-06-06 type: app tags: [catalogue, 2FA, security, php, web-based] confidence: high contested: false sources: [https://selfh.st/apps/?tag=2FA, https://github.com/Bubka/2FAuth] --- # 🔐 2FAuth > **Gestionnaire de codes 2FA web-based**, self-hosted. Une alternative simple Ă  Google Authenticator avec sync et accĂšs multi-appareils. ## 📋 Informations GĂ©nĂ©rales | Champ | Valeur | | :--- | :--- | | **Site web** | [2fauth.app](https://2fauth.app) | | **GitHub** | [Bubka/2FAuth](https://github.com/Bubka/2FAuth) | | **License** | AGPL-3.0 | | **Langage** | PHP (Laravel) | | **Étoiles GitHub** | 4k ⭐ | | **DerniĂšre MAJ** | 2026-04-03 | | **CatĂ©gorie** | [[cat-2fa|2FA]] | | **Note** | 100% gratuit, pas d'Ă©dition payante | ## 📝 Description **2FAuth** est une application web qui vous permet de gĂ©rer vos codes 2FA depuis n'importe quel navigateur, avec : - **Interface web responsive** (utilisable sur mobile aussi) - **Multi-utilisateurs** (auth intĂ©grĂ©e) - **Organisation par groupes** et tags - **CatĂ©gories** pour les trier - **IcĂŽnes** auto-dĂ©tectĂ©es pour les services connus - **Import/Export** : depuis Google Authenticator, Aegis, etc. - **API REST** pour intĂ©grations - **OAuth2/OIDC** pour login externe (Google, GitHub, etc.) - **WebAuthn** pour le login 2FA - **Mode hors-ligne** (PWA) **DiffĂ©rence avec Ente Auth** : 2FAuth est 100% **self-hosted** et **web-based** (pas d'app native). IdĂ©al si vous voulez un serveur que vous contrĂŽlez totalement. ## 🚀 Installation ### Option 1 : Docker Compose (recommandĂ©) ```yaml # docker-compose.yml version: '3.8' services: 2fauth: image: 2fauth/2fauth:latest container_name: 2fauth restart: unless-stopped environment: - APP_NAME=2FAuth - APP_ENV=production - APP_KEY=base64:VOTRE_CLE_32_CHARS_ICI= - APP_URL=https://2fa.example.com - LOG_CHANNEL=stack - LOG_LEVEL=info - DB_CONNECTION=sqlite - DB_DATABASE=/var/www/html/database/2fauth.sqlite - CACHE_DRIVER=file - SESSION_DRIVER=file - SESSION_LIFETIME=120 - MAIL_MAILER=smtp - MAIL_HOST=*** - MAIL_PORT=587 - MAIL_USERNAME=*** - MAIL_PASSWORD=*** - MAIL_ENCRYPTION=tls - MAIL_FROM_ADDRESS=no-reply@example.com - MAIL_FROM_NAME=2FAuth - AUTHENTICATION_GUARD=web - 2FAUTH_IS_DEMO_APP=false volumes: - 2fauth-data:/var/www/html/database - 2fauth-logs:/var/www/html/storage/logs labels: - "traefik.enable=true" - "traefik.http.routers.2fauth.rule=Host(`2fa.example.com`)" - "traefik.http.routers.2fauth.entrypoints=websecure" - "traefik.http.routers.2fauth.tls.certresolver=letsencrypt" - "traefik.http.services.2fauth.loadbalancer.server.port=80" networks: - proxy volumes: 2fauth-data: 2fauth-logs: networks: proxy: external: true ``` ### Option 2 : Avec MySQL (production) ```yaml version: '3.8' services: 2fauth: image: 2fauth/2fauth:latest container_name: 2fauth restart: unless-stopped environment: - APP_URL=https://2fa.example.com - DB_CONNECTION=mysql - DB_HOST=db - DB_PORT=3306 - DB_DATABASE=2fauth - DB_USERNAME=2fauth - DB_PASSWORD=*** depends_on: - db volumes: - 2fauth-data:/var/www/html/storage # ... labels comme ci-dessus db: image: mariadb:10.11 container_name: 2fauth-db restart: unless-stopped environment: - MARIADB_DATABASE=2fauth - MARIADB_USER=2fauth - MARIADB_PASSWORD=*** - MARIADB_RANDOM_ROOT_PASSWORD=*** volumes: - 2fauth-db:/var/lib/mysql volumes: 2fauth-data: 2fauth-db: ``` ## ⚙ Configuration Initiale 1. **GĂ©nĂ©rer une APP_KEY** : ```bash docker run --rm 2fauth/2fauth:latest php artisan key:generate --show ``` 2. **Lancer le conteneur** avec cette clĂ© 3. **CrĂ©er le premier compte** via l'UI 4. **Configurer SMTP** pour la rĂ©cupĂ©ration de mot de passe 5. **Importer vos codes 2FA existants** : - Depuis Google Authenticator : exporter en QR - Depuis Aegis : export JSON - Manuellement : ajouter un par un ## 🔄 Alternatives ### Open Source - [[app-ente-auth]] — Mobile/desktop natif, E2E - [[app-vaultwarden]] — Inclut 2FA dans le password manager - [[app-defguard]] — VPN + 2FA intĂ©grĂ© - **Aegis** (Android only) — Populaire, local-only - **Authenticator CC** — Open source, par l'Ă©quipe Bitwarden ### PropriĂ©taires (ce que 2FAuth remplace) - **Google Authenticator** — Pas de sync, pas chiffrĂ© - **Authy** — Demande un numĂ©ro de tĂ©lĂ©phone - **Microsoft Authenticator** — Tracking Microsoft ## 🔐 SĂ©curitĂ© - **Chiffrement des secrets 2FA** au repos (chiffrement Laravel) - **2FA pour l'accĂšs Ă  2FAuth** : supportĂ© (TOTP, WebAuthn) - **Session timeout** : configurable - **HTTPS obligatoire** (ne pas exposer en HTTP) - **Pas de tracking** : 100% self-hosted ## 📚 Ressources - [Documentation officielle](https://docs.2fauth.app/) - [GitHub Bubka/2FAuth](https://github.com/Bubka/2FAuth) - [DĂ©mo en ligne](https://demo.2fauth.app/) ## Pages LiĂ©es - [[cat-2fa]] — CatĂ©gorie 2FA - [[app-ente-auth]] — Alternative mobile/desktop - [[app-vaultwarden]] — Password + 2FA - [[traefik]] — Reverse proxy