Skip to content

Langflow

Langflow is a platform for building and deploying AI-powered agents and workflows. It provides a visual authoring experience, built-in API and MCP servers that turn workflows into tools for integration with applications built on any framework or stack, and support for major LLMs, vector databases, and AI tools.

Install Langflow

  1. Follow the Langflow installation guide.
  2. Install Langflow using either the Docker or Python package method.
  3. Start the Langflow service.
  4. Access Langflow on port 7860.
  1. Follow the Langflow installation guide to set up the self-hosted Langflow requirements, including the .env file.
  2. Define LANGFLOW_SUPERUSER_PASSWORD in .env.
  3. Add the following ls-net external network to the Langflow project’s docker-compose.yml file:

    services:
      langflow:
        image: langflowai/langflow:latest
        container_name: langflow
        restart: unless-stopped
        ports:
          - "7860:7860"
        environment:
          LANGFLOW_AUTO_LOGIN: "false"
          LANGFLOW_SUPERUSER_PASSWORD: ${LANGFLOW_SUPERUSER_PASSWORD:?set LANGFLOW_SUPERUSER_PASSWORD in .env}
        volumes:
          - langflow-data:/app/langflow
    
    volumes:
      langflow-data:
    
    networks:
      default:
        name: ls-net
        external: true
    

Set up OpenLiteSpeed proxy with AutoSSL

The easiest way to install OpenLiteSpeed, configure it as a reverse proxy, and enable AutoSSL is to use the ols1clk script.

Before continuing, ensure that your domain points to the server.

Replace www.example.com with your domain name, and run the following command:

bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh) --proxy-c --proxy-port 7860 --autocert --sitedomain www.example.com

This command automatically:

  1. Download the ols-proxy-docker-env repository:

    git clone https://github.com/litespeedtech/ols-proxy-docker-env
    cd ols-proxy-docker-env
    
  2. Copy the example environment file:

    cp .env.example .env
    
  3. Edit .env with your configuration values:

    OLS_IMAGE=litespeedtech/openlitespeed:latest
    BACKEND_IP=langflow
    BACKEND_PORT=7860
    DOMAIN=www.example.com
    PROXY_METHOD=context
    PROXY_SOCKET=false
    ACME_EMAIL=admin@example.com
    
  4. Start the proxy:

    docker compose up -d
    

Verify the proxy configuration

Open https://www.example.com in a browser. The application interface should load through OpenLiteSpeed over HTTPS.

Warning

After verifying the configuration, restrict public access to port 7860 using your firewall. Alternatively, you can configure the service to listen on 127.0.0.1 only, so port 7860 is not publicly accessible.

Optional settings

You can further enhance your site's security by enabling additional security features in the .env file, such as:

These other security features can be configured through the WebAdmin Console:

See the OpenLiteSpeed Security Guide for more information.

Warning

Some security features may interfere with application services or block legitimate requests. Test these settings thoroughly before applying them in a production environment.