Table of contents
- Installation & Deployment Guide
- Option A: the official install script
- Option B: manual bare-metal / VM install
- 1. Install the binary
- 2. Run first-time setup (as root)
- 3. Set up TLS certificates
- 4. Configure
- 5. Start it
- Running as a systemd service
- Option C: Docker
- Multi-instance / cluster deployment
- Post-install checklist
- See also
Installation & Deployment Guide
This page walks through getting ProxyAuth running from scratch, on both bare-metal/VM and Docker. It ties together the CLI Reference, config.json Reference, and TLS & Certificates pages into one end-to-end walkthrough.
Option A: the official install script
The fastest path on a fresh Linux box - handles distro detection, dependencies, Rust, building, proxyauth prepare, certificates, and service setup, all in one command:
# Latest stable release
curl -fsSL https://proxyauth.app/sh/install | bash
# Latest beta release
curl -fsSL https://proxyauth.app/sh/beta-install | bash
# A specific version
curl -fsSL https://proxyauth.app/sh/install@0.8.13 | bash
What it actually does
Based on the scripts as they exist today, every channel follows the same overall sequence:
- Detect the Linux distribution (Alpine, Debian, Arch, Fedora) and install the matching build dependencies (
openssl, a C toolchain,pkgconf,curl) via the distro's native package manager. - Install Rust via
rustupifcargoisn't already present, or reuse the existing toolchain if it is. - Download a source tarball from
crates.proxyauth.appand verify its SHA-256 checksum before doing anything with it. - Build and install with
cargo install --path ... --root /usr/local --locked --force --no-track- the same manual build command described in Option B below, just automated. - Run
proxyauth prepare- creates theproxyauthsystem user/group and/etc/proxyauth,/opt/proxyauth/dbwith correct ownership (see CLI Reference). - Generate a self-signed certificate at
/etc/proxyauth/certs/{cert,key}.pemif one doesn't already exist (valid 7300 days / 20 years - noticeably longer-lived than the 1-day cert baked into the Docker image described in Option C below), and create/etc/proxyauth/certs/routesalongside it (a per-route certificate directory, presumably for thecert:field used for mTLS to a backend - see routes.yml Reference). - Set up logging and the service unit. Creates
/var/log/proxyauth, then detects the init system:- systemd -> writes and enables
/etc/systemd/system/proxyauth.service. - OpenRC -> writes and enables
/etc/init.d/proxyauth. - Container environment (detected via
/.dockerenvor/proc/1/cgroup) -> skips service setup entirely, since a container's own entrypoint/orchestrator handles process supervision instead.
- systemd -> writes and enables
Differences between channels
install (stable) |
beta-install |
install@<version> |
|
|---|---|---|---|
| Source URL | .../downloads/latest/proxyauth |
.../downloads/latest-beta/proxyauth |
.../downloads/version/proxyauth/<version> |
| Progress display | Animated progress bar | Animated progress bar | Plain echo logging, no progress bar |
| Root handling | sudo -i |
Re-exec check: refuses and exits if not already root | sudo -i |
| systemd unit extras | - | LimitNOFILE=1048576, logs redirected to /var/log/proxyauth/proxyauth.{log,err} |
No LimitNOFILE override, no log file redirection (falls back to the journal) |
Two things worth knowing if you're relying on these scripts:
- The stable
installscript's checksum step currently points at the beta hash file - it downloads from.../latest/proxyauthbut verifies the checksum against.../latest-beta/proxyauth/hash, and its error message even says"Error download beta version"on failure. Whether this is an intentional shared-hash setup or a leftover from the beta script, it's worth being aware of if you're checksum-pinning against this specific behavior. - Both
installandinstall@<version>invokesudo -iwithout a following command, which starts an interactive root login shell rather than simply elevating the rest of the script. Depending on your terminal/stdin setup when piping throughcurl | bash, this can behave differently than the more explicit "re-exec as root or exit" pattern used inbeta-install. If an install seems to hang or drop you into an unexpected shell, this is the likely cause - running the script withsudo bashdirectly (rather than relying on the script's own internalsudo -i) sidesteps it.
None of this is a security problem in itself - the checksum verification still runs either way, and the "worse case" for the sudo -i point is an unexpected interactive prompt, not a bypassed check - but both are worth knowing if a scripted/unattended install behaves unexpectedly.
The install@<version> pattern is what makes pinning to an exact release straightforward - useful for reproducible deployments, rolling back after a bad upgrade, or matching a specific version across a multi-instance cluster (see SSO Across Multiple Instances, where running mismatched versions across instances is exactly the kind of thing you'd want to avoid or do deliberately).
As with any curl | bash install pattern, review the script before piping it to a shell if that's a concern for your environment - the manual steps below achieve the same end state without it.
Option B: manual bare-metal / VM install
1. Install the binary
cargo install proxyauth --locked
(Or use your distro/package manager if a package is available - check the project's release page.)
2. Run first-time setup (as root)
sudo proxyauth prepare
This creates the proxyauth system user, and /etc/proxyauth (config) and /opt/proxyauth/db (LMDB revocation store) with correct ownership/permissions. See CLI Reference for exactly what this does.
3. Set up TLS certificates
mkdir -p /etc/proxyauth/certs
# Self-signed, for testing:
openssl req -x509 -newkey rsa:2048 -sha256 -days 365 -nodes \
-keyout /etc/proxyauth/certs/key.pem \
-out /etc/proxyauth/certs/cert.pem \
-subj "/CN=localhost"
chown -R proxyauth:proxyauth /etc/proxyauth/certs
For a real deployment, replace with a CA-issued certificate (Let's Encrypt, etc.) at the same paths — or let ProxyAuth obtain and renew one itself, see Automatic Certificate Renewal (ACME). See TLS & Certificates for general renewal/hot-reload behavior. If you're terminating TLS upstream instead, set "tls": false in config.json and skip this step.
4. Configure
Either let ProxyAuth auto-download a starter config on first run (it fetches a default config.json/routes.yml automatically if neither file exists at /etc/proxyauth/config/), or write your own before starting the service - see the config.json Reference and routes.yml Reference for every option.
At minimum, set a strong, unique secret (64+ characters) and your first admin user in config.json before exposing the service to real traffic.
5. Start it
proxyauth
(Or install it as a systemd service - see below.)
Running as a systemd service
# /etc/systemd/system/proxyauth.service
[Unit]
Description=ProxyAuth
After=network.target
[Service]
ExecStart=/usr/local/bin/proxyauth
Restart=on-failure
RestartSec=2
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable --now proxyauth
ProxyAuth switches to the proxyauth user internally on startup - you can (and should) run the systemd unit itself starting as root, and it will drop privileges automatically. Don't set User=proxyauth in the unit file, since prepare and the startup sequence expect to start privileged and self-demote.
Note: the install script's own generated unit (see Option A above) additionally sets
Environment=RUST_LOG=info,LimitNOFILE=1048576, and redirects stdout/stderr to/var/log/proxyauth/proxyauth.{log,err}instead of the journal - consider adding these yourself if writing the unit by hand.
Option C: Docker
There's an official, ready-to-use Docker setup at git.proxyauth.app/ProxyAuth/Docker - this is the recommended way to run ProxyAuth in Docker rather than writing your own Dockerfile from scratch. The repo provides three pre-built configurations as separate folders:
| Folder | Purpose |
|---|---|
latest |
Latest stable release |
beta |
Latest beta release |
cluster |
Multi-instance deployment (see Multi-instance / cluster deployment below) |
git clone https://git.proxyauth.app/ProxyAuth/Docker ProxyAuth
cd ProxyAuth/latest # or ProxyAuth/beta for the beta channel
# Optional: fix ownership if you hit a permission error after launch
# (the container runs as uid/gid 1000)
sudo chown 1000:1000 config/config.json config/routes.yml
docker compose build && docker compose up -d
Swap cd ProxyAuth/latest for cd ProxyAuth/beta to track the beta channel instead - same commands otherwise.
Rolling your own image
If you'd rather build a custom image yourself instead of using the official repo (e.g. to change base image, add extra tooling, or integrate into an existing multi-stage build), here's the equivalent Dockerfile the official image is based on:
FROM rust:alpine
RUN apk add --no-cache openssl openssl-libs-static openssl-dev musl-dev build-base pkgconf alpine-sdk sudo nettle-dev
RUN addgroup -g 1000 proxyauth && adduser -D -u 1000 -G proxyauth -h /home/proxyauth proxyauth
RUN cargo install proxyauth --root /usr/local -j $(($(nproc) - 1)) --locked
RUN mkdir -p /etc/proxyauth/config /etc/proxyauth/certs && \
openssl req -x509 -newkey rsa:2048 -sha256 -days 1 -nodes \
-keyout /etc/proxyauth/certs/key.pem \
-out /etc/proxyauth/certs/cert.pem \
-subj "/CN=localhost" && \
chown -R proxyauth:proxyauth /etc/proxyauth
RUN proxyauth prepare
USER proxyauth
EXPOSE 8080
CMD ["/usr/local/bin/proxyauth"]
Note the uid/gid 1000 for the proxyauth user, matching the ownership fix command shown above for the official repo - keep this consistent if your own volumes/host files need to match it.
The stock image bakes in a 1-day self-signed certificate - fine for quick local testing, but replace it (mount your own cert/key, or terminate TLS upstream and set "tls": false) for anything longer-lived.
docker-compose
Pairs with the custom Dockerfile above if you're building your own image rather than using the official repo's pre-built docker-compose.yml (not inspected for this page - check the repo directly for its exact setup):
services:
proxyauth:
build: .
ports:
- "8080:8080"
volumes:
- ./config/config.json:/etc/proxyauth/config/config.json
- ./config/routes.yml:/etc/proxyauth/config/routes.yml
- ./certs:/etc/proxyauth/certs
- proxyauth-db:/opt/proxyauth/db
restart: unless-stopped
volumes:
proxyauth-db:
Mount config.json/routes.yml from the host so they survive image rebuilds, and give /opt/proxyauth/db a named volume so revoked-token state (LMDB) survives container recreation - otherwise every container restart loses local revocation history (tokens revoked before the restart become valid again, since there's no persisted record of them).
Earlier versions of this project's own examples used
/app/config/...as the in-container config path - the application itself always reads from/etc/proxyauth/config/config.json/routes.yml, so make sure your volume mounts target that path, not/app/....
Multi-instance / cluster deployment
If you're running more than one instance behind a load balancer:
If deploying via Docker, the official Docker repo has a dedicated cluster folder alongside latest/beta (see Option C above) - worth checking as a starting point before assembling your own multi-instance compose setup from scratch.
- Use the same
secretinconfig.jsonon every instance. Required regardless of everything else below - it's what token/CSRF signing derives from. - Run
proxyauth sync exporton one instance, and import the result on every other instance, so tokens issued by one instance validate on the others. Otherwise, a session won't survive a client being routed to a different backend instance. See SSO Across Multiple Instances. - Configure
redisinconfig.jsonon every instance, pointing at a shared Redis, if you want token revocation (/adm/revoke) to propagate across instances automatically. Without it, each instance's revocation list is local-only. See Token Revocation & Multi-Instance Sync. - Set
trust_proxy_forward_forto your load balancer's IP(s), or client-IP-based rate limiting and access control (allowlists) will see the load balancer's IP instead of real client IPs. See config.json Reference. - Re-run step 2 (
sync export/import) after any redeploy where instances are rebuilt independently - see the caveat in SSO Across Multiple Instances. - If installing via the official script across a cluster, use the
install@<version>form on every instance with the same pinned version, so a rebuild on one instance doesn't drift onto a newer release than the others.
Sharing users across instances
By default, users in config.json is hand-edited per instance - fine for one node, tedious for ten. Two options, pick whichever fits your infrastructure:
- Shared database (
databasesinconfig.json). Point every instance at the same PostgreSQL or MySQL/MariaDB instance and they all read/write the same user base, refreshed periodically without a restart. See Database-Backed Users. This is the more capable option if a database is already available in your environment. - Shared
config.jsonover NFS (or any shared filesystem), if a database isn't an option. Mount the same file at/etc/proxyauth/config/config.jsonon every instance instead of maintaining separate copies - every instance reads the sameusersarray at startup. Simpler to set up than a database, but changes still need a restart on each instance to take effect (no live-refresh, unlike the database-backed option), and you lose per-instance config divergence if you ever needed it.
Neither is required - each instance works fully standalone with its own local users by default.
Post-install checklist
secretis long (64+ chars), random, and unique to this environment.token_adminis set and treated as a root-equivalent credential.config.jsonfile permissions are restrictive (it contains plaintext secrets - see config.json Reference).- TLS is either terminated by ProxyAuth with a real certificate, or explicitly disabled because it's terminated upstream - never left on the default self-signed cert in production.
trust_proxy_forward_foris configured if (and only if) you're behind a load balancer/reverse proxy.- Rate limits (
ratelimit_authespecially) are set to non-zero values - see Rate Limiting. - If multi-instance:
secretmatches everywhere,sync export/import has been done, andredisis configured if you need cross-instance revocation. Considerdatabasesor a sharedconfig.jsonover NFS if you also want a shared user base — see Sharing users across instances above. /opt/proxyauth/dbis on persistent storage (not an ephemeral container filesystem).- The subdirectories ProxyAuth creates under
/opt/proxyauth/db—password_reset/(single-use reset tokens) and the database fallback cache directory (mirrors password hashes) — are set to0700automatically at startup; no manual action needed, but worth knowing if you're auditing filesystem permissions on this host. - If using native Let's Encrypt renewal (
certbot_renew: trueanywhere inroutes.yml): port 80 is open to the public internet at the firewall/router/security-group level — ProxyAuth answers on it automatically, but can't do anything about a port blocked further upstream. See Automatic Certificate Renewal (ACME) § The HTTP-01 listener on port 80.
See also
📖 Wiki Home · 💻 Source Code · 🐛 Report an Issue · 📜 License
Found an error or something outdated on this page? Open an issue or submit a PR against the wiki repository.