Skip to content

Langfuse

Langfuse is an open source LLM engineering platform. It helps teams collaboratively develop, monitor, evaluate, and debug AI applications.

Install Langfuse

  1. Follow the Langfuse installation guide to set up the self-hosted Langfuse requirements including the .env file.
  2. Create ls-net network with following command:

docker network inspect ls-net >/dev/null 2>&1 || docker network create ls-net
3. Add the following ls-net external network to the Langfuse project's docker-compose.yml file:

```yaml
services:
  langfuse-worker:
    image: docker.langfuse.com/langfuse/langfuse-worker:4
    restart: always
    depends_on: &langfuse-depends-on
    postgres:
      condition: service_healthy
    minio:
      condition: service_healthy
    redis:
      condition: service_healthy
    clickhouse:
      condition: service_healthy
    ports:
      - 127.0.0.1:3030:3030
    environment: &langfuse-worker-env
    NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}

... SKIP ...

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 3000 --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=langfuse-web
    BACKEND_PORT=3000
    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.

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.