This page documents the technical implementation of Langflow's cloud deployment strategies, focusing on infrastructure-as-code (IaC) for AWS, containerized orchestration with Docker Compose, and specialized configurations for multi-worker environments and monitoring.
Langflow provides a production-ready AWS deployment path using the AWS Cloud Development Kit (CDK). This setup automates the provisioning of a highly available, scalable architecture.
The AWS deployment follows a tiered architecture:
The following diagram maps high-level AWS services to the specific infrastructure components and code entities used in the deployment implementation.
Title: AWS Infrastructure Entity Mapping
Sources: docker/cdk.Dockerfile1-5
The deploy/ directory contains a comprehensive docker-compose.yml for production-grade container orchestration, utilizing a multi-service architecture for scalability.
The stack uses Traefik v3.0 as a reverse proxy to handle routing and SSL termination via Let's Encrypt deploy/docker-compose.yml2-51 It defines multiple networks including a public Traefik network and a default internal network deploy/docker-compose.yml6-8
Title: Docker Compose Service Architecture
Sources: deploy/docker-compose.yml2-100 deploy/docker-compose.yml124-153
langflowai/langflow-backend image, communicating with PostgreSQL for persistence deploy/docker-compose.yml69-85langflow.worker.celery_app module, typically configured with eventlet pool for high concurrency deploy/docker-compose.yml133-142pgadmin. subdomain deploy/docker-compose.yml101-123The deployment setup includes a Prometheus configuration to scrape metrics from the system.
structlog for structured logging, which can be formatted as container_json or container for cloud log aggregators.Sources: deploy/docker-compose.yml1-160 deploy/prometheus.yml1-12 deploy/observability/grafana-loki/grafana/provisioning/dashboards/dashboards.yml1-10
Langflow provides multiple Docker image variants based on the Red Hat Universal Base Image (ubi10/python-314-minimal) to support different deployment needs.
| Image Variant | Dockerfile Path | Key Characteristics |
|---|---|---|
| Full | docker/build_and_push.Dockerfile | Includes frontend assets, backend core, and all standard workspace members docker/build_and_push.Dockerfile1-152 |
| Base | docker/build_and_push_base.Dockerfile | Lean core framework only; excludes extension bundles like lfx-duckduckgo docker/build_and_push_base.Dockerfile81-87 |
| Backend-Only | docker/build_and_push_backend.Dockerfile | No frontend assets or Playwright; optimized for API-only deployments docker/build_and_push_backend.Dockerfile1-7 |
| Extras | docker/build_and_push_with_extras.Dockerfile | Includes heavy dependencies like couchbase, cassio, and nv-ingest docker/build_and_push_with_extras.Dockerfile57-59 |
Production images run as a non-root user (UID 1000) docker/build_and_push.Dockerfile122 To prevent startup crashes, LANGFLOW_CONFIG_DIR (defaulting to /app/langflow) is pre-created with correct ownership to allow the container user to write secret keys and profile pictures docker/build_and_push.Dockerfile130-137
Title: Container Runtime Entity Mapping
Sources: docker/build_and_push.Dockerfile124-137 deploy/docker-compose.yml137 deploy/.env.example11-12
While Langflow defaults to SQLite, production cloud deployments require a robust external database.
For containerized environments, Langflow is configured to use PostgreSQL. The deploy/ stack uses postgres:15.4 deploy/docker-compose.yml87 Database connectivity is managed via the environment variable LANGFLOW_DATABASE_URL.
Cloud deployments with Celery workers utilize RabbitMQ as the message broker and Redis as a result backend deploy/docker-compose.yml124-132
BROKER_URL=amqp://langflow:langflow@broker:5672 deploy/.env.example45RESULT_BACKEND=redis://result_backend:6379/0 deploy/.env.example46Sources: deploy/docker-compose.yml86-100 deploy/.env.example23-47
For rapid deployment using the provided example:
deploy/ directory..env.example to .env and configure DOMAIN, STACK_NAME, and LANGFLOW_SUPERUSER_PASSWORD deploy/.env.example1-12docker compose up -d to start the Traefik proxy, backend, database, and workers.Langflow can be deployed to GCP Cloud Run by using the standard Docker images. Configuration requires setting LANGFLOW_DATABASE_URL to a Cloud SQL instance and ensuring LANGFLOW_CONFIG_DIR points to a persistent volume (like Cloud Storage FUSE) or is used for ephemeral storage.
In cloud environments, logs can be retrieved via API if LANGFLOW_ENABLE_LOG_RETRIEVAL is set to True. This utilizes an internal buffer defined by LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE.
Sources: deploy/.env.example1-53 docker/build_and_push.Dockerfile138-151
Refresh this wiki
This wiki was recently refreshed. Please wait 5 days to refresh again.