Skip to content

AnythingLLM

AnythingLLM is an all-in-one AI application that lets you build a private, fully-featured ChatGPT. Connect your favorite local or cloud LLM, ingest your documents, and start chatting in minutes. Out of the box, you get built-in agents, multi-user support, vector databases, and document pipelines with no extra configuration required.

Install AnythingLLM

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

    name: anythingllm
    
    services:
    anything-llm:
      container_name: anythingllm
      build:
        context: ../.
        dockerfile: ./docker/Dockerfile
        args:
          ARG_UID: ${UID:-1000}
          ARG_GID: ${GID:-1000}
      cap_add:
        - SYS_ADMIN
      volumes:
        - "./.env:/app/server/.env"
        - "../server/storage:/app/server/storage"
        - "../collector/hotdir/:/app/collector/hotdir"
        - "../collector/outputs/:/app/collector/outputs"
      user: "${UID:-1000}:${GID:-1000}"
      ports:
        - "3001:3001"
      env_file:
        - .env
      networks:
        - anything-llm
        - ls-net
      extra_hosts:
        - "host.docker.internal:host-gateway"
    
    networks:
      anything-llm:
        driver: bridge
      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 3001 --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=anythingllm
    BACKEND_PORT=3001
    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 3001 with your firewall.

Optional settings

You can further enhance your site's security by enabling features such as:

  • OWASP protection
  • reCAPTCHA
  • Per-client throttling
  • Realm protection
  • IP Allow/Deny

See the OpenLiteSpeed Security Guide for more information.