Why self-host LangFlow on a VPS
LangFlow is aimed at developers who want to iterate quickly on LangChain graphs before freezing them into code. On a VPS, you gain a stable and persistent environment, whereas a local instance on your machine is lost on every restart and cannot be shared with the team. Your flows, your global variables (including API keys) and the execution history live in a PostgreSQL database that you control. You can expose each flow as an API, plug in custom components, and collaborate with several people on the same instance. Above all, your prompt chains and the business logic they encode never pass through any third-party platform.
The concrete benefits of a self-hosted LangFlow
- Persistent instance shared by the team, unlike an ephemeral local setup.
- Flows and global variables stored in your own PostgreSQL, backed up at will.
- Custom Python components deployable directly on the server.
- Each flow exposable as an API endpoint for integration into your applications.
- Version freedom: you pin the release that matches your existing flows.
- No API key or prompt logic exposed to an external SaaS.
Hardware and software requirements
LangFlow is more demanding than average: its interface and its execution engine require memory. Plan for at least 2 vCPU and 4 GB of RAM, and ideally 4 vCPU / 6 to 8 GB for comfortable use with several flows loaded. Add a PostgreSQL database (in a neighboring container) for production: the default SQLite database is fine for testing but quickly shows its limits. Count on 10 GB of disk. Docker and Docker Compose are needed, plus a subdomain (e.g. langflow.your-domain.com) and port 443 open.
Deploy LangFlow with Docker, Postgres and HTTPS
Prepare the project
Over SSH: mkdir -p /opt/langflow && cd /opt/langflow. There you will place the docker-compose.yml describing two services: langflow and postgres.
Define LangFlow and PostgreSQL
Use the langflowai/langflow image, expose the internal port 7860, and point LANGFLOW_DATABASE_URL to the Postgres service (postgresql://langflow:motdepasse@postgres:5432/langflow). Add a volume for the Postgres data.
Enable authentication
Before the first launch, set LANGFLOW_AUTO_LOGIN=false, LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD in the environment. Without this, the instance would be open to anyone who knows the URL.
Launch the stack
Run docker compose up -d then monitor docker compose logs -f langflow. The first initialization creates the schema in the database and can take a minute.
Configure the reverse proxy and SSL
Route langflow.your-domain.com to localhost:7860 via Caddy or Nginx, with an automatic Let's Encrypt certificate. Enable WebSocket support on the proxy side, indispensable for the real-time canvas to work properly.
Test a flow and its API
Log in, build a minimal flow, add your API keys in the global variables, then retrieve the call code via the flow's API button to validate external integration.
Never leave LangFlow in production with SQLite: the database corrupts under concurrent load and you lose your flows. Migrate to PostgreSQL from the start and back up regularly with pg_dump. Also remember to export your flows as JSON (Export menu) as a versionable safety net in Git, independent of the database state.