Self-host OAuth2 Proxy with Levelrail

Reverse proxy that puts an OAuth2 or OIDC login in front of any upstream. The install form carries oauth2-proxy.cfg as an editable file with a generated cookie secret, so it starts without extra flags.

How to self-host OAuth2 Proxy

  1. Pull the images

    One image is pulled on your server.

    Show images
    • quay.io/oauth2-proxy/oauth2-proxy:v7.15.6
  2. Create the app

    One service starts in a single Compose app, on port 4180.

  3. Fill in the secrets

    You do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

After the first start

  • Set the client id and client secret from your identity provider, then edit the config file setting to change the provider and the upstream. Open the address followed by /ping to confirm it is up.

OAuth2 Proxy requirements

Memory
About 64 MiB
Architectures
amd64 unknown, arm64 unknown
Ports
4180
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
MIT, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then OAuth2 Proxy. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the OAuth2 Proxy docs page.

Deploy OAuth2 Proxy your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy OAuth2 Proxy from the CLI

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain oauth2-proxy=app.example.com.

levelrail-cli templates install oauth2-proxy --name my-oauth2-proxy

Deploy OAuth2 Proxy with the API

Create a token in the dashboard first. Name, env and domains are the request fields.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/oauth2-proxy/install \
  -d '{
    "name": "my-oauth2-proxy"
  }'

OAuth2 Proxy configuration

OAuth2 Proxy services

ServiceImagePortsVolumes
oauth2-proxy quay.io/oauth2-proxy/oauth2-proxy:v7.15.6 4180 none

OAuth2 Proxy environment variables

The catalog lists no environment variables for this template.

Ports and volumes

Ports
4180
Volumes
none

OAuth2 Proxy FAQ

How much memory does OAuth2 Proxy need?

The catalog lists about 64 MiB of memory for OAuth2 Proxy.

Does OAuth2 Proxy run on arm64?

For OAuth2 Proxy, arm64 support is not confirmed; amd64 is unknown.

What licence is OAuth2 Proxy under?

OAuth2 Proxy is licensed under MIT, which is permissive, with few conditions on reuse.

Does OAuth2 Proxy need configuration before it starts?

No. The template fills in its own defaults.

Which ports does OAuth2 Proxy use?

OAuth2 Proxy listens on port 4180 inside the stack.

Can I deploy OAuth2 Proxy on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for OAuth2 Proxy, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image quay.io/oauth2-proxy/oauth2-proxy:v7.15.6 is what you deploy there.

levelrail-cli templates install oauth2-proxy --name my-oauth2-proxy