Docker is the recommended and most widely supported way to run AnythingLLM in production. A singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Mintplex-Labs/anything-llm/llms.txt
Use this file to discover all available pages before exploring further.
docker run command pulls the official image, mounts a local storage folder for persistence, and starts the server on port 3001. The image supports both amd64 and arm64 CPU architectures, works on Linux, macOS, and Windows, and includes everything AnythingLLM needs — no separate database server, no build step, no dependency management required.
Requirements
- Docker v18.03+ on Mac/Windows, or Docker v20.10+ on Linux
- At least 2 GB of RAM available to the container
- 10 GB of free disk space (more if storing large document sets or local models)
- Access to an LLM — a local model via Ollama or an API key from a cloud provider
Pull the Image
latest tag always points to the most recent stable release.
Running the Container
http://localhost:3001 in your browser to complete the setup wizard.
Volume Mounts and Data Persistence
The two mounts in thedocker run command are essential for keeping your data safe across container restarts and image upgrades:
| Mount | Purpose |
|---|---|
${STORAGE_LOCATION}:/app/server/storage | Persists your SQLite database, uploaded documents, vector indexes (LanceDB), and locally cached models |
${STORAGE_LOCATION}/.env:/app/server/.env | Persists your environment configuration so settings survive container recreation |
anythingllm_storage achieves the same persistence. Update the device: path under driver_opts to point to the directory on your host where you want data stored.
Port Mapping
AnythingLLM’s server listens on port3001 inside the container. The -p 3001:3001 flag maps that to port 3001 on your host. To use a different host port (e.g. 8080), change the left side of the mapping:
SERVER_PORT environment variable — but in most cases the default is fine.
Key Environment Variables
The full list of supported variables is indocker/.env.example. The most important ones are:
| Variable | Default | Description |
|---|---|---|
SERVER_PORT | 3001 | Port the server listens on inside the container |
STORAGE_DIR | /app/server/storage | Absolute path to the storage directory inside the container |
UID | 1000 | User ID the container process runs as |
GID | 1000 | Group ID the container process runs as |
JWT_SECRET | (unset) | Secret used to sign session tokens — set a long random string in production |
AUTH_TOKEN | (unset) | Single-user password for remote/cloud deployments |
DISABLE_TELEMETRY | false | Set to true to opt out of anonymous usage telemetry |
LLM_PROVIDER | (unset) | LLM backend to use (e.g. openai, ollama, anthropic) |
VECTOR_DB | lancedb | Vector database backend (e.g. lancedb, pinecone, chroma) |
EMBEDDING_ENGINE | native | Embedding model provider (e.g. native, openai, ollama) |
-e KEY=VALUE flags on the docker run command, or by writing them to the .env file mounted at /app/server/.env.
LLM Provider Examples
About UID and GID
Connecting to Host Services
If you run a local LLM or vector database on your host machine, usehost.docker.internal instead of localhost in URLs:
--add-host=host.docker.internal:host-gateway to your docker run command to enable this hostname. Alternatively, use http://172.17.0.1:11434 which is the default Docker bridge gateway on Linux.
GPU Support
AnythingLLM itself does not perform GPU inference — the LLM runs in a separate process (e.g. Ollama or LM Studio on the host). If you’re using the built-in local embedder or Whisper transcription and want GPU acceleration, you can pass GPU devices to the container:--gpus all flag requires NVIDIA Container Toolkit to be installed on the host.
Building from Source
For development or custom builds, you can build the image locally:Troubleshooting
API not working / can’t log in on a remote server? If AnythingLLM is running on a remote machine (e.g. EC2 at192.168.1.222), you need to set VITE_API_BASE before building:
docker-compose up -d --build.
Ollama errors (ECONNREFUSED)?
Make sure you’re using http://host.docker.internal:11434 as the Ollama base path — not localhost or 127.0.0.1. On Linux, ensure --add-host=host.docker.internal:host-gateway is in your docker run command.
Need help? Join the Discord community.