# Self-host AnythingLLM

> Application for chatting with your own documents: it connects to local or cloud language models, ingests documents into workspaces, and runs as a desktop app or as a Docker server with multi-user support. Run your own AnythingLLM on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

_Updated November 23, 2026_

Running your own AnythingLLM usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make AnythingLLM behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

## Just ask your agent

Open a Plus workspace (AnythingLLM runs in Docker, which Plus and Pro include), tap **Launch** to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

```text
Set up AnythingLLM on this workspace and give me the link. Follow https://envhaven.com/self-host/anythingllm.md
```

Then open the link it sends and create your AnythingLLM account straight away, before anyone else finds the address. That is the whole request: the address in it is this page's Markdown copy, and the agent follows the instructions for it further down, with every setting AnythingLLM's docs require.

## Or keep it private with Tailscale

The preview URL puts AnythingLLM on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives AnythingLLM an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace's **Vars** pane as `TS_AUTHKEY`, and ask the agent:

```text
Set up AnythingLLM on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/anythingllm.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
```

- A Tailscale container runs beside AnythingLLM, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
- Anything other services have to reach, such as a webhook, still needs a public address. [Keep self-hosted apps private with Tailscale](https://envhaven.com/guides/self-host-privately-with-tailscale) covers both, and what Tailscale's free plan includes.

| At a glance |  |
| --- | --- |
| What it is | AI chat, models and agent tools |
| License | MIT |
| Runs as | Docker (`mintplexlabs/anythingllm`) |
| Memory | 2GB ([docs](https://docs.anythingllm.com/installation-docker/system-requirements)) |
| Plan that fits | Plus or larger |
| Web port | 3001 |
| Documentation | [docs.anythingllm.com/installation-docker/cloud-docker](https://docs.anythingllm.com/installation-docker/cloud-docker) |

## What your agent takes care of

- **Installing it.** AnythingLLM runs from the official image, `mintplexlabs/anythingllm`, with its data in folders under `~/apps/anythingllm`.
- **Putting it on an HTTPS address.** The workspace's preview URL serves it, and your own domain can too.
- **Locking it down first.** What AnythingLLM's docs say to set before it faces the internet, below.
- **Telling you what to back up**: /app/server/storage (mount a host folder; STORAGE_DIR) and /app/server/.env (mounted from STORAGE_LOCATION/.env) ([docs](https://docs.anythingllm.com/installation-docker/cloud-docker)).

### The settings it needs behind a proxy

- Reverse proxy with TLS: The server speaks plain HTTP on 3001; the docs put NGINX with a Let's Encrypt certificate in front of it. No base-URL or trusted-origin variable is documented. ([docs](https://docs.anythingllm.com/installation-docker/cloud-docker))
- WebSocket upgrade for /api/agent-invocation/: The proxy must pass WebSocket upgrades on the agent protocol path. ([docs](https://docs.anythingllm.com/installation-docker/cloud-docker))
- proxy_buffering off and long timeouts: The example NGINX location disables buffering and caching and sets 605 second timeouts so streamed chat responses are not cut off. ([docs](https://docs.anythingllm.com/installation-docker/cloud-docker))
- `VITE_API_BASE` (bare-metal builds only): Set to /api in frontend/.env before building when serving from a non-localhost address. ([docs](https://github.com/Mintplex-Labs/anything-llm/blob/master/BARE_METAL.md))

### Before it faces the internet

- A fresh instance has no authentication, so anyone who can reach it can use it and change its settings. Enable Password Protect Instance (single user) or Multi-User Mode before exposing it. ([docs](https://docs.anythingllm.com/installation-docker/remote-access))
- Multi-user mode lets you create the first administrator account and cannot be switched back to single-user mode. ([docs](https://docs.anythingllm.com/features/security-and-access))
- For remote hosting AUTH_TOKEN is the application password, and JWT_SECRET (a random string of at least 12 characters) is only needed when AUTH_TOKEN is set. ([docs](https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/.env.example))

## Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

- "Connect it to the API keys in my Vars pane, and make Claude the default model."
- "Add a second user account for my partner, without admin rights."
- "Move AnythingLLM to app.example.com." Add the domain on the dashboard's Domains page with a CNAME to `domains.envhaven.app`, and the agent changes AnythingLLM's address settings to match.
- "Update AnythingLLM to the latest release." It pulls the new image and recreates the container, data kept.

## Instructions for the agent

The agent reads these from the page's Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

```text
Set up AnythingLLM on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, mintplexlabs/anythingllm, starting from the docs' compose file: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/docker-compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- Keep the compose file in ~/apps/anythingllm and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to AnythingLLM's port 3001.
- The preview URL terminates HTTPS in front of AnythingLLM: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/anythingllm.md for the preview URL, as AnythingLLM's docs describe for running behind a proxy; skip any that apply only when AnythingLLM serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/anythingllm.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set AnythingLLM up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.
```

## What to know

- In Docker, AnythingLLM's containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
- On x86 the default LanceDB vector store crashes the server on CPUs without AVX2, and some VPS instance families hide AVX2 from the guest, so check with lscpu inside the VM. The workaround is a non-LanceDB vector database run as a separate service. ([docs](https://docs.anythingllm.com/installation-docker/system-requirements))
- Web page scraping needs the container to run with --cap-add SYS_ADMIN for sandboxed Chromium. ([docs](https://docs.anythingllm.com/installation-docker/cloud-docker))
- The built-in local LLM engine is optional, and without a GPU its models run on the CPU. ([docs](https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md))
- SQLite backs the default image, so the server cannot be scaled out across several containers; the pg image uses PostgreSQL with PGVector instead. ([docs](https://docs.anythingllm.com/installation-docker/available-images))
- A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

## Without a workspace

The manual route, on a server you run:

1. Rent a Linux VPS, secure SSH, and create a user for the app.
2. Install Docker and write a compose file from the official image.
3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
5. Keep the firewall closed except for the proxy, and schedule backups and updates.

AnythingLLM's own [documentation](https://docs.anythingllm.com/installation-docker/cloud-docker) covers each step for its install methods.

## Sources

Facts about AnythingLLM come from its own documentation, checked on 2026-11-23:

- [docs.anythingllm.com/installation-docker/cloud-docker](https://docs.anythingllm.com/installation-docker/cloud-docker)
- [docs.anythingllm.com/installation-docker/system-requirements](https://docs.anythingllm.com/installation-docker/system-requirements)
- [github.com/Mintplex-Labs/anything-llm/blob/master/BARE_METAL.md](https://github.com/Mintplex-Labs/anything-llm/blob/master/BARE_METAL.md)
- [github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md](https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md)
- [docs.anythingllm.com/installation-docker/available-images](https://docs.anythingllm.com/installation-docker/available-images)
- [docs.anythingllm.com/installation-docker/remote-access](https://docs.anythingllm.com/installation-docker/remote-access)
- [docs.anythingllm.com/features/security-and-access](https://docs.anythingllm.com/features/security-and-access)
- [github.com/Mintplex-Labs/anything-llm/blob/master/docker/.env.example](https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/.env.example)

## Keep reading

- [Self-host any app with your agent](https://envhaven.com/self-host)
- [Self-host Open WebUI](https://envhaven.com/self-host/open-webui)
- [Self-host LibreChat](https://envhaven.com/self-host/librechat)
- [Self-host Dify](https://envhaven.com/self-host/dify)
- [Self-host Langflow](https://envhaven.com/self-host/langflow)
- [AI agent hosting](https://envhaven.com/guides/ai-agent-hosting)

Source: https://envhaven.com/self-host/anythingllm
