How to self-host Langflow on your own server

We earn commissions when you shop through the links below.

About 20 minutes · Commands checked against the official documentation on November 26, 2026

Langflow is an open-source visual builder for AI agents and workflows. Self-hosting it keeps your flows, API keys and data on a server you control.

This guide uses the ready-made Compose file in Langflow's repository, which runs Langflow with a persistent PostgreSQL database. You end with Langflow at http://<your server's IP address>:7860, protected by a superuser password.

Langflow is #53 on the all-time Top 100 this week.

You will need

  • A Linux server running Ubuntu 24.04 LTS, with at least a dual-core CPU and 2 GB of memory (Langflow's stated minimum; it recommends 4 GB or more)
  • Git (on standard Ubuntu server images)
  • Comfort with SSH and a terminal
  1. 1.Get a server

    Rent a virtual private server (VPS) running Ubuntu 24.04 LTS. Langflow's documentation lists a dual-core CPU and 2 GB of memory as the minimum, and a multi-core CPU with at least 4 GB as recommended. Start with the recommended size.

    Any provider works. When it is created you will have an IP address and a way to log in over SSH, usually as root or as a user that can run sudo.

    Where to run it

    Open-source agents are self-hosted. These are places to run one.

    Affiliate links: we may earn a commission if you sign up, at no cost to you. Partners are hosting providers only, and they have no influence on any ranking or score.

  2. 2.Install Docker

    Log in to the server over SSH, then install Docker Engine and the Compose plugin from Docker's official repository:

    # Add Docker's official GPG key:
    sudo apt update
    sudo apt install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    # Add the repository to Apt sources:
    sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
    Types: deb
    URIs: https://download.docker.com/linux/ubuntu
    Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
    Components: stable
    Architectures: $(dpkg --print-architecture)
    Signed-By: /etc/apt/keyrings/docker.asc
    EOF
    
    sudo apt update
    
    # Install Docker:
    sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

    Check that both are available. If Docker isn't running, start it with sudo systemctl start docker.

  3. 3.Check Docker

    docker --version
    docker compose version
  4. 4.Download Langflow's Compose example

    Langflow's repository includes a Compose file that pulls the latest Langflow image and stores data in PostgreSQL:

    git clone https://github.com/langflow-ai/langflow.git
    cd langflow/docker_example
  5. 5.Set the superuser password

    Official Langflow images require a sign-in, so the Compose file needs a superuser password. Create the .env file with it, replacing SUPERUSER_PASSWORD with a strong password:

    echo 'LANGFLOW_SUPERUSER_PASSWORD=SUPERUSER_PASSWORD' > .env
  6. 6.Start Langflow

    From the docker_example folder (add sudo in front if your user isn't in the docker group):

    docker compose up

    Langflow's guide starts it in the foreground, which is useful the first time because you can watch it start. To keep it running after you close your SSH session, stop it with Ctrl+C and start it in the background instead:

    docker compose up -d
  7. 7.Sign in

    Open http://<your server's IP address>:7860 in a browser and sign in with the username langflow and the password you set in step 5.

    This setup serves Langflow over plain HTTP. Use it for yourself first, and add HTTPS (below) before you share the address or call its API from elsewhere.

Add HTTPS

Langflow's documentation shows how to put Langflow behind Caddy, a web server that obtains and renews HTTPS certificates for your domain. See its Caddy deployment page, linked below.

Updating

Langflow's upgrade guide says to keep data on persistent volumes, so an upgrade only replaces the container image, and to read its notes before switching images. Follow the "Upgrade the Langflow Docker image" section linked below, and back up first.

Backups

Your flows are stored in the PostgreSQL database volume that the Compose file creates. Back that volume up along with the .env file.

Sources

Every command above is taken from these pages. If a step has changed, they are the authority.