How to Self-Host AnythingLLM
AnythingLLM is an open-source web app that works like a private ChatGPT for your own material: you add documents to workspaces and it answers from them, with sources. It runs well on a server of your own. This guide covers the hand-built route with Docker, the settings that matter on a public server, and what a prepared server does for you instead.
What you are taking on
On a laptop, the AnythingLLM desktop app needs no setup at all. A server is different: it is reachable from the internet, so it needs a password from the first minute, stable secrets, persistent storage, HTTPS that also carries WebSockets, and someone to apply updates. None of it is hard, but each piece must be right before you upload anything private. The server requirements guide covers sizing.
Option 1: Docker by hand
Step 1: Get a server with Docker
Any Linux server with Docker will do. AnythingLLM's documentation asks for at least 2 GB of memory; it idles at around half a gigabyte, and the rest is for embedding documents and reading web pages. The image is published as mintplexlabs/anythingllm and listens on port 3001.
Step 2: Create the storage folder
Everything AnythingLLM keeps is in one folder, mounted at /app/server/storage: the SQLite database (anythingllm.db) with workspaces, users and chats, the processed documents, the LanceDB vector database, a vector cache, and the downloaded embedding model. Put it on a disk you back up. The official instructions also mount a .env file from the same folder, because that is where AnythingLLM saves the settings you change in its interface.
Step 3: Set a password and the secrets
Four values belong in the container's environment before the first start:
AUTH_TOKENis the login password of a single-user instance. Without it, the first visitor owns the app.JWT_SECRETsigns login sessions. A random string of 32 characters or more.SIG_KEYandSIG_SALTencrypt values AnythingLLM stores in its database. Without them it generates its own at start and keeps them only in the settings file, so losing that file loses them.
Generate each secret with openssl rand -hex 32. Model API keys do not belong here: a value in the container's environment always wins over the settings file, so a key you later change in the interface would revert at the next restart.
Step 4: Run the container
services:
anythingllm:
image: mintplexlabs/anythingllm:latest
restart: always
cap_add:
- SYS_ADMIN
ports:
- "127.0.0.1:3001:3001"
env_file: .env.secrets
environment:
STORAGE_DIR: /app/server/storage
volumes:
- ./storage:/app/server/storage
- ./storage/.env:/app/server/.env
Create the empty storage/.env file before the first start, or Docker creates a folder in its place. SYS_ADMIN lets the built-in Chromium, which reads web pages into a workspace, use its own sandbox.
Step 5: Put HTTPS in front, with WebSockets
Run a reverse proxy on ports 80 and 443 that obtains a certificate and forwards to 127.0.0.1:3001. AnythingLLM's agents talk to the browser over a WebSocket, so the proxy must pass the upgrade; the project's own nginx example sets proxy_set_header Upgrade $http_upgrade and Connection "Upgrade". Caddy does this by default:
ai.example.com {
reverse_proxy 127.0.0.1:3001
}
If chats work but an @agent request hangs, check the WebSocket first.
Step 6: Sign in, connect a model and add your team
Open your address, sign in with AUTH_TOKEN, and choose a model provider; connecting AI models covers the options. Create a workspace and add documents. When other people need access, switch on multi-user mode in Settings > Security: you create the first admin account, and from then on everyone signs in with their own account and role. The security guide covers roles and the chat widget.
To update, pull the new image and recreate the container; AnythingLLM migrates its database at start. Back up the storage folder first, as described in backup and migration.
Option 2: A prepared server
Hosting for AnythingLLM on Flux starts from the same AnythingLLM release with all of the above already done. Every deploy:
- Generates the login password,
JWT_SECRET,SIG_KEY,SIG_SALTand an encryption key once, and stores them in the app's specification, which is encrypted on the network. The panel shows you the password. - Keeps AnythingLLM's settings file, with your model keys, encrypted in storage and in every synced copy, and decrypts it only into memory while AnythingLLM reads it.
- Serves the app over HTTPS on a free
.app.runonflux.ioaddress or your own domain, WebSockets included. - Syncs the storage folder to a standby server that takes over if the first one fails.
- Follows AnythingLLM's stable releases, testing each image, the settings encryption included, before it reaches your app.
Skip the setup with Hosting for AnythingLLM on Flux, or read how big a server you need first.
Frequently Asked Questions
Can I run AnythingLLM without Docker?
Yes. AnythingLLM publishes a desktop app for one person on one computer, and its repository documents a bare-metal install from source. Docker is the supported way to run it as a server, and the multi-user mode and the chat widget exist only in the Docker version.
What happens if I do not set AUTH_TOKEN?
A fresh AnythingLLM has no password. Whoever reaches the address first can use it and set one. On a server that is reachable from the internet, set AUTH_TOKEN before the first start, or keep the port private until you have signed in.
Why does the official command add SYS_ADMIN?
AnythingLLM reads web pages with a built-in Chromium browser, and Chromium’s own sandbox needs that capability inside a container. Without it, the browser can run with its sandbox switched off, which is what our image does, because Flux gives containers no extra capabilities.
Where does AnythingLLM keep its settings?
In a .env file next to the server, which the app writes whenever you change a setting in its interface. Model API keys are stored there in plain text by default. Our image keeps that file encrypted in the storage folder instead.
Does the prepared server run the official image?
It runs the official AnythingLLM release with one addition: a small program that keeps the settings file encrypted at rest. Nothing else in AnythingLLM is changed, and the image is rebuilt and tested for each stable release.
Who supports AnythingLLM itself?
Mintplex Labs documents AnythingLLM at docs.anythingllm.com. Our support covers the server, deployment, billing and domains on Hosting for AnythingLLM, not AnythingLLM’s own features.
AnythingLLM is open-source software (MIT) and a trademark of Mintplex Labs (https://github.com/Mintplex-Labs/anything-llm). Flux is not affiliated with or endorsed by Mintplex Labs.