---
title: "Deploy Langflow"
description: "Langflow: visual builder for AI agents and RAG flows, with Postgres"
category: "AI/ML"
url: https://railway.com/deploy/kit-langflow-build-0919
---

# Deploy Langflow

Langflow: visual builder for AI agents and RAG flows, with Postgres

**[Deploy Langflow on Railway](https://railway.com/template/kit-langflow-build-0919)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/kit-langflow-build-0919/manifest.json

- **Creator:** Will
- **Category:** AI/ML

## Template content

### Langflow https://bogusz.co/external/langflow-icon.png

- **Image:** langflowai/langflow:1.12.2@sha256:79c02794adebe82d756b7152ce4feebe4a5426e1faf3fe5b5d0dd08f304510c4
- **Health check:** /health_check
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17@sha256:f79fd6806f02297f206ce01258f287e4f93faea2a6a2aaaffc24fe684417f0fb

## Documentation

# Deploy and Host Langflow with Railway

Langflow is the open-source visual builder for AI agents and RAG pipelines: drag components onto a canvas, wire models, prompts, tools, vector stores and memory together, test in a built-in chat, then call the result as an API or MCP server. This template deploys the official Langflow image pinned by digest with a Postgres 17 database, a persistent volume for uploaded files and the encryption key, every secret generated for you, and a deployment healthcheck. **There is nothing to fill in.** After the deploy, open the public URL and log in as `admin` with the password in the `Langflow` service's Variables tab (`LANGFLOW_SUPERUSER_PASSWORD`).

**Plan requirements.** Measured on this exact image: Langflow idles around **1.25 GB** (measured after five idle minutes on two fresh deploys) and needs about 1.6 GB peak while it loads its component catalogue; Postgres adds about 60 MB. It is killed on a 1 GB limit (verified) and runs comfortably at 2 GB. **Hobby plan or higher (8 GB limit) is required**; it will not start on Free or Trial. Upstream's own Railway guide states the same 2 GB minimum.

## About Hosting Langflow

Langflow runs as one Python service that serves the editor, the API and flow execution. Flows, users, API keys and global variables live in Postgres; the volume at `/app/langflow` holds the encryption key that protects stored credentials, uploaded files and profile pictures. Schema migrations run automatically on start, including on upgrades. Login is required (`LANGFLOW_AUTO_LOGIN=false`) because the service is reachable on a public domain; the first account is the generated superuser, and new sign-ups stay inactive until an admin activates them. The container runs as root on Railway so it can write to the root-owned volume mount - the same approach Railway's own database templates take.

## Common Use Cases

- Prototype a RAG pipeline over your documents with OpenAI, Anthropic, Gemini, Ollama or any OpenAI-compatible endpoint
- Build a multi-tool agent visually, then expose it as a REST endpoint or MCP server for your app
- Give a non-engineering team a hosted playground with per-user logins and shared global API keys
- Evaluate prompts and models side by side in the built-in chat before committing to code
- Run scheduled or webhook-triggered flows without standing up your own orchestration

## Dependencies for Langflow Hosting

- `langflowai/langflow:1.12.2` (Docker Hub, pinned by digest)
- `ghcr.io/railwayapp-templates/postgres-ssl:17` (Railway's Postgres image, pinned by digest) on a `/var/lib/postgresql/data` volume

### Deployment Dependencies

- [Langflow documentation](https://docs.langflow.org) and the [environment variable reference](https://docs.langflow.org/environment-variables)
- [Langflow on GitHub](https://github.com/langflow-ai/langflow) (MIT)
- [Railway volumes](https://docs.railway.com/volumes) and [private networking](https://docs.railway.com/networking/private-networking)

### Implementation Details

**First run.** Open the `Langflow` service's public domain. Log in with username `admin` and the value of `LANGFLOW_SUPERUSER_PASSWORD` from the Variables tab. Change it under your profile if you like. Add provider keys either as `OPENAI_API_KEY` / `ANTHROPIC_API_KEY` service variables (both optional, then redeploy) or as global variables inside Langflow, which are encrypted with `LANGFLOW_SECRET_KEY`.

**Calling flows from code.** Create an API key under your profile, then `POST https://YOUR-DOMAIN/api/v1/run/FLOW_ID` with an `x-api-key` header. Each flow's **API access** panel shows the exact request.

**Generated secrets.** `LANGFLOW_SECRET_KEY`, `LANGFLOW_SUPERUSER_PASSWORD` and the Postgres password are generated at deploy time. Back up `LANGFLOW_SECRET_KEY` with your database backups: rotating it makes stored provider keys unreadable.

**Healthcheck.** Railway polls `/health_check` (which also checks the database) before routing traffic to a new deployment, so redeploys and upgrades cut over only once migrations have finished.

**Persistence.** Redeploys and restarts keep every flow, user and key (Postgres volume) and the encryption key and uploads (`/app/langflow` volume). A Postgres restart makes `/health_check` report `db: error` for a few seconds; Langflow reconnects on its own.

**Upgrades.** The image is pinned. To upgrade, change the `Langflow` service's image tag to a newer release and redeploy; Langflow migrates the schema on start. Read the release notes first - component changes can affect existing flows.

**Variables you may want to change.** `LANGFLOW_NEW_USER_IS_ACTIVE` (false) gates sign-ups behind admin activation. `DO_NOT_TRACK` (true) disables telemetry. Remove `LANGFLOW_AUTO_LOGIN=false` only if the service is not reachable from the internet.

**Risks.** Flows execute arbitrary components, including code and HTTP calls, with the service's network access - only give accounts to people you trust. Pinned images receive security fixes when you upgrade, not automatically. Railway's fair-use policy applies to what your flows do.

### Why Deploy Langflow 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 Langflow 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.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/kit-langflow-build-0919
