Deploy Keygen

Keygen CE 1.7: software licensing and license-key validation API.

Deploy Keygen

/var/lib/postgresql/data

Just deployed

keygen-worker

keygen/api:v1.7.2

Just deployed

Just deployed

/data

Deploy and Host Keygen on Railway

Keygen is a software licensing and distribution API. It issues license keys, validates them, tracks machine activations and enforces policies such as expiry, seats and feature entitlements. Desktop apps, on-premise software, plugins and SaaS add-ons call it to check whether a customer's license is valid. Keygen CE is the free self-hosted edition.

About Hosting Keygen

This template runs Keygen CE keygen/api:v1.7.2 as a web service and a Sidekiq worker, with Railway Postgres and Redis. On the first deploy, a pre-deploy step runs Keygen's setup, which creates the account and an admin user. Later deploys only run migrations. The pre-deploy step also waits for the database. Setup output is filtered so that secrets stay out of the logs. The admin email defaults to admin@example.com, and the password is generated. CE is API-only, without a dashboard. Keygen is published under the Fair Core License, which is source-available rather than open source.

Common Use Cases

  • License keys and activation limits for desktop or on-premise software
  • Feature entitlements and trials checked by your app at runtime
  • Offline license files and machine fingerprinting for air-gapped installs

Dependencies for Keygen Hosting

  • keygen/api:v1.7.2 (Keygen CE), as keygen and keygen-worker
  • Railway Postgres and Railway Redis

Deployment Dependencies

Implementation Details

ServiceSourceNetworkingStorage
keygenkeygen/api:v1.7.2 (web)public HTTPSPostgres + Redis
keygen-workerkeygen/api:v1.7.2 (Sidekiq)privatePostgres + Redis
Postgres, RedisRailway databasesprivatevolumes
VariablePurpose
KEYGEN_ACCOUNT_IDGenerated account ID; part of every API path
KEYGEN_ADMIN_EMAIL, KEYGEN_ADMIN_PASSWORDFirst admin, created by setup
KEYGEN_HOSTPublic domain; change it if you add a custom domain
SECRET_KEY_BASE, ENCRYPTION_*Generated keys; keep them, they protect data at rest

Validate a key (no auth needed):

curl -XPOST "$KEYGEN_URL/v1/accounts/$KEYGEN_ACCOUNT_ID/licenses/actions/validate-key" \
  -H 'Content-Type: application/vnd.api+json' -d '{"meta":{"key":""}}'

Change KEYGEN_ADMIN_EMAIL before the first deploy if you want your own address; setup only runs once. Under the FCL, you may self-host Keygen for your own products, but you may not offer it as a competing licensing service.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by Keygen LLC.

Why Deploy Keygen on Railway?

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 Keygen 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.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
47
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51