Deploy Langflow
Build AI workflows with Langflow, private Postgres and persistent storage.
Langflow
Just deployed
/app/langflow
Just deployed
/var/lib/postgresql/data
Deploy and Host Langflow on Railway
A visual AI workflow editor with Langflow 1.12.0, private PostgreSQL 17, persistent uploads, and generated administrator credentials. Creating and saving flows does not require an LLM provider key; real model execution requires a configured provider and its credentials.
About Hosting Langflow
The app serves HTTPS through Railway to container port 7860. PostgreSQL is private on port 5432 with no public TCP proxy. Use one Langflow replica. The app healthcheck is /health_check, with a 300-second startup allowance; allow sufficient memory, roughly 2–4 GB for the app alone as a starting point.
Deploy and log in
- Deploy both services with their volumes attached and allow initial database setup to finish.
- In the Langflow service's Variables tab, retrieve
LANGFLOW_SUPERUSER_PASSWORD. Sign in asadmin, unless you deliberately changedLANGFLOW_SUPERUSER. - Open your Railway HTTPS domain. Create a blank flow, add components, save, and reload it.
- Add provider credentials through the authenticated UI only when needed, then verify an actual flow execution. A saved canvas or healthy process is not proof that components or models execute successfully. Browser rejection of an incorrect administrator password and successful valid login were verified. Keyless Playground execution remains unverified; real provider-backed inference was not tested.
Authentication and secrets
LANGFLOW_AUTO_LOGIN=falseandLANGFLOW_ENABLE_SIGNUP=false; do not enable automatic login on a public editor. New-user activation is disabled by default.- Access/refresh cookies are marked Secure for HTTPS, and webhook authentication is enabled. Only give accounts to trusted users: flow components can execute code and access configured resources.
LANGFLOW_SUPERUSER_PASSWORDis generated independently ofLANGFLOW_SECRET_KEY. There is no shared default administrator password.LANGFLOW_SECRET_KEYis generated as canonical URL-safe Base64 encoding of 32 bytes, 44 characters ending in=. Do not replace it with a generic${{secret()}}string. Keep it stable with the database and volume; changing it can make encrypted stored values unreadable.LANGFLOW_DATABASE_URL=${{Postgres.DATABASE_URL}}uses the private database. Preserve generated database credentials and reference expressions.
Storage and upgrades
| Service | Mount | Contents |
|---|---|---|
| Langflow | /app/langflow | Uploads, configuration and local cache |
| Postgres | /var/lib/postgresql/data | Accounts, flows and application metadata |
LANGFLOW_CONFIG_DIR matches the app mount; PostgreSQL uses the pgdata subdirectory. Startup fixes the app mount's ownership/mode and drops to UID 1000 before running the editor. Back up the database, uploads, and encryption secret together. Do not scale multiple writers against this single-volume setup.
PostgreSQL 17 is for fresh installations. Never attach an existing PostgreSQL 18 data directory to the PostgreSQL 17 image. Existing users need backups and a separately tested logical migration before a database-major change. Test restored flows, uploaded files, encrypted credentials, and execution after changes; neither backups nor upgrades are certified by a startup healthcheck.
Common Use Cases
- Designing and saving visual AI workflows.
- Prototyping integrations with your own model provider.
- A personal or trusted-team workflow editor with private database storage.
Dependencies for Langflow Hosting
Langflow, private PostgreSQL, two persistent volumes, HTTPS, and generated credentials. Provider keys and any external tools/data sources are additional requirements for flows that use them. No real model execution is claimed without those credentials.
Deployment Dependencies
- Langflow 1.12.0 source.
- Langflow documentation.
langflowai/langflow:1.12.0andghcr.io/railwayapp-templates/postgres-ssl:17. These are version tags, not claims that every image is digest-pinned.
Why Deploy Langflow on Railway?
Railway connects the editor to a private database, provisions HTTPS, and mounts storage. You control access, model credentials, resource sizing, and backup/upgrade procedures.
Template Content
