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:
| 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 |
--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/server .
./build/server \
--database-type=sqlite \
--database-url=test.db \
--jwt-type=HS256 \
--jwt-secret=test \
--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 \
--jwt-type=HS256 \
--jwt-secret=test \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
Option B: Docker
docker run -p 8080:8080 lakhansamani/authorizer:latest \
--database-type=sqlite \
--database-url=test.db \
--jwt-type=HS256 \
--jwt-secret=test \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
With PostgreSQL:
docker run -p 8080:8080 lakhansamani/authorizer:latest \
--database-type=postgres \
--database-url="postgres://user:pass@host:5432/authorizer" \
--jwt-type=HS256 \
--jwt-secret=test \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
See Docker deployment for Docker Compose examples.
Option C: Download Binary
Download from the release page:
# Download and extract
tar -zxf AUTHORIZER_VERSION -c authorizer
cd authorizer
# Run with required flags
./build/server \
--database-type=sqlite \
--database-url=test.db \
--jwt-type=HS256 \
--jwt-secret=test \
--admin-secret=admin \
--client-id=123456 \
--client-secret=secret
For Mac users, grant permission:
xattr -d com.apple.quarantine build/server
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)
Minimal configuration for local development
For a quick local dev setup:
./build/server \
--env=development \
--http-port=8080 \
--database-type=sqlite \
--database-url=test.db \
--client-id=123456 \
--client-secret=secret \
--admin-secret=admin \
--jwt-type=HS256 \
--jwt-secret=test \
--allowed-origins=http://localhost:3000
See Server Configuration for all flags and hardening options.
Frontend SDK versions for v2
When talking to a v2 server, use:
@authorizerdev/authorizer-jsv3 (^3.0.0-rc.1or compatible v3)@authorizerdev/authorizer-reactv2 (^2.0.0-rc.1or compatible v2)
npm install @authorizerdev/authorizer-js@^3.0.0-rc.1 \
@authorizerdev/authorizer-react@^2.0.0-rc.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 SDK)
import { SignUpRequest, LoginRequest } from '@authorizerdev/authorizer-js'
For more details and a full checklist, see Migration v1 to v2.