How to Deploy AnythingLLM on a VPS
Updated Aug 2026
verified on Ubuntu 26.04 · Aug 2026Self-host AnythingLLM on your own VPS — an all-in-one AI workspace with document management, multi-model support, and team collaboration features.
- A VPS with 4+ GB RAM (8 GB recommended with a 7B model backend)
- A fresh Ubuntu 26.04 server with root/sudo SSH access
- Optional: Ollama running on the same server or accessible remotely
What AnythingLLM is
AnythingLLM is an all-in-one AI workspace that combines a chat interface with document management, vector storage, and multi-model support. Unlike simpler chat tools, AnythingLLM treats your documents as first-class citizens — you upload files, they get embedded and indexed, and then you can chat with your data, ask questions about specific documents, or build knowledge bases that span hundreds of files.
The appeal is unified AI workflow. Instead of separate tools for chat, document indexing, and knowledge management, AnythingLLM does it all in one interface. It connects to Ollama, OpenAI, Anthropic, and other backends, so you can mix models for different tasks — use a small local model for quick questions and a larger cloud model for complex analysis.
For teams, AnythingLLM adds collaboration features: shared workspaces, user management, and document permissions. It's the self-hosted alternative to tools like ChatGPT's custom GPTs or Microsoft Copilot, but with full control over your data and no per-seat licensing.
Server sizing — memory depends on your backend
AnythingLLM itself is a Node.js application with a SQLite database and vector storage. It's not compute-intensive, but the vector embeddings and model backend decisions affect sizing significantly.
AnythingLLM alone (with a remote backend):
- 2 GB RAM — handles the web UI, document management, and API calls to a remote model
- 4 GB RAM — comfortable for large document collections and multiple users
With Ollama on the same box: Add the Ollama requirements. A 7B model needs ~8 GB for Ollama, so plan for 12-16 GB total.
Vector storage considerations: AnythingLLM uses a local vector database (ChromaDB by default) that stores embeddings in the data volume. Each document chunk creates a vector, so a large document collection can grow to several GB. The vectors are in-memory during indexing, so RAM spikes during bulk uploads.
The practical minimum is 4 GB RAM if you're using a remote model backend, and 16 GB RAM if you're running Ollama locally with a 7B model. A Hetzner CX22 (2 vCPU / 4 GB) works for remote-backend setups; combine with a CX42 (8 vCPU / 16 GB) for local Ollama.
Prepare the server
Start from a fresh Ubuntu 24.04 or 26.04 server. Update and create a non-root user:
apt update && apt upgrade -y
adduser deploy
usermod -aG sudo deploy
Lock down the firewall:
ufw allow OpenSSH
ufw allow 80
ufw allow 443
ufw enable
Install Docker:
curl -fsSL https://get.docker.com | sh
usermod -aG docker deploy
Log out and back in as deploy so the docker group takes effect.
Install AnythingLLM
Create a working directory:
mkdir ~/anythingllm && cd ~/anythingllm
Create a compose file:
services:
anythingllm:
image: mintplexlabs/anythingllm:latest
restart: unless-stopped
ports:
- "127.0.0.1:3001:3001"
volumes:
- anythingllm_data:/app/server/storage
- anythingllm_uploads:/app/client/hotdir
environment:
- STORAGE_DIR=/app/server/storage
- JWT_SECRET=$(openssl rand -hex 32)
cap_add:
- SYS_ADMIN
volumes:
anythingllm_data:
anythingllm_uploads:
The JWT_SECRET is auto-generated on first run. For persistence, generate it once and add it to a .env file:
echo "JWT_SECRET=$(openssl rand -hex 32)" > .env
Then reference it in the compose file:
environment:
- STORAGE_DIR=/app/server/storage
- JWT_SECRET=${JWT_SECRET}
Start it:
docker compose up -d
AnythingLLM listens on port 3001. The 127.0.0.1 bind keeps it private.
Connect a model backend
AnythingLLM needs a model backend to generate responses. It supports several options:
Ollama (recommended for self-hosting):
If Ollama is on the same server, AnythingLLM can reach it at http://host.docker.internal:11434. If it's on a different server, use the actual URL.
OpenAI API: If you prefer cloud models, you can use your OpenAI API key. This sends data to OpenAI's servers, so it's not fully self-hosted.
Other backends: AnythingLLM also supports Anthropic, Azure OpenAI, LM Studio, and custom endpoints. See the AnythingLLM docs for configuration details.
To configure the backend:
- Load the AnythingLLM web interface
- Go to Settings → LLM
- Select your provider (Ollama, OpenAI, etc.)
- Enter the connection details
- Select a model
If you're using Ollama, make sure at least one model is pulled:
docker exec -it ollama ollama pull llama3.2
HTTPS + domain
AnythingLLM needs HTTPS for production use. Point a reverse proxy at 127.0.0.1:3001 and terminate HTTPS on 443.
The simplest path is Automatic HTTPS with Caddy. Point an A record for your hostname (say ai.example.com) at the server's public IP, then have Caddy reverse-proxy that hostname to 127.0.0.1:3001.
If you're using the Caddy container approach, put AnythingLLM and Caddy in the same compose file and proxy to the AnythingLLM service name:
reverse_proxy anythingllm:3001
First-run setup
Load https://ai.example.com in your browser. On a fresh install, AnythingLLM shows an onboarding wizard.
Create an admin account immediately. The wizard walks you through:
- Setting an admin email and password
- Choosing a model backend
- Configuring vector database settings
Once you're in:
- Create a workspace — this is a container for documents and conversations. Name it something descriptive (e.g., "Company Docs" or "Project Notes").
- Upload documents — drag and drop files into the workspace. AnythingLLM indexes them automatically, creating vector embeddings for semantic search.
- Start chatting — ask questions about your uploaded documents. The AI retrieves relevant chunks and generates answers based on your data.
Document management
AnythingLLM's strength is document handling. Key features:
Supported formats:
- PDF, DOCX, TXT, CSV, XLSX
- Code files (JS, Python, etc.)
- URLs (scrapes and indexes web pages)
Embedding process: When you upload a document, AnythingLLM:
- Splits it into chunks (typically 500-1000 tokens each)
- Generates vector embeddings for each chunk
- Stores them in the local vector database
- Makes them available for semantic search during chat
Workspace isolation: Each workspace has its own document collection and chat history. Documents in Workspace A aren't accessible from Workspace B, so you can organize content by project or team.
Backups
AnythingLLM stores everything in the data volume:
docker run --rm -v anythingllm_data:/data -v $(pwd):/backup alpine \
tar czf /backup/anythingllm-$(date +%F).tar.gz -C /data .
This backs up your documents, embeddings, chat history, and settings. The backup is self-contained — restore it to a fresh AnythingLLM instance and everything comes back.
The uploads volume contains temporary files during processing and can be skipped in backups.
Upgrades
Pull the newer image and recreate:
docker compose pull
docker compose up -d
AnythingLLM runs database migrations automatically. Check the AnythingLLM changelog for breaking changes before a major version bump.
Troubleshooting
Can't connect to Ollama. Verify Ollama is running (docker compose ps in the Ollama directory) and the URL is correct. If both are on the same server, http://host.docker.internal:11434 should work. Check Docker logs for connection errors.
Document upload fails or hangs. Check disk space — vector embeddings can grow large. Also verify the file isn't corrupted. For large files (>50 MB), try splitting them.
Responses don't match my documents. The model may not be finding the right chunks. Try rephrasing your question, or check that the documents were properly indexed (Workspace → Documents tab shows indexed files).
Out of memory during indexing. Large document collections can spike memory usage. If you're on a small box, index documents in smaller batches rather than uploading everything at once.
"Unauthorized" errors. Your JWT secret may have changed. If you regenerated it, you'll need to log in again with the admin credentials.
Verification + next steps
You're done when you can: load the web interface over HTTPS, create a workspace, upload documents, and get coherent answers about your data. The chat should reference specific documents and provide relevant excerpts.
From here, explore advanced features like custom prompt templates, API access for integration with other tools, and multi-user workspaces with document permissions. For a simpler chat interface, see Open WebUI. For document-based workflows with automation, combine AnythingLLM with n8n. A Hetzner CX22 (2 vCPU / 4 GB) handles the UI with a remote backend; pair with a CX42 (8 vCPU / 16 GB) for local Ollama. See Best VPS for AI & ML Workloads for the ranked picks.