Skip to content

Quickstart: PicoIDP with Docker Compose

You need a host name with TLS in front (any reverse proxy) and an SMTP server: password resets and the first administrator’s set-password link go out by mail.

compose.yml:

services:
idp:
image: harbor.rand0m.me/public/picoidp:v0.2.0
restart: unless-stopped
environment:
IDP_BASE_URL: https://idp.example.com # the issuer: scheme and host, no path
IDP_PASSWORD_PEPPER: ${IDP_PASSWORD_PEPPER:?}
IDP_KEY_ENCRYPTION_KEY: ${IDP_KEY_ENCRYPTION_KEY:?}
IDP_SMTP_URL: ${IDP_SMTP_URL:?} # e.g. smtps://user:password@mail.example.com
IDP_MAIL_FROM: "Sign-in <noreply@example.com>"
IDP_TRUSTED_PROXIES: 172.16.0.0/12 # where the proxy's connections come from
IDP_BOOTSTRAP_ADMIN_USERNAME: admin # created only while the directory is empty
IDP_BOOTSTRAP_ADMIN_EMAIL: admin@example.com
volumes:
- data:/data # SQLite: sqlite:/data/idp.db by default
ports:
- "127.0.0.1:8080:8080" # for the reverse proxy only
volumes:
data:

.env next to it (never commit it; back up the two keys together with the database, since neither can be recovered):

Terminal window
IDP_PASSWORD_PEPPER=$(openssl rand -base64 32)
IDP_KEY_ENCRYPTION_KEY=$(openssl rand -base64 32)
IDP_SMTP_URL=smtps://user:password@mail.example.com

(Write the generated values into the file; .env does not run commands.)

Then:

  1. docker compose up -d. Migrations run at start; GET /readyz answers 200 once it is up.
  2. Point the reverse proxy for https://idp.example.com at 127.0.0.1:8080.
  3. Open the mail sent to the admin address, set a password, sign in at https://idp.example.com/admin/.
  4. Create a client for each application (a folder’s New ▾ → Client), list who may sign in to it, and give the application https://idp.example.com as its issuer; it finds everything else in /.well-known/openid-configuration.

More: a separate admin host, PostgreSQL/MariaDB, preconfigured themes and sign-in policy, backups, upgrades: the installation guide and the administrator guide.