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

# Deploy Langflow

Langflow: visual builder for AI agents and RAG flows. Requires Hobby plan

**[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
- **Total deploys:** 1

## Template content

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

- **Image:** langflowai/langflow:1.12.2@sha256:79c02794adebe82d756b7152ce4feebe4a5426e1faf3fe5b5d0dd08f304510c4
- **Start command:** `/bin/sh -c 'm=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || echo max); if [ "$m" != max ] && [ "$m" -lt 1500000000 ]; then echo "Langflow needs about 1.5 GB of RAM to start, but this service is limited to $((m/1048576)) MB. Railway Free (0.5 GB) and Trial (1 GB) plans cannot run it. Upgrade to Hobby, or raise the memory limit in the service Settings, then redeploy."; sleep 5; exit 1; fi; exec langflow run'`
- **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 canvas with the Simple Agent flow (URL and web-search tools feeding an agent) and the Playground showing its answer](https://bogusz.co/external/langflow-banner-v1.png)

Build AI agents and RAG pipelines on a visual canvas, test them in the built-in chat, and call them as an API or MCP server — with flows, users and keys stored in Postgres.

**Get started** — **requires the Hobby plan.** Langflow idles at about 1.25 GB, so on Free (0.5 GB) and Trial (1 GB) it stops at startup with a one-line plan message.

1. **Deploy.** Nothing to fill in; Postgres and every secret are generated.
2. **Sign in.** Open the Langflow service URL. Username `admin`; the password is `LANGFLOW_SUPERUSER_PASSWORD` in the service's **Variables** tab.
3. **Build a flow.** Start from the **Simple Agent** template, add your OpenAI or Anthropic key as a global variable, and chat with it in the Playground.

## About Hosting Langflow

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. 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

**Plan requirements: Hobby or higher.** Langflow does not run on Railway's Free (0.5 GB) or Trial (1 GB) plans: measured on this exact image, it idles around **1.25 GB** and peaks near 1.4-1.6 GB while it loads its component catalogue (Postgres adds about 60 MB). On a 1 GB limit the server process is killed during startup every time and the deploy fails (re-verified 2026-10-03). On those plans the service log says so in one line - "Langflow needs about 1.5 GB of RAM to start, but this service is limited to 953 MB" - instead of a crash loop with no explanation. It runs comfortably at 2 GB, well inside Hobby's per-service limit. Upstream's own Railway guide states the same 2 GB minimum.

**First run.** There is nothing to fill in at deploy time. 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`.

**Networking.** New deployments receive one public HTTPS domain targeting Langflow on port `7860`. Postgres stays on Railway's private network.

**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.

**Start command.** The service starts with a short shell check before `langflow run`: it reads the container's memory limit and, below 1.5 GB, prints the plan message above and exits instead of starting a server that would be killed. Above that it hands straight over to the image's own `langflow run`. If you raise or remove the limit, nothing else changes.

**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
