Deployment guide

How to Host LangFlow on a VPS

Deploy on a VPS Cloud →

Artificial Intelligence8 min read

How to Host LangFlow on a VPS

LangFlow is a visual editor for LangChain flows focused on rapid prototyping and Python export. Self-hosted on a VPS, it becomes your private workshop to design, test and then industrialize AI pipelines, with a persistent database and secure access. Here is how to install it properly.

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

01

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.

02

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.

03

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.

04

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.

05

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.

06

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.

Prototype your AI pipelines on a ServOrbit Cloud VPS

With a ServOrbit Cloud VPS and its ready-to-use Docker environment, deploy LangFlow and its PostgreSQL database in a few commands. Scale up resources when your flows become heavier.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.