You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace `SUPERUSER_PASSWORD` with a strong password for the Langflow superuser.
30
31
The default admin username is `langflow`.
31
32
32
33
4. Run the Docker Compose file:
@@ -35,27 +36,27 @@ This guide will help you get LangFlow up and running using Docker and Docker Com
35
36
docker compose up
36
37
```
37
38
38
-
LangFlow will now be accessible at [http://localhost:7860/](http://localhost:7860/).
39
+
Langflow will now be accessible at [http://localhost:7860/](http://localhost:7860/).
39
40
40
-
## Docker Compose Configuration
41
+
## Configure Docker Compose
41
42
42
43
The Docker Compose configuration spins up two services: `langflow` and `postgres`.
43
44
44
-
### LangFlow Service
45
+
### Langflow service
45
46
46
47
The `langflow` service uses the `langflowai/langflow:latest` Docker image and exposes port 7860. It depends on the `postgres` service.
47
48
48
49
Environment variables:
49
50
50
51
-`LANGFLOW_DATABASE_URL`: The connection string for the PostgreSQL database.
51
52
-`LANGFLOW_SUPERUSER_PASSWORD`: The initial admin password. This value is required in `.env`.
52
-
-`LANGFLOW_CONFIG_DIR`: The directory where LangFlow stores logs, file storage, monitor data, and secret keys.
53
+
-`LANGFLOW_CONFIG_DIR`: The directory where Langflow stores logs, file storage, monitor data, and secret keys.
53
54
54
55
Volumes:
55
56
56
57
-`langflow-data`: This volume is mapped to `/app/langflow` in the container.
57
58
58
-
### PostgreSQL Service
59
+
### PostgreSQL service
59
60
60
61
The `postgres` service uses the `postgres:16-trixie` Docker image and exposes port 5432. The image is pinned to a specific Debian base (`trixie`, Debian 13) so the `postgres:16` tag cannot silently roll its underlying OS, which would otherwise produce a glibc collation version mismatch warning on existing data volumes.
61
62
@@ -89,6 +90,6 @@ docker compose exec postgres \
89
90
90
91
Fresh installs are unaffected.
91
92
92
-
## Switching to a Specific LangFlow Version
93
+
## Switching to a specific Langflow version
93
94
94
-
If you want to use a specific version of LangFlow, you can modify the `image` field under the `langflow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `langflowai/langflow:latest` to `langflowai/langflow:1.0-alpha`.
95
+
If you want to use a specific version of Langflow, you can modify the `image` field under the `langflow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `langflowai/langflow:latest` to `langflowai/langflow:1.0-alpha`.
When set to `false`, Langflow blocks creating custom components and changing code in the visual editor.
16
16
17
17
When unset or `true`, Langflow allows custom code.
18
-
Existing Langflow installations will keep the default `true` behavior until you opt in to this restriction.
18
+
Existing non-Docker installations keep the default `true` behavior until you opt in to this restriction.
19
+
20
+
As of Langflow 1.11.x, official Langflow Docker images set `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false` at image build time, along with related [component hardening](/api-keys-and-authentication#multi-tenant-component-hardening) flags.
19
21
20
22
This environment variable is a beta feature, and should not be your only safeguard in production environments.
Copy file name to clipboardExpand all lines: docs/docs/Deployment/deployment-docker.mdx
+60-7Lines changed: 60 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,18 +13,25 @@ This guide demonstrates several ways to run Langflow with [Docker](https://docs.
13
13
14
14
*[Quickstart](#quickstart): Start a Langflow container with default values.
15
15
*[Use Docker Compose](#docker-compose): Run Langflow with a persistent PostgreSQL database and configurable environment variables.
16
-
*[Customize the Docker image](#customize): Package a flow or add your own code into a custom image built on top of the official Langflow image.
16
+
*[Customize the Docker Compose file](#customize): Package a flow or add your own code into a custom image built on top of the official Langflow image.
17
17
*[Build and run the Docker image from source](#build-from-source): Build a Docker image from a local clone of the repo, or start a full development environment with hot reload on both frontend and backend.
18
18
*[Upgrade the Langflow Docker image](#upgrade-the-langflow-docker-image): Upgrade to a newer image without losing your database or flows.
19
+
*[Docker image security defaults](#docker-image-security-defaults): Hardened environment variables baked into published images, and how to override them for local use.
19
20
20
21
## Quickstart {#quickstart}
21
22
22
23
With Docker installed and running on your system, run the following command:
23
24
24
25
```shell
25
-
docker run -p 7860:7860 -e LANGFLOW_AUTO_LOGIN=true langflowai/langflow:latest
Replace `<version>` with the version in `pyproject.toml` at the repo root.
228
+
Replace the following:
229
+
230
+
* `SUPERUSER_PASSWORD`: a strong password for the Langflow superuser
231
+
* `VERSION`: the version in `pyproject.toml` at the repo root
232
+
233
+
The image sets `LANGFLOW_AUTO_LOGIN=false` and the [component hardening defaults](#docker-image-security-defaults), so a superuser password is required unless you set `LANGFLOW_AUTO_LOGIN=true`.
219
234
220
235
To build only the LFX executor CLI image instead of the full Langflow application, run:
221
236
@@ -349,12 +364,50 @@ For example, this Docker Compose file uses a bind mount for Langflow data (`./la
349
364
With `docker run`, use the same volume mount and the new image tag:
350
365
351
366
```bash
352
-
docker run -p 7860:7860 -v langflow-data:/app/langflow -e LANGFLOW_SUPERUSER_PASSWORD=replace-with-a-strong-password langflowai/langflow:1.11.0
Replace `SUPERUSER_PASSWORD` with a strong password for the Langflow superuser.
374
+
355
375
This approach keeps the persistent volumes separate from the Langflow container, so you can upgrade the Langflow application without losing data.
356
376
357
377
If you need to upgrade to a custom image based on a Langflow release, such as to add `uv` in `1.8.0`, first build a derived image from the official image, and then follow the same steps above.
358
378
Set the custom image in your compose file or `docker run`, and then pull and restart.
359
379
360
380
For a minimal Dockerfile that adds `uv` to the 1.8.0 image, see the [release notes](/release-notes) ("Docker image no longer includes uv or uvx").
As of Langflow 1.11.x, official Langflow Docker images set `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false` at image build time, and include stricter defaults for the following environment variables:
These image values match the [component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening) recommendation.
395
+
They apply whether you use `docker run`, Docker Compose, or Kubernetes with the published image, unless you override them.
396
+
397
+
The image sets `LANGFLOW_AUTO_LOGIN=false`, so you must set `LANGFLOW_SUPERUSER_PASSWORD` (and optionally, `LANGFLOW_SUPERUSER`) unless you explicitly set `LANGFLOW_AUTO_LOGIN=true`.
398
+
399
+
To disable the stricter defaults and use custom components, built-in code-execution components, or absolute local file paths, override the image defaults:
In Docker Compose, add the same keys under `services.langflow.environment`.
412
+
413
+
For more information, see [Component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening) and [Block custom components](/deployment-block-custom-components).
0 commit comments