Skip to content

Self-host quickstart

You’ll have a working authn.sh instance on your laptop in under five minutes.

  • Docker 25+ with Compose v2.
  • A free port 8080 (the bundled stack publishes the app there) and 8025 for the Mailpit UI.
Terminal window
git clone https://github.com/authn-sh/authn.git
cd authn
cp .env.example .env

The defaults in .env.example are sized for a local install: path-mode routing on http://localhost:8080, Postgres + Redis from the bundled images, and SMTP pointing at the dev Mailpit.

Terminal window
make dev

That starts the app (nginx + php-fpm), a worker, the scheduler, Vite for HMR, Mailpit, Postgres, and Redis. The first run pulls images and builds the dev Dockerfile target — give it a couple of minutes.

Set the credentials in your shell, then run the bootstrap inside the app container:

Terminal window
docker compose -f docker-compose.yml -f docker-compose.dev.yml exec \
-e AUTHN_BOOTSTRAP_ADMIN_EMAIL=you@example.com \
-e AUTHN_BOOTSTRAP_ADMIN_PASSWORD='change-me-please' \
app php artisan authn:bootstrap

The command is idempotent — re-running it on an already-bootstrapped instance is a no-op. The output prints your pk_live_… and sk_live_… keys; copy them out, they’re shown once.

Open http://localhost:8080/sign-in in a browser, type the credentials you just set, and you’ll land on /dashboard/create-project — your operator account has no projects yet.

That’s it. From here you can:

ServiceURLNotes
Apphttp://localhost:8080Account Portal + FAPI + Dashboard
Mailpit UIhttp://localhost:8025Inspects every outgoing email in dev
Vitehttp://localhost:5173HMR for the React surfaces

Stop everything with make down. Drop volumes too with make down V=1.