Getting Started
This guide helps you start Authorizer v2 using the CLI-based configuration model. If you are upgrading from v1, read the Migration v1 to v2 guide alongside this page.
Required Variables
All examples below use these required variables. Replace with your own values for production:
--encryption-key (2.4.0+)Encrypts TOTP shared secrets and OTP digests at rest. Required when --jwt-type
is RS*/ES* — with no --jwt-secret to fall back to, the server refuses to
start without it. With HMAC types (HS*) it falls back to --jwt-secret, but a
distinct value is recommended: rotating the JWT secret otherwise re-keys at-rest
data and locks out every enrolled TOTP user.
Generate it once (openssl rand -hex 32), store it as a secret, and keep it
stable across restarts — a key that changes on every boot leaves existing TOTP
enrolments and pending OTPs undecryptable. Omit the flag on releases before
2.4.0, which do not have it. See Server Configuration.
| Flag | Description | Sample Value |
|---|---|---|
--database-type | Database type | sqlite |
--database-url | Database connection string | test.db |
--jwt-type | JWT signing algorithm | HS256 |
--jwt-secret | JWT signing secret | test |
--encryption-key | At-rest key for TOTP secrets and OTP digests (2.4.0+). Required with RS*/ES* | (generate once with openssl rand -hex 32) |
--admin-secret | Admin secret for admin operations | admin |
--client-id | Client identifier (required) | 123456 |
--client-secret | Client secret (required) | secret |
Important:
--client-idand--client-secretare required in v2. The server does not read.envfiles or dashboard-managed env anymore.
Option A: Run from Source
Prerequisites
- Go >= 1.24
- Node.js >= 18 (only if building web UIs)
- A database (SQLite, Postgres, MySQL, etc.)
Build and run
git clone https://github.com/authorizerdev/authorizer.git
cd authorizer
go build -o build/authorizer .
./authorizer \
--database-type=sqlite \
--database-url=test.db \
--url=http://localhost:8080 \
--jwt-type=HS256 \
--jwt-secret=test \
--encryption-key=test-encryption-key \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
For local development:
make dev
# or
go run main.go \
--database-type=sqlite \
--database-url=test.db \
--url=http://localhost:8080 \
--jwt-type=HS256 \
--jwt-secret=test \
--encryption-key=test-encryption-key \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
Option B: Docker
docker run -p 8080:8080 \
-v authorizer_data:/authorizer/data \
quay.io/authorizer/authorizer:latest \
--database-type=sqlite \
--database-url=/authorizer/data/data.db \
--url=http://localhost:8080 \
--client-id=123456 \
--client-secret=secret \
--admin-secret=admin \
--jwt-type=HS256 \
--jwt-secret=test \
--encryption-key=test-encryption-key
Open http://localhost:8080/app (login) and http://localhost:8080/dashboard (admin secret admin). The authorizer_data volume keeps the SQLite database across restarts. --url is required. An app on another origin, such as a dev server on http://localhost:3000, also needs --allowed-origins=http://localhost:8080,http://localhost:3000. These values are placeholders for local use only.
With PostgreSQL:
docker run -p 8080:8080 quay.io/authorizer/authorizer:latest \
--database-type=postgres \
--database-url="postgres://user:pass@host:5432/authorizer" \
--url=http://localhost:8080 \
--jwt-type=HS256 \
--jwt-secret=test \
--encryption-key=test-encryption-key \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
See Docker deployment for Docker Compose examples.
Option C: Binary
Releases publish the Docker image (Option B), not prebuilt binaries. To run a binary, build it from source (Go and Node.js required) and run it from the repository root, where the login UI, dashboard and email templates live under web/:
git clone https://github.com/authorizerdev/authorizer.git && cd authorizer
go build -o build/authorizer . && make build-app build-dashboard
# Run with required flags
./build/authorizer \
--database-type=sqlite \
--database-url=test.db \
--url=http://localhost:8080 \
--jwt-type=HS256 \
--jwt-secret=test \
--encryption-key=test-encryption-key \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
See Binary deployment for systemd service setup.
Option D: Kubernetes
kubectl apply -f authorizer-v2.yaml
See Kubernetes deployment for full manifests and Helm Chart for Helm-based installation.
Option E: One-click Deployments
| Platform | Deploy Link |
|---|---|
| Railway | Deploy on Railway |
| Heroku | Deploy to Heroku |
| Render | Deploy to Render |
| Koyeb | Deploy to Koyeb |
See the Deployment section for detailed guides for each platform.
Verify it works
After starting the server, open:
http://localhost:8080/app-- built-in login UIhttp://localhost:8080/graphql-- GraphQL endpoint (playground if enabled)
Since 2.4.0, signup and login offer MFA setup by default: the response says Proceed to mfa setup and carries no access token until the user enrols a factor or declines it (skip_mfa_setup). For scripted local testing, pass --disable-mfa to get tokens directly. Don't disable MFA in production.
Minimal configuration for local development
For a quick local dev setup:
./authorizer \
--env=development \
--http-port=8080 \
--database-type=sqlite \
--database-url=test.db \
--url=http://localhost:8080 \
--client-id=123456 \
--client-secret=secret \
--admin-secret=admin \
--jwt-type=HS256 \
--jwt-secret=test \
--encryption-key=test-encryption-key \
--allowed-origins=http://localhost:8080,http://localhost:3000
List the server's own URL in --allowed-origins alongside your app's origin. With an explicit list, state-changing requests (including the built-in login page at /app) are accepted only from listed origins. The default * accepts them only from the server's own origin, so an app on another port cannot log in until you list it.
This example signs tokens with HS256, so /.well-known/jwks.json is empty ({"keys":[]}). If anything validates tokens through JWKS (your API, an MCP server, Hasura), use RS256 or ES256 with --jwt-private-key and --jwt-public-key instead.
See Server Configuration for all flags and hardening options.
Frontend SDK versions for v2
When talking to a v2 server, use:
@authorizerdev/authorizer-jsv4 (^4.0.0) for server 2.4.0 and later. Its only breaking change from v3 is that the admindeleteUsertakes a user id instead of an email.@authorizerdev/authorizer-reactv2 (^2.2.1), which depends onauthorizer-jsv4.
npm install @authorizerdev/authorizer-js@^4.0.0 \
@authorizerdev/authorizer-react@^2.2.1
If you used types directly from authorizer-js, rename them for v2:
// Old (v1)
import { SignupInput, LoginInput } from '@authorizerdev/authorizer-js'
// New (v2 server + v3/v4 SDK)
import { SignUpRequest, LoginRequest } from '@authorizerdev/authorizer-js'
For more details and a full checklist, see Migration v1 to v2.