
Deploy Unleash | (Just Updated) Feature Flag Server, REST API, Admin and SDK Tokens Ready
Unleash feature flags server with Postgres, REST API and ready SDK tokens
Just deployed
postgres
Just deployed
/var/lib/postgresql
Deploy and Host Unleash on Railway
Built for an LLM agent to deploy and use. There is no setup wizard and nothing to fill in: the admin password and three API tokens (admin, backend SDK, frontend SDK) are generated at deploy time and are valid from the first boot. The contract below lists every URL, variable name and the one script that proves it works.
Unleash is an open-source feature flag and feature toggle server: gradual rollouts, A/B tests, kill switches, targeting strategies and environments, with SDKs for most languages that poll its API. This template runs Unleash together with a PostgreSQL database.
About Hosting Unleash
This template runs two services. unleash is the official Unleash Server 8.3.1 image (unleashorg/unleash-server, pinned by digest). It is stateless: flags, projects, users and tokens all live in PostgreSQL. postgres is the official postgres:17 image (pinned by digest) with a volume at /var/lib/postgresql, reachable only on the private network. The unleash start command waits for the database, then starts the stock server with the admin user, the public URL and the three API tokens taken from the service variables, so the same values apply after every redeploy. Allow about a minute for the first deploy to turn healthy.
Agent contract
- Public URL:
https://plus theRAILWAY_PUBLIC_DOMAINof theunleashservice, used asUNLEASH_URL. It serves the admin UI at/, the admin API under/api/admin, the SDK API under/api/clientand/api/frontend. - Private URL:
http://unleash.railway.internal:8080 - Credentials: admin UI login
adminwith the password inUNLEASH_DEFAULT_ADMIN_PASSWORD; API tokens inUNLEASH_ADMIN_API_TOKEN(full admin API access),UNLEASH_BACKEND_API_TOKEN(server-side SDKs, projectdefault, environmentdevelopment) andUNLEASH_FRONTEND_API_TOKEN(client-side SDKs, same scope). - Auth: send the raw token in the
Authorizationheader with the prefix shown below, noBearer. Admin:Authorization: *:*.UNLEASH_ADMIN_API_TOKEN. Backend SDK:Authorization: default:development.UNLEASH_BACKEND_API_TOKEN. Frontend SDK: the same form withUNLEASH_FRONTEND_API_TOKEN. - Health:
GET /healthreturns 200 with{"health":"GOOD"}and no credentials
# run with UNLEASH_URL, UNLEASH_ADMIN_API_TOKEN, UNLEASH_BACKEND_API_TOKEN and UNLEASH_DEFAULT_ADMIN_PASSWORD set; needs curl
A="Authorization: *:*.$UNLEASH_ADMIN_API_TOKEN"
B="Authorization: default:development.$UNLEASH_BACKEND_API_TOKEN"
F="agent-check-$(date +%s)"
curl -s -o /dev/null -w 'health %{http_code}\n' "$UNLEASH_URL/health"
curl -s -o /dev/null -w 'anonymous %{http_code}\n' "$UNLEASH_URL/api/admin/projects"
curl -fsS -H "$A" "$UNLEASH_URL/api/admin/projects" | grep -o '"id":"default"'
curl -fsS -H "$A" -H 'Content-Type: application/json' -d "{\"name\":\"$F\",\"type\":\"release\"}" "$UNLEASH_URL/api/admin/projects/default/features" -o /dev/null -w 'create flag %{http_code}\n'
curl -fsS -H "$A" -X POST "$UNLEASH_URL/api/admin/projects/default/features/$F/environments/development/on" -o /dev/null -w 'enable flag %{http_code}\n'
curl -fsS -H "$B" "$UNLEASH_URL/api/client/features/$F" | grep -o '"enabled":true'
curl -fsS -H 'Content-Type: application/json' -d "{\"username\":\"admin\",\"password\":\"$UNLEASH_DEFAULT_ADMIN_PASSWORD\"}" "$UNLEASH_URL/auth/simple/login" -o /dev/null -w 'admin login %{http_code}\n'
A fresh deploy prints health 200, anonymous 401, "id":"default", create flag 201, enable flag 200, "enabled":true and admin login 200. Point any Unleash SDK at UNLEASH_URL/api with the backend token, or open UNLEASH_URL and sign in as admin.
Why Deploy Unleash 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 Unleash 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.
- Agent-ready - generated admin password and API tokens that work on first boot, a contract block and one working script; no default
unleash4alllogin and no setup step. - Stable credentials - the password and tokens are the same after every redeploy.
- State survives redeploys - flags, projects and users live in PostgreSQL on a volume.
- Private database - PostgreSQL has no public domain and is reached over the private network.
- Pinned images - both images are pinned by digest, so a redeploy never changes the server version underneath you.
Common Use Cases
- Gradual rollouts and kill switches - ship code dark, enable it for a percentage of users and turn it off without a deploy.
- Self-hosted LaunchDarkly alternative - feature flags, environments and targeting on infrastructure you control.
- Agent-driven release control - let an AI agent create, enable and audit flags through the admin REST API.
Dependencies for Unleash Hosting
- A PostgreSQL database (included in this template, volume at
/var/lib/postgresql).
Deployment Dependencies
- Unleash/unleash - upstream project
- Unleash documentation - SDKs, API reference and configuration
Template Content
postgres
postgres:17