Skip to content

2FAuth

Install the latest stable 2FAuth with SQLite and PHP. The playbook creates an administrator before publishing the site, disables registration, and enables encryption for stored OTP secrets.

Install over SSH
uberspace app install 2fauth
Manual installation
2FAuth Guide
Playbook
2fauth.yaml (version 0.1)
Last changed
2026-12-05

Before you start

Use a fresh Asteroid with an empty document root. The installer refuses to overwrite /var/www/virtual/$USER/2fauth or another application's root backend. It selects PHP 8.4 for the entire Asteroid and links the standard document root to 2FAuth's public directory. Custom domains need working DNS first.

Installation

Over SSH: Run the app installer, which uses the 2FAuth playbook. Example output is abbreviated:

[isabell@moondust ~]$ uberspace app install 2fauth --var admin_email=you@example.com
[...]
OK: playbook finished
Option Default Purpose
--var domain=otp.example.com Your Asteroid domain Public domain; configure DNS first
--var admin_email=you@example.com Your Asteroid's sysmail address Administrator login and recovery address

Add --dry to run preflight checks without installing.

First login

Read /var/www/virtual/$USER/2fauth/admin-password over SSH. Open https://isabell.uber.space/ and log in using the configured email address and generated password. Change the password in account settings and remove the initial password file after saving it securely. Registration is disabled; use administrator settings to manage access.

Configuration

Files: The application is in /var/www/virtual/$USER/2fauth, configuration in .env, and SQLite data in database/database.sqlite. The standard document root links to public, keeping secrets outside the served directory. Rebuild the configuration cache after changing .env.

Encryption: Back up APP_KEY together with the database. Do not regenerate it after storing OTP secrets. Normal login-password recovery does not replace this key.

Web and mail: Apache/PHP-FPM serve requests, and local sendmail handles email. A cron entry runs Laravel's scheduler every minute; it does not install updates. See the Guide.

Updates and backups

Updates are manual. Follow the Guide: enable maintenance mode, pause the scheduler, and back up the entire application, including .env, SQLite, storage, and Passport keys. Keep a private copy outside the Asteroid. Never rerun this fresh-install playbook to update.

For maintenance responsibilities, see Your app, your freedom, your responsibility.

Troubleshooting

Installation logs are in ~/logs/app_playbooks/; application logs are in /var/www/virtual/$USER/2fauth/storage/logs/. A failed installation may leave files behind. Inspect the logs before retrying; existing installations are deliberately not overwritten.

For database problems, run the connection check. Example output is abbreviated:

[isabell@moondust ~]$ cd /var/www/virtual/$USER/2fauth
[isabell@moondust 2fauth]$ php artisan 2fauth:check-db-connection
[...]

For password recovery, use Forgot password? and check email delivery. For asset or WebAuthn failures, verify the HTTPS address in .env and rebuild the configuration cache. See the Guide.