---
title: "Deploy Langflow"
description: "Pinned Langflow, private Postgres, volume, generated secret, /health_check."
category: "AI/ML"
url: https://railway.com/deploy/langflow-2
---

# Deploy Langflow

Pinned Langflow, private Postgres, volume, generated secret, /health_check.

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

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

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

## Template content

### Langflow

- **Image:** langflowai/langflow:1.12.0
- **Start command:** `sh -c 'mkdir -p /app/langflow && chown -R 1000:0 /app/langflow && chmod 700 /app/langflow && exec su -s /bin/sh user -c "exec python -m langflow run --host 0.0.0.0 --port 7860"'`
- **Health check:** /health_check
- **Public domain:** Yes

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

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

## Documentation

# Deploy and Host Langflow on Railway

Visual LLM flow builder with a **pinned** `langflowai/langflow:1.12.0` image, Railway Postgres over the **private** network, a volume for flows/uploads, a generated `LANGFLOW_SECRET_KEY`, and `/health_check`.

This listing replaces rotting marketplace clones that ship `:latest`, debug logs, a public Postgres TCP proxy, and no app volume.

## About Hosting Langflow

Langflow is a RAM-heavy UI + API. This template runs one Langflow replica on port **7860** (public HTTP) and a Railway Postgres plugin that is **private only** (no TCP proxy). Flows and uploads live on a volume at `/app/langflow` (`LANGFLOW_CONFIG_DIR`).

Expect **2–4 GB RAM** and a few minutes on first boot while the image pulls and components load. Healthcheck timeout is 300s.

## Why Deploy

Use this instead of `:latest` clones when you want a pin, private database, persistent flows, a generated secret, and a real healthcheck.

| | This template | Typical marketplace clone |
| --- | --- | --- |
| Image | Pinned `langflowai/langflow:1.12.0` | `:latest` |
| Postgres | Plugin + private `DATABASE_URL` (`*.railway.internal`) | Public TCP proxy |
| App volume | `/app/langflow` | None (flows die on restart) |
| Secret | `LANGFLOW_SECRET_KEY=${{secret()}}` | Missing or static |
| Logs | `info` | `debug` |
| Healthcheck | `GET /health_check` | Often missing |

## Common Use Cases

- One-click Langflow sandbox after Flowise EOL
- Visual LLM / RAG flow builder with Postgres-backed state
- Team playground (turn off auto-login first — see below)

## Dependencies for Langflow Hosting

- Railway Postgres plugin (private `DATABASE_URL`)
- Volume on Langflow at `/app/langflow`
- Public HTTP domain on Langflow only (port 7860)

### Deployment Dependencies

| Service | Image / plugin | Notes |
| --- | --- | --- |
| **Langflow** | `langflowai/langflow:1.12.0` | Public HTTP, volume, `/health_check` |
| **Postgres** | Railway Postgres (`postgres-ssl:18`) | Private network only |

No API keys are required to boot the editor. Add provider keys (OpenAI, Anthropic, …) later in the Langflow UI as global variables.

## What you get

- Image: `langflowai/langflow:1.12.0` (not `:latest`)
- Database: `LANGFLOW_DATABASE_URL=${{Postgres.DATABASE_URL}}` which is already `postgres.railway.internal` (not a public TCP URL)
- Volume: `/app/langflow` → `LANGFLOW_CONFIG_DIR` (flows, file uploads, local cache). The start command `chmod`s the mount so Langflow can write `secret_key` and uploads. `RAILWAY_RUN_UID=0` is set so that chmod works on Railway volumes.
- Secret: `LANGFLOW_SECRET_KEY=${{secret()}}` generated on deploy
- Healthcheck: `GET /health_check` (300s timeout)
- Logs: `LANGFLOW_LOG_LEVEL=info` / `LOG_LEVEL=info` (not debug)

## How to log in

`LANGFLOW_AUTO_LOGIN=true` is enabled for first-run DX. Open the public Langflow URL and you are in — no signup form.

That is convenient for a personal sandbox. For anything shared:

1. Set `LANGFLOW_AUTO_LOGIN=false`
2. Set `LANGFLOW_SUPERUSER` and a strong `LANGFLOW_SUPERUSER_PASSWORD`
3. Redeploy, then sign in with that user

Keep `LANGFLOW_SECRET_KEY` as the generated value. Rotating it invalidates sessions.

## Variables

### Generated (do not paste a dummy)

| Key | Source |
| --- | --- |
| `LANGFLOW_SECRET_KEY` | `${{secret()}}` |

### Wired for you

| Key | Value |
| --- | --- |
| `LANGFLOW_DATABASE_URL` | `${{Postgres.DATABASE_URL}}` (private network) |
| `LANGFLOW_CONFIG_DIR` | `/app/langflow` (the volume mount) |
| `LANGFLOW_PORT` / `PORT` | `7860` |
| `LANGFLOW_HOST` | `0.0.0.0` |
| `LANGFLOW_AUTO_LOGIN` | `true` |
| `LANGFLOW_LOG_LEVEL` / `LOG_LEVEL` | `info` |
| `LANGFLOW_OPEN_BROWSER` | `false` |
| `LANGFLOW_WORKERS` | `1` |

Optional later: `OPENAI_API_KEY` and other provider secrets. Leave them empty here — do not bake keys into the template.

Postgres stays private. Do not add a TCP proxy on 5432 unless you know you need external `psql`.

## Volume and ports

- **Volume** on Langflow: `/app/langflow` (flows + uploads)
- **HTTP** on Langflow only: port **7860**
- **Postgres**: private `5432` only

Railway Postgres already persists on its own volume.

## Ops notes

- First deploy is slow: large image + component load. Wait for `/health_check` 200.
- Do not scale Langflow replicas against this volume; one replica only.
- Disable auto-login before sharing the public URL.
- Upstream: [langflow-ai/langflow](https://github.com/langflow-ai/langflow) · [docs](https://docs.langflow.org/)


## 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/langflow-2
