Back to Blog
Tutorial10 min read2026-06-30

How to Deploy Langflow for Visual AI Workflows

Self-host Langflow for building visual AI workflows: back it with managed Postgres, lock down the editor with auth, and expose flows as APIs your apps can call.

Ajay Kumar
Ajay Kumar
Founder & DevOps, PandaStack

# How to Deploy Langflow for Visual AI Workflows

Langflow is an open-source visual builder for AI workflows — a drag-and-drop canvas on top of the LangChain ecosystem for assembling chains, agents, and RAG pipelines without writing glue code. Running it locally is easy; running it as a durable, secured service for your team takes a few deliberate choices. Here's how.

Default SQLite won't survive a container

Like most local-first tools, Langflow defaults to a SQLite file for storing your flows. In a containerized deployment that filesystem is ephemeral — redeploy and your flows are gone. The first production decision is to back Langflow with an external database. It supports PostgreSQL via a connection string environment variable, which pairs perfectly with a managed Postgres.

Configure for production

Langflow reads configuration from environment variables:

# Persist flows in managed Postgres instead of SQLite
LANGFLOW_DATABASE_URL=postgresql://user:pass@host:5432/dbname

# Lock down the editor with login
LANGFLOW_AUTO_LOGIN=false
LANGFLOW_SUPERUSER=admin
LANGFLOW_SUPERUSER_PASSWORD=<strong-password>

# Secret used to encrypt stored credentials/API keys
LANGFLOW_SECRET_KEY=<random-secret>

LANGFLOW_PORT=7860

The critical ones:

  • LANGFLOW_AUTO_LOGIN=false plus a superuser disables the open, no-auth mode. Never expose a Langflow editor to the internet without auth — flows contain your LLM provider keys.
  • LANGFLOW_SECRET_KEY encrypts stored secrets; set it explicitly so it's stable across redeploys.
  • LANGFLOW_DATABASE_URL is what makes your work durable.

Containerize

Langflow ships an official image:

FROM langflowai/langflow:latest
EXPOSE 7860
CMD ["langflow", "run", "--host", "0.0.0.0", "--port", "7860"]

Pin a specific version tag in production rather than latest to avoid surprise breaking changes on redeploy.

Deploy on PandaStack

  1. 1Provision a managed PostgreSQL (14.x/16.x) in the [dashboard](https://dashboard.pandastack.io). Use the auto-wired DATABASE_URL to populate LANGFLOW_DATABASE_URL.
  2. 2Create a container app from the Langflow image or a repo with the Dockerfile. It builds with rootless BuildKit and serves HTTPS with automatic SSL.
  3. 3Set the env vars above as encrypted environment variables.
  4. 4Visit the HTTPS URL, log in, and start building. Your flows now live in managed Postgres with scheduled and manual backups.

Langflow vs. Flowise — which to pick?

Both are visual LLM builders; they deploy almost identically. A rough orientation:

LangflowFlowise
EcosystemTightly LangChain-alignedBroad, many integrations
FeelPythonic, component-richLightweight, fast to start
BothPostgres-backed, auth env vars, API exportSame

The deployment recipe is the same: external DB + auth + secret key. Choose based on which canvas your team prefers.

Expose flows as APIs

The point of a visual builder is shipping. Once a flow works, Langflow gives it an API endpoint you call from your application:

curl -X POST https://<langflow-app>/api/v1/run/<flow-id> \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: <langflow-api-key>' \
  -d '{"input_value": "Summarize the latest release notes"}'

Generate API keys inside Langflow and store them as secrets in whatever app consumes the flow.

Operational notes

  • Sizing: the editor is modest, but flows that embed documents or run local models want a memory-optimized tier. Start small; scale when you see memory pressure in metrics.
  • Cold starts: free-tier scale-to-zero means the first hit after idle is slow. Fine for an internal design tool; keep warm on a paid tier for anything user-facing.
  • Backups: because flows live in managed Postgres, PandaStack's backups cover them — but still export critical flows to JSON and commit them to git as a second copy.
  • Provider keys: store LLM keys in Langflow's credential store (encrypted by your secret key), not in plaintext env where possible.

Verify persistence

The acceptance test for any self-hosted visual builder: build a trivial flow, redeploy the app, and confirm the flow is still there after login. If it survives, your LANGFLOW_DATABASE_URL and LANGFLOW_SECRET_KEY are wired correctly.

References

  • [Langflow documentation](https://docs.langflow.org/)
  • [Langflow: Environment variables](https://docs.langflow.org/environment-variables)
  • [Langflow: Authentication](https://docs.langflow.org/configuration-authentication)
  • [Langflow GitHub](https://github.com/langflow-ai/langflow)

Deploying Langflow well is about durability and security: external Postgres, real auth, a stable secret key. PandaStack provides managed Postgres with backups and encrypted env vars to make it a clean two-step deploy. Start free at [dashboard.pandastack.io](https://dashboard.pandastack.io).

Ready to deploy?

Start free on PandaStack.

Start free on PandaStack

More in Tutorial

Browse all Tutorial articles →

See also