Install Langflow with Docker It is one of the cleanest and fastest ways to get this tool up and running.In this post we'll tell you how to do it: from the most basic command to a robust configuration with a persistent database.
Why use Docker for Langflow?

Langflow It has become an essential tool for visually developing AI workflows. Its greatest strength is the ease with which it connects prompts, LLMs, APIs, and data sources on a single interactive canvas. one of the most powerful and intuitive platforms for both developers and business teams.
While it is possible to install Langflow locally using a Python environment with pip, Deploying it using Docker is the recommended optionWithin a container, both the app and its dependencies run in an isolated environment, without affecting the operating system. Furthermore, this installation is ideal for production deployments, as it allows for the integration of databases, persistent volumes, and advanced configurations.
Requirements for installing Langflow with Docker
Before you begin installing Langflow with Docker, it is advisable to verify the following elements on your computer or local server.
- Docker Engine and Docker Compose installed and working on your system (See the topic How to install Docker on Linux step by step).
- As minimum available system resources, at least 2 CPU cores and 4 GB of RAM are recommended (8 GB or more are essential if you are going to process language models or embeddings locally).
- Access to port 7860, which is the default web port that Langflow uses to serve its user interface.
- API keys of the providers you use in your flows (OpenAI, Anthropic, Ollama, Google Gemini, etc.).
How to install Langflow with Docker: quick method with Docker Run

If this is your first time using Langflow, the easiest way to install it with Docker is using the docker run commandThis is the perfect option for quick tests or for familiarizing yourself with the interface. First, open the terminal and paste the command:
docker run -p 7860:7860 -e LANGFLOW_AUTO_LOGIN=false -e LANGFLOW_SUPERUSER_PASSWORD=YOUR_PASSWORD langflowai/langflow:latest
Don't run it yet. First, replace YOUR_PASSWORD with a strong password. Now press Enter and the command will download the official image and start Langflow on port 7860. Once the process is complete and the container is running, you can Open Langflow in your browser.
To do this, navigate towards http://localhost:7860/or use the IP address of the device you're using as your local server. Finally, Log in with the user langflow and use the password you just set.
This method is ideal for quick tests, but It does not persistently store flows.If you restart the container, you'll lose your data. That's why, if you plan to use Langflow seriously, Docker Compose is the best option.
How to install Langflow with Docker Compose
A second way to install Langflow with Docker is by using Docker Compose. This way You can define and run multiple services (Langflow and PostgreSQL) with a single configuration.Your workflows, users, and configurations are persistently stored in an external, permanent database. This is the recommended method for servers and VPSs.
Step 1: Clone the official repository
El official Langflow repository It includes a complete example of Docker Compose configurations that you can use as a base. Inside, you'll find a ready-to-use docker-compone-yml file. To clone it, run the following command:
git clone https://github.com/langflow-ai/langflow.git cd langflow/docker_example
Step 2: Create the docker-compose.yml file
If you prefer not to clone the entire repositoryYou can create your own docker-compose.yml file from scratch. To do this, first create a new directory or dedicated folder to organize Langflow's configuration files and persistent data:
mkdir ~/langflow-compose && cd ~/langflow-compose
Next, open your text editor in terminal favorite (like nano or micro) to draft the configuration:
nano docker-compose.yml
After, Copy and paste the following official and optimized structure:
services: langflow: image: langflowai/langflow:latest container_name: langflow-app restart: unless-stopped ports: - "7860:7860" environment: - LANGFLOW_HOST=0.0.0.0 - LANGFLOW_PORT=7860 - LANGFLOW_AUTO_LOGIN=true volumes: - langflow_data:/app/langflow volumes: langflow_data:
Step 3: Start the services
Finally, from the directory where your docker-compose.yml file is located, run the following command:
docker-compose up -d
The -d flag starts containers in the background. Docker Compose will download the necessary images and will support both Langflow and PostgreSQL.
Step 4: Verify that the service is active and access the web interface
As a fourth step to install Langflow with Docker Compose, it is advisable to check the execution status of the containerTo ensure there are no startup errors, run the command docker compose psYou should see an output indicating that langflow-app has the state Up (o running) and that port 7860 is correctly mapped.
Finally, all that remains is Access the web interface by opening your browser and accessing the following local address: http://localhost:7860. If you are installing on a remote server, replace localhost with your server's IP address. That's it! You will see the Langflow visual canvas ready for you to start building your workflows and integrating artificial intelligence components.
What does this configuration, cloned from the official repository, include? On one hand, a persistent volume called langflow-data where flows, logs, and configurations are stored. On the other hand, a PostgreSQL container based on Debian 13 to avoid incompatibilities of collation. And also environment variables to customize the installation.
Installing Langflow with Docker: Advanced Customization

After installing Langflow with Docker and everything is working, you can customize the installation to your needs. For example, you can extend the official image creating a Dockerfile: FROM langflowi/langflow:latest && RUN pip install langchain-community.
Longflow also allows export and package flows within a Docker image for enterprise deployments. Furthermore, thanks to persistent volumes, update Langflow Without losing data, it's simple. Just run the commands:
docker pull langflowai/langflow:latest docker compose down docker compose up
As you can see, installing and maintaining Langflow with Docker is quick and easy. The combination of the official image and the PostgreSQL configuration provides you with a solid foundation for developing, testing, and deploying your AI flows.
Opting for the method of Docker Run or the more robust configuration with Docker Compose It depends on your needs. For a serious user, the second option is always recommended, as it ensures data persistence and facilitates updates.
From a young age, I've been fascinated by all things scientific and technological, especially those advancements that make our lives easier and more enjoyable. I love staying up-to-date on the latest news and trends, and sharing my experiences, opinions, and tips about the devices and gadgets I use. This led me to become a web writer a little over five years ago, focusing primarily on Android devices and Windows operating systems. I've learned to explain complex concepts in simple terms so my readers can easily understand them.
