Deploy Flagsmith | (Just Updated) Feature Flag Server, LaunchDarkly Alternative, Admin And SDK Keys Ready

Flagsmith feature flags and remote config API, admin and SDK keys set

Deploy Flagsmith | (Just Updated) Feature Flag Server, LaunchDarkly Alternative, Admin And SDK Keys Ready

Just deployed

Just deployed

/var/lib/postgresql

Deploy and Host Flagsmith on Railway

Built for an LLM agent to deploy and use. There is no setup wizard and nothing to fill in: the admin login, an admin API token, an environment key for client SDKs and a server key for server SDKs are generated at deploy time and are valid from the first boot. Signup and the first-visitor admin claim are closed. The contract below lists every URL, variable name and the one script that proves it works.

Flagsmith is an open-source feature flag and remote config service: gradual rollouts, segments, A/B tests, kill switches and per-environment values, with SDKs for most languages. This template runs Flagsmith (API and admin dashboard) together with a PostgreSQL database.

About Hosting Flagsmith

This template runs two services. flagsmith is the official Flagsmith 2.288.2 image (flagsmith/flagsmith, pinned by digest), serving the dashboard and the API from one container. It is stateless: flags, projects, users and keys all live in PostgreSQL. postgres is the official postgres:17-alpine image with a volume at /var/lib/postgresql, reachable only on the private network. The flagsmith start command waits for the database, runs migrations, then creates or re-applies the admin user, an organisation named Default, a project named Default and an environment named Production with the keys taken from the service variables, and starts the server. The same values apply after every redeploy. Allow about two minutes for the first deploy to turn healthy.

Agent contract

  • Public URL: https:// plus the RAILWAY_PUBLIC_DOMAIN of the flagsmith service, used as FLAGSMITH_URL. It serves the dashboard at /, the admin API under /api/v1 and the SDK API under /api/v1/flags.
  • Private URL: http://flagsmith.railway.internal:8080
  • Credentials: dashboard login with the email in FLAGSMITH_ADMIN_EMAIL and the password in FLAGSMITH_ADMIN_PASSWORD; FLAGSMITH_ADMIN_API_TOKEN (full admin API access), FLAGSMITH_ENVIRONMENT_KEY (client-side SDKs, environment Production) and FLAGSMITH_SERVER_KEY (server-side SDKs, same environment).
  • Auth: admin API, send Authorization: Token followed by the admin token. SDK API, send the header X-Environment-Key with the environment key or the server key.
  • Health: GET /health returns 200 with no credentials
# run with FLAGSMITH_URL, FLAGSMITH_ADMIN_API_TOKEN, FLAGSMITH_ENVIRONMENT_KEY, FLAGSMITH_SERVER_KEY, FLAGSMITH_ADMIN_EMAIL and FLAGSMITH_ADMIN_PASSWORD set; needs curl
A="Authorization: Token $FLAGSMITH_ADMIN_API_TOKEN"
F="agent_check_$(date +%s)"
curl -s -o /dev/null -w 'health %{http_code}\n' "$FLAGSMITH_URL/health"
curl -s -o /dev/null -w 'anonymous %{http_code}\n' "$FLAGSMITH_URL/api/v1/projects/"
P=$(curl -fsS -H "$A" "$FLAGSMITH_URL/api/v1/projects/" | sed -n 's/^\[{"id":\([0-9]*\).*/\1/p')
echo "project $P"
curl -fsS -H "$A" -H 'Content-Type: application/json' -d "{\"name\":\"$F\",\"default_enabled\":true}" "$FLAGSMITH_URL/api/v1/projects/$P/features/" -o /dev/null -w 'create flag %{http_code}\n'
curl -fsS -H "X-Environment-Key: $FLAGSMITH_ENVIRONMENT_KEY" "$FLAGSMITH_URL/api/v1/flags/" | grep -o "\"name\":\"$F\""
curl -fsS -H "X-Environment-Key: $FLAGSMITH_SERVER_KEY" "$FLAGSMITH_URL/api/v1/flags/" | grep -o '"enabled":true'
curl -fsS -H 'Content-Type: application/json' -d "{\"email\":\"$FLAGSMITH_ADMIN_EMAIL\",\"password\":\"$FLAGSMITH_ADMIN_PASSWORD\"}" "$FLAGSMITH_URL/api/v1/auth/login/" -o /dev/null -w 'admin login %{http_code}\n'

A fresh deploy prints health 200, anonymous 401, a project id, create flag 201, the flag name, "enabled":true and admin login 200. Point any Flagsmith SDK at FLAGSMITH_URL/api/v1/ with the environment key, or open FLAGSMITH_URL and sign in with the admin email and password.

Why Deploy Flagsmith 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 Flagsmith 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 login, admin API token and SDK keys that work on first boot, a contract block and one working script; no setup step.
  • Closed by default - open signup and the first-visitor admin claim are switched off, so nobody else can take the admin account of a fresh deploy.
  • Stable credentials - the password, token and keys 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, 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 segment or a percentage of users and turn it off without a deploy.
  • Self-hosted LaunchDarkly alternative - feature flags, remote config, segments and environments on infrastructure you control.
  • Agent-driven release control - let an AI agent create, enable and audit flags through the admin REST API.

Dependencies for Flagsmith Hosting

  • A PostgreSQL database (included in this template, volume at /var/lib/postgresql).

Deployment Dependencies


Template Content

More templates in this category

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

codestorm
50
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