Deploy Tinyauth

Lightweight login server, forward-auth and OIDC provider

Deploy Tinyauth

Just deployed

/data

Deploy and Host self hosted Tinyauth (Authentication) on Railway

This template deploys Tinyauth, a small self-hosted login, forward-auth and OIDC server, as one Railway service with a persistent volume.

About Hosting Tinyauth open-source software on Railway (self hosted Tinyauth template)

This template runs one service, Tinyauth, built from the unmodified upstream binary and packaged by an independent community maintainer.

This is independent community packaging of tinyauthapp/tinyauth v5.2.0. It is not affiliated with or endorsed by Tinyauth.

Why Deploy Tinyauth, the self-hosted login, forward-auth and OIDC server on Railway

Tinyauth runs as one small container, so you get login, forward-auth and an OIDC provider without operating a heavier identity platform.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Tinyauth on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

Railway vs Other Hosting Providers and VPS for Tinyauth self hosting

Running Tinyauth yourself means choosing between a managed platform and a general cloud or VPS.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanA one-click template with the Tinyauth service, /data volume, public HTTPS domain and health check already wired.A droplet you manage, including the OS, Docker, TLS and backups.
AWSA single service with a persistent volume and a public domain.Broad control over networking and storage, with more setup to maintain.
HetznerManaged deployment from the template, with no server provisioning and one replica for local state.Low-cost servers where you install and update Tinyauth and its proxy by hand.

Pick the platform that matches how much of the server you want to manage.

Common Use Cases for hosted Tinyauth

  • A single login page for a small homelab: Sign in as admin with TINYAUTH_ADMIN_PASSWORD, then add more local users when you need them.
  • Optional TOTP for stronger sign-ins: Turn on one-time codes so a stolen password alone is not enough.
  • OAuth sign-in with existing accounts: Let people log in with providers such as GitHub or Google, and limit access with a whitelist.
  • Forward-auth in front of your apps: Put Tinyauth behind Traefik, Caddy or Nginx so each protected app checks the session first. Sessions shared across subdomains need a custom domain with TINYAUTH_AUTH_SUBDOMAINSENABLED=true.
  • An OIDC provider for other apps: Once you add at least one client with TINYAUTH_OIDC_CLIENTS variables, your other apps can use Tinyauth as their OpenID Connect sign-in provider.

Dependencies for Tinyauth Docker hosted on Railway

This template runs Tinyauth as a single service with zero inputs. Keep one replica, because session state and signing keys live on the volume.

Deployment Dependencies for Managed Tinyauth Service

The template deploys one public Tinyauth service on port 8080, with a volume at /data for the SQLite session database, OIDC signing keys and resources. The health check is /api/healthz with a 120 second timeout, and the restart policy is Always.

Implementation Details for Tinyauth

The image is ghcr.io/onepush-dev/tinyauth:v5.2.0, the unmodified upstream ghcr.io/tinyauthapp/tinyauth:v5.2.0 binary plus railway/start.sh. The wrapper fills TINYAUTH_APPURL from the Railway domain when it is empty. When TINYAUTH_AUTH_USERS and TINYAUTH_AUTH_USERSFILE are empty, it hashes TINYAUTH_ADMIN_USERNAME (admin) and TINYAUTH_ADMIN_PASSWORD with tinyauth user create, unsets the plaintext password, and starts tinyauth. Baked values include TINYAUTH_SERVER_PORT=8080, TINYAUTH_AUTH_SECURECOOKIE=true, TINYAUTH_AUTH_SUBDOMAINSENABLED=false, TINYAUTH_LABELPROVIDER=none and TINYAUTH_ADMIN_USERNAME=admin. Subdomain cookies stay off because the default Railway domain is a public suffix; enable them only on a custom domain with TINYAUTH_APPURL set to it. OIDC endpoints stay not ready until you add at least one client, for example TINYAUTH_OIDC_CLIENTS_MYAPP_CLIENTID and the matching secret, redirect and name variables.

Two template variables are generated or referenced, with no inputs:

  • TINYAUTH_APPURL defaults to the Railway HTTPS domain. Change it if you add a custom domain.
  • TINYAUTH_ADMIN_PASSWORD is hashed at boot for the first user, admin. Setting TINYAUTH_AUTH_USERS later replaces that generated admin.

How does Tinyauth compare against other tools

Tinyauth vs a heavier identity platform (Tinyauth Alternative)

  • Footprint: Tinyauth is one small Go server with a SQLite database on a volume. Heavier platforms usually bring more services and configuration, which suits larger teams.
  • Breadth: Heavier platforms generally cover more protocols and directory integrations. Tinyauth covers local users, TOTP, OAuth, LDAP, forward-auth and an OIDC provider.
  • Setup: The Railway template creates the admin user from a generated password, so sign-in takes minutes.

Tinyauth vs a local Docker install of Tinyauth (Tinyauth Docker Alternative)

  • Same software: This template runs the unmodified upstream binary, so behavior matches a local install of the same release. It is independent community packaging, not affiliated with or endorsed by Tinyauth.
  • Ops ownership: A local install gives full host control, but you maintain backups yourself. On Railway you still manage the /data volume, keep one replica, and only enable subdomain cookies on a custom domain.

Tinyauth with Docker vs Railway (Tinyauth Docker vs Railway)

  • Control: Docker on your own machine or VPS gives full control of networking and updates. Railway gives a managed build and deploy flow with the health check at /api/healthz and restart policy Always.
  • Setup: Docker needs you to write the compose file and manage TLS yourself. The Railway template fills the app URL and generates the admin password.
  • Limits: OIDC endpoints stay not ready until you add at least one client with TINYAUTH_OIDC_CLIENTS variables.

How to use Tinyauth on Railway?

  1. Open the public Railway domain for your Tinyauth service in a browser.
  2. Sign in as admin using the value of TINYAUTH_ADMIN_PASSWORD, which you can find in the service's Variables tab. Admin/admin is not a default login.
  3. For an OIDC provider used by other apps, add at least one set of TINYAUTH_OIDC_CLIENTS variables (client id, secret, trusted redirect URIs and name). OIDC endpoints are not ready until at least one client exists.
  4. Point the app at your Railway domain plus /.well-known/openid-configuration.
  5. For forward-auth across subdomains, add a custom domain, set TINYAUTH_APPURL to it, and set TINYAUTH_AUTH_SUBDOMAINSENABLED=true. Update TINYAUTH_APPURL whenever you add or change a custom domain.
  6. Keep the service at one replica. The health check path is /api/healthz.

How to self host Tinyauth on other VPS Services (Tinyauth self hosting guide)

Clone the Repository

Clone the upstream project at the pinned release so your install matches what this template runs.

git clone --branch v5.2.0 https://github.com/tinyauthapp/tinyauth.git
cd tinyauth

Install Dependencies

Install Docker on your VPS and create a data directory.

mkdir -p /srv/tinyauth/data

Configure Environment Variables

Set the app URL to the public address you will serve Tinyauth from, and set an admin password you keep out of version control.

export TINYAUTH_APPURL=https://your-domain
export TINYAUTH_ADMIN_PASSWORD=choose-a-long-password

Start the Tinyauth Application

Run the upstream container or binary with the data directory mounted at /data, then create users with the documented CLI or environment variables.

docker run -d --name tinyauth -p 8080:8080 \
  -v /srv/tinyauth/data:/data \
  -e TINYAUTH_APPURL="$TINYAUTH_APPURL" \
  ghcr.io/tinyauthapp/tinyauth:v5.2.0

Railway handles the domain, TLS, volume and restarts for you.

Pricing and License of Tinyauth (Tinyauth pricing)

Tinyauth is open-source software licensed under the GNU Affero General Public License v3.0 (AGPL-3.0), and you can self-host it at no software cost.

Tinyauth hosted vs self hosted comparison (Pricing, features, costs, and more)

This template packages the AGPL-3.0 software, and the pinned v5.2.0 tree describes no hosted Tinyauth plan.

Monthly cost of self hosting Tinyauth on Railway

Railway bills on usage, so the monthly cost depends on the RAM and CPU Tinyauth uses, the size of the /data volume, and how many other services share the project.

System Requirements for Hosting Tinyauth on a VPS

Tinyauth keeps its session database and signing keys under /data, so a VPS needs a persistent disk for that path and enough memory for one container.

Frequently Asked Questions (FAQs)

How do I sign in to Tinyauth after deploying?

Sign in as admin using the password stored in TINYAUTH_ADMIN_PASSWORD, which you can copy from the service's Variables tab.

Why are subdomain cookies turned off by default?

The default Railway domain is a public suffix, so browsers will not share cookies across its subdomains. TINYAUTH_AUTH_SUBDOMAINSENABLED stays false until you use a custom domain.

When do the OIDC endpoints start working?

They are not ready until you add at least one client with TINYAUTH_OIDC_CLIENTS variables, such as TINYAUTH_OIDC_CLIENTS_MYAPP_CLIENTID.

How do I use a custom domain?

Set TINYAUTH_APPURL to your custom domain URL.

What should I back up?

Back up the /data volume, which holds the SQLite session database, OIDC signing keys and resources.


Template Content

More templates in this category

View Template
Keycloak
[2026-11-04] Keycloak with keywind theme + Apple & Discord providers

beuz
754
View Template
lua-protector
Test deployed my project first

trianaq765-cmd's Project
37
View Template
bknd
Feature-rich yet lightweight backend

10