Self-host Langflow
Low-code visual builder for AI agents and workflows, with an API and an MCP server for the flows you build. Run your own Langflow on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.
Updated November 23, 2026
Running your own Langflow usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Langflow behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.
Just ask your agent
Open a Hobby workspace, tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:
Set up Langflow on this workspace and give me the link. Follow https://envhaven.com/self-host/langflow.md
Then open the link it sends and create your Langflow account straight away, before anyone else finds the address. That is the whole request: the address in it is this page’s Markdown copy, and the agent follows the instructions for it further down, with every setting Langflow’s docs require.
Or keep it private with Tailscale
The preview URL puts Langflow on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Langflow an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace’s Vars pane as TS_AUTHKEY, and ask the agent:
Set up Langflow on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/langflow.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
- On Plus and Pro, a Tailscale container runs beside Langflow, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
- On Hobby, Tailscale runs in the workspace beside Langflow; after a restart or an update, ask the agent to start both again.
- Anything other services have to reach, such as a webhook, still needs a public address. Keep self-hosted apps private with Tailscale covers both, and what Tailscale’s free plan includes.
| At a glance | |
|---|---|
| What it is | AI chat, models and agent tools |
| License | MIT |
| Runs as | Docker (langflowai/langflow) or a native install |
| Memory | 2 GB minimum; at least 4 GB recommended (docs) |
| Plan that fits | Hobby or larger |
| Web port | 7860 |
| Documentation | docs.langflow.org/deployment-nginx-ssl |
What your agent takes care of
- Installing it. Langflow runs from the official image,
langflowai/langflow, with its data in folders under~/apps/langflow, or without Docker on Hobby. - Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
- Locking it down first. What Langflow’s docs say to set before it faces the internet, below.
- Telling you what to back up: LANGFLOW_CONFIG_DIR (the example compose mounts the langflow-data volume at /app/langflow; holds the secret key and uploaded files) and SQLite file langflow.db by default (LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True moves it into the config directory), or the PostgreSQL volume langflow-postgres when LANGFLOW_DATABASE_URL is set (docs).
The settings it needs behind a proxy
- Bind to loopback and proxy to 127.0.0.1:7860: The nginx guide starts Langflow bound to 127.0.0.1 and lets nginx with Let’s Encrypt terminate TLS in front of it. (docs)
- WebSocket upgrade headers in the proxy: The documented nginx location forwards Upgrade and Connection headers, uses HTTP/1.1, turns buffering off and allows 300 s reads. (docs)
- client_max_body_size 100M in nginx: The documented server block allows request bodies up to 100 MB. (docs)
LANGFLOW_ROOT_PATH: ASGI path prefix for deployments behind a proxy that strips the prefix, such as /langflow; empty serves at /. (docs)LANGFLOW_CORS_ORIGINS: Allowed CORS origins, comma-separated; the default * allows every origin. (docs)
Before it faces the internet
- Never expose the port directly. Set LANGFLOW_AUTO_LOGIN=False, a non-default LANGFLOW_SECRET_KEY and a proxy with authentication. (docs)
- LANGFLOW_SUPERUSER_PASSWORD must be set before startup when auto-login is off; the username defaults to langflow. Official packages and Docker images disable auto-login by default. (docs)
- Set your own LANGFLOW_SECRET_KEY in production; one is generated automatically otherwise. (docs)
- Langflow executes developer-provided Python by design and does not isolate users, so a public instance needs infrastructure-level isolation. (docs)
Things to ask next
Everything after the install is one more sentence to the agent. Some that come up:
- “Connect it to the API keys in my Vars pane, and make Claude the default model.”
- “Add a second user account for my partner, without admin rights.”
- “Move Langflow to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to
domains.envhaven.app, and the agent changes Langflow’s address settings to match. - “Update Langflow to the latest release.” It pulls the new image and recreates the container, data kept.
Instructions for the agent
The agent reads these from the page’s Markdown copy. They also work pasted on their own, if you would rather give them in your own words.
Set up Langflow on this workspace and serve it at my preview URL.
- Where Docker has a daemon (Plus and Pro), use Docker Compose with the official image, langflowai/langflow, starting from the docs' compose file: https://github.com/langflow-ai/langflow/blob/main/docker_example/docker-compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: postgres (postgres:16-trixie in the example compose; the plain docker run uses an SQLite database instead).
- Keep the compose file in ~/apps/langflow and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Langflow's port 7860.
- Without Docker (on Hobby, where Docker has no daemon), install it as its docs describe, with `uv pip install langflow`, then `langflow run` (Python 3.10 to 3.14, with uv), into ~/apps/langflow with its data, so it survives workspace updates; global installs and system paths do not. Run it in a tmux window named langflow, listening on 0.0.0.0:7860, and point my preview URL at port 7860.
- The preview URL terminates HTTPS in front of Langflow: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/langflow.md for the preview URL, as Langflow's docs describe for running behind a proxy; skip any that apply only when Langflow serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/langflow.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Langflow up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.
What to know
- In Docker, Langflow’s containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
- Without Docker, Langflow runs as a process in the workspace, so after a restart or an update, ask the agent to start it again.
- The default upload limit is 1024 MB, above Cloudflare’s 100 MB request body limit, so set LANGFLOW_MAX_FILE_SIZE_UPLOAD at or below 100 to get the app’s own error instead of a proxy rejection. (docs)
- Without a configured database or config directory on a volume, a plain docker run keeps the SQLite database, secret key and uploaded files inside the container, and recreating the container deletes them. (docs)
- Langflow can take a few minutes to start. (docs)
- The default CORS settings accept requests with credentials from any website, which matters once the instance is public. (docs)
- A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.
Without a workspace
The manual route, on a server you run:
- Rent a Linux VPS, secure SSH, and create a user for the app.
- Install Docker and write a compose file from the official image.
- Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
- Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
- Keep the firewall closed except for the proxy, and schedule backups and updates.
Langflow’s own documentation covers each step for its install methods.
Sources
Facts about Langflow come from its own documentation, checked on 2026-11-23: