Self-host Authorizer on a managed VPS: your own login server

To self-host Authorizer on a managed VPS is to keep the accounts, passwords and sessions of your users on a server of your own, which our teams keep up to date and monitor day and night. Authorizer is a free, open source authentication and authorization server under the Apache-2.0 license, with OAuth 2.0 and OpenID Connect, social logins, passkeys and multi-factor authentication. This guide follows its official Docker image at version 2.4.10, and we ran every command on a Simafri VPS before writing it: installation with Docker Compose, PostgreSQL and Redis, HTTPS, the admin API, a first user, backups and updates.

Simon Vasconcelos Lee By Published on 30 November 202612 minute read

All guides Development and DevOps

In short

  1. The Apache-2.0 license lets you run Authorizer for your company or your clients, and modify it, with no license to buy.
  2. Install it with Docker Compose: the image quay.io/authorizer/authorizer, PostgreSQL 18 for the data and Redis 8 for the sessions, with port 8110 published on 127.0.0.1 behind an HTTPS reverse proxy.
  3. Since version 2, the server reads its configuration from command-line flags only: Compose fills them from a .env file that holds the six secrets.
  4. Set --url to your public address, list it in --allowed-origins with your apps, and give the reverse proxy to --trusted-proxies.
  5. Back up with pg_dump, restore into an emptied database with pg_restore --exit-on-error, and update by changing the image tag: the schema migrates at startup.

What Authorizer does

Authorizer is an authentication and authorization server written in Go. Your applications send their users to it to sign up and sign in, and receive tokens they can trust; the user data stays in your own database.

What the Apache-2.0 license allows

Authorizer is published under the Apache License 2.0. You can use it free of charge, for your company, your products or your clients, copy it, modify it and distribute it, including in closed products, as long as you keep the license and its notices and say which files you changed. The license also grants a patent license from the contributors. The software is provided without warranty.

The resources to plan for

The documentation sets no minimum size, and Authorizer is very light. Here is what we measured on our test VPS, with two vCPU and 4 GB of memory, after the installation and a first user:

Server size therefore depends on the number of sign-ins and on the other applications you run beside Authorizer. On a managed VPS, tell us about your usage and we will recommend the right size.

Installing with Docker Compose

The official image, quay.io/authorizer/authorizer, contains the server, the login page and the dashboard, and serves them on port 8080. Version 2 is configured with command-line flags only: the server does not read a .env file or environment variables. Docker Compose does, though, so the flags go in the command of the service and the secrets in a .env file that Compose substitutes. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, create a folder such as /opt/authorizer and put this compose.yaml in it, based on the PostgreSQL and Redis example of the Docker page:

compose.yaml
services:
  postgres:
    image: postgres:18-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: authorizer
      POSTGRES_USER: authorizer
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
    volumes:
      - postgres_data:/var/lib/postgresql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U authorizer -d authorizer"]
      interval: 10s
      timeout: 5s
      retries: 10

  redis:
    image: redis:8-alpine
    restart: unless-stopped
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 10

  authorizer:
    image: quay.io/authorizer/authorizer:2.4.10
    restart: unless-stopped
    ports:
      - "127.0.0.1:8110:8080"
    command:
      - --env=production
      - --url=https://authorizer.example.com
      - --allowed-origins=https://authorizer.example.com,https://app.example.com
      - --trusted-proxies=172.30.110.1
      - --database-type=postgres
      - --database-url=postgres://authorizer:${POSTGRES_PASSWORD}@postgres:5432/authorizer?sslmode=disable
      - --redis-url=redis://redis:6379
      - --client-id=${CLIENT_ID:?set CLIENT_ID in .env}
      - --client-secret=${CLIENT_SECRET:?set CLIENT_SECRET in .env}
      - --admin-secret=${ADMIN_SECRET:?set ADMIN_SECRET in .env}
      - --disable-admin-header-auth=true
      - --jwt-type=HS256
      - --jwt-secret=${JWT_SECRET:?set JWT_SECRET in .env}
      - --encryption-key=${ENCRYPTION_KEY:?set ENCRYPTION_KEY in .env}
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

networks:
  default:
    ipam:
      config:
        - subnet: 172.30.110.0/24
          gateway: 172.30.110.1

volumes:
  postgres_data:
  redis_data:

The six secrets go in the .env file next to it. Create it readable by root only, then start the stack:

Terminal, in /opt/authorizer
umask 077
printf 'POSTGRES_PASSWORD=%s\nCLIENT_ID=%s\nCLIENT_SECRET=%s\nADMIN_SECRET=%s\nJWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 24)" "$(openssl rand -hex 16)" "$(openssl rand -hex 32)" "$(openssl rand -hex 24)" "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
umask 022
docker compose up -d
docker compose ps

On its first start, Authorizer creates its tables in PostgreSQL, those of the embedded OpenFGA engine included. The image has its own health check, which turned the container “healthy” about 30 seconds after it started on our test VPS. To check it:

Terminal, in /opt/authorizer
docker compose logs authorizer | grep -E 'Starting (HTTP|gRPC|metrics) server'
curl -s http://127.0.0.1:8110/healthz
curl -s http://127.0.0.1:8110/readyz

The logs show the three listeners, the two endpoints answer {"status":"ok"} and {"status":"ready"}.

HTTPS: the reverse proxy

The container serves Authorizer over HTTP, on port 8110 of the server. HTTPS is handled by a reverse proxy in front of it. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, and sets X-Forwarded-For by default.

/etc/caddy/Caddyfile
authorizer.example.com {
	reverse_proxy 127.0.0.1:8110
}
Terminal
sudo systemctl reload caddy

Then check that the dashboard, the login page and the OpenID Connect discovery answer on your address:

Terminal
curl -s -D - -o /dev/null https://authorizer.example.com/dashboard/ | grep -i -E '^HTTP|^via|^content-type|^strict'
curl -s https://authorizer.example.com/dashboard/ | grep -o -E '<title>[^<]*</title>'
curl -s https://authorizer.example.com/app/ | grep -o -E '<title>[^<]*</title>'
curl -s https://authorizer.example.com/.well-known/openid-configuration | grep -o -E '"issuer":"[^"]*"|"token_endpoint":"[^"]*"'

The dashboard, a first user and the API

Open /dashboard on your address and sign in with the ADMIN_SECRET of your .env file. The dashboard manages users, webhooks, email templates and audit logs; the configuration itself stays in the flags of compose.yaml. The same admin API answers from the terminal, through an admin session kept in a cookie file:

Terminal
umask 077
ADMIN_SECRET=$(grep ^ADMIN_SECRET= /opt/authorizer/.env | cut -d= -f2)
curl -s -c admin.txt https://authorizer.example.com/graphql -H 'Content-Type: application/json' -H 'Origin: https://authorizer.example.com' -d '{"query":"mutation { _admin_login(params: {admin_secret: \"'"$ADMIN_SECRET"'\"}) { message } }"}'; echo
curl -s -b admin.txt https://authorizer.example.com/graphql -H 'Content-Type: application/json' -H 'Origin: https://authorizer.example.com' -d '{"query":"{ _users { pagination { total } users { email signup_methods } } }"}'; echo
rm admin.txt

The first command answers “admin logged in successfully”, the second lists the users. On our test VPS, a wrong secret was refused with “invalid admin secret”, the admin secret sent as a header was refused with “unauthorized”, and a request from an origin outside --allowed-origins was refused with “Origin not allowed”.

A first user

Sign-up is open by default. Your apps usually go through the login page at /app or an SDK; the GraphQL API shows what happens underneath. Multi-factor authentication is on by default and offered once to every new user: the sign-up returns “Proceed to mfa setup” and withholds the token, together with a short-lived mfa_session cookie. Here the user declines the offer with skip_mfa_setup, which issues the token:

Terminal
umask 077
curl -s -c mfa.txt https://authorizer.example.com/graphql -H 'Content-Type: application/json' -H 'Origin: https://authorizer.example.com' -d '{"query":"mutation { signup(params: {email: \"alice@example.com\", password: \"Correct-Horse-42\", confirm_password: \"Correct-Horse-42\", given_name: \"Alice\"}) { message } }"}'; echo
curl -s -b mfa.txt https://authorizer.example.com/graphql -H 'Content-Type: application/json' -H 'Origin: https://authorizer.example.com' -d '{"query":"mutation { skip_mfa_setup(params: {email: \"alice@example.com\"}) { message access_token } }"}' | grep -o -E '"message":"[^"]*"|"access_token":"[^.]*'
rm mfa.txt

Strong passwords are required by default: 6 to 36 characters, with upper and lower case letters, a digit and a special character. Once the offer is declined, the user signs in with a single call, and the token opens the profile:

Terminal
TOKEN=$(curl -s https://authorizer.example.com/graphql -H 'Content-Type: application/json' -H 'Origin: https://authorizer.example.com' -d '{"query":"mutation { login(params: {email: \"alice@example.com\", password: \"Correct-Horse-42\"}) { message access_token } }"}' | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
echo "token: ${TOKEN:0:20}... (${#TOKEN} characters)"
curl -s https://authorizer.example.com/graphql -H 'Content-Type: application/json' -H 'Origin: https://authorizer.example.com' -H "Authorization: Bearer $TOKEN" -d '{"query":"{ profile { email given_name roles } }"}'; echo

On our test VPS, the login returned a token of 625 characters, valid for 30 minutes, and the profile answered with the email, the first name and the user role. A wrong password was refused with “invalid credentials”.

Emails

Email verification is off by default, which is why the account above could sign in at once. To turn it on, add --smtp-host, --smtp-port, --smtp-username, --smtp-password and --smtp-sender-email to the flags, then --enable-email-verification=true: since 2.4.0, the server refuses to start with verification on and no SMTP. On a Simafri VPS, applications send through an authenticated SMTP relay on port 587, which also gives your email the best deliverability. We did not test sending email on our VPS.

Backups

Everything Authorizer keeps lives in the PostgreSQL database: users, clients, roles, webhooks, audit logs and the OpenFGA data. Redis holds only sessions, which users recreate by signing in. The other thing to keep is the configuration: compose.yaml and .env, whose JWT_SECRET and ENCRYPTION_KEY must come back with the database. Under umask 077, the dump and the archive are readable by root only:

Terminal, in /opt/authorizer
(
  umask 077
  docker compose exec -T postgres pg_dump -U authorizer -Fc authorizer > authorizer-$(date +%F).dump
  tar -czf config-$(date +%F).tar.gz compose.yaml .env
  chmod 600 authorizer-*.dump config-*.tar.gz
)
ls -l authorizer-*.dump config-*.tar.gz

The chmod also covers a dump written earlier the same day, which keeps its old permissions when it is overwritten. Schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.

Restoring

On the same or a new installation, with the same compose.yaml and .env, stop Authorizer, replace the database with an empty one, load the dump into it, then start Authorizer again:

Terminal, in /opt/authorizer
docker compose stop authorizer &&
docker compose exec -T postgres dropdb -U authorizer authorizer &&
docker compose exec -T postgres createdb -U authorizer authorizer &&
docker compose exec -T postgres pg_restore -U authorizer -d authorizer --exit-on-error --no-owner < authorizer-2026-11-29.dump &&
docker compose start authorizer

We tested the whole cycle on our VPS with these exact commands: dump, a user created after it, the database deleted and created again empty (“Did not find any tables”), restore. The user of the dump signed in again with her password, the one created after the dump was gone, and the admin API listed one user.

Updates

Authorizer releases often, security fixes included: 2.4.8, 2.4.9 and 2.4.10 came out on 24, 26 and 27 November 2026, and their release notes say who should upgrade and what changes. Read them, take a backup, change the image tag in compose.yaml, then pull the new image and recreate the container. The schema is migrated at startup:

Terminal, in /opt/authorizer
docker compose pull
docker compose up -d

Then check the version the server reports:

Terminal
curl -s https://authorizer.example.com/graphql -H 'Content-Type: application/json' -H 'Origin: https://authorizer.example.com' -d '{"query":"{ meta { version } }"}'; echo

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; Authorizer remains your software, with your users and your settings.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callYour users, clients and roles in Authorizer
AuthorizerProactive monitoring: errors, slowdowns, database and disk space spotted, fix recommendedIts installation, updates, flags and secrets, which you apply, yourself or through your AI assistant
UsersThe server that carries them, monitored and backed upAccounts, sign-up, multi-factor authentication and social logins
BackupsEvery night, encrypted and kept off the machine; restores includedAuthorizer’s own database dumps, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

Authorizer, on a server run for you

With a Simafri Managed VPS, our teams keep your Authorizer instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is Authorizer free?

Yes. Authorizer is under the Apache-2.0 license: you can run it for your company, your products or your clients, and modify it, with no license to buy. What remains is the cost of the server that runs it.

How do I install Authorizer with Docker Compose?

Use the quay.io/authorizer/authorizer image with PostgreSQL 18 and Redis 8 in a compose.yaml. Pass the configuration as flags in the command of the service, with the secrets substituted from a .env file, set --url to your https address, publish port 8110 on 127.0.0.1, run docker compose up -d, and put an HTTPS reverse proxy in front.

Why does Authorizer ignore my environment variables?

Since version 2, the server reads its configuration from command-line flags only, never from .env or the environment. In Docker Compose, write the flags in the command list and let Compose substitute the values of your .env file; MIGRATION.md maps every old variable to its flag.

Why does the sign-up return no access token?

Multi-factor authentication is offered to every new user by default: the response says “Proceed to mfa setup” and sets an mfa_session cookie. The user then enrolls a factor, or declines with the skip_mfa_setup mutation, which issues the token. With --enforce-mfa, declining is not possible.

Why do my requests fail with csrf_validation_failed?

Every state-changing request needs an Origin or Referer header, and with an explicit --allowed-origins list, that origin must be in it. List the address of Authorizer itself, for its dashboard and login page, and the address of each of your apps.

How much memory does Authorizer need?

Very little. On our test VPS, Authorizer used about 50 MB, PostgreSQL 57 MB and Redis 19 MB after the installation, and the three images take about 260 MB of disk.

How do I back up Authorizer?

Dump the PostgreSQL database with pg_dump -Fc under umask 077, and keep compose.yaml and .env, whose JWT and encryption keys must come back with the data. To restore, stop Authorizer, recreate the database empty with dropdb and createdb, then load the dump with pg_restore --exit-on-error --no-owner.

Does a managed VPS cover Authorizer?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us