Running a private AI stack on your own infrastructure is no longer just for hyperscalers. A new guide from nuvits details how to deploy Ollama 0.40.18 and Open WebUI v0.13.4 on an Ubuntu 24.04 VPS, eliminating per-token API costs and keeping internal documents off third-party servers. The setup leverages Docker Compose and Caddy for automatic HTTPS, ensuring a production-ready environment for small teams or individual power users.

The CPU-Only Reality Check

Let’s be clear: without a dedicated GPU, you are relying on system RAM and CPU bandwidth. The guide provides a realistic breakdown of model sizes for Q4_K_M quantization. For a 4GB RAM VPS, stick to 1B-3B models like llama3.2:3b. If you have 12GB of RAM, you can comfortably run 7B-8B models such as qwen2.5:7b or llama3.1:8b. An 8B model alone consumes 5-6GB of RAM for weights, leaving little room for the Open WebUI process (~1GB) and the OS if you’re on a tighter 8GB plan.

Security and Configuration Pitfalls

The most common failure point in self-hosted LLMs is exposing the Ollama API port (11434) to the public internet. This guide correctly isolates the Ollama and Open WebUI containers on a private Docker network, with only Caddy binding to ports 80 and 443. Crucially, the configuration enforces WEBUI_SECRET_KEY in the .env file; leaving this empty in Open WebUI v0.13.4 will cause the initialization to abort if authentication is enabled. Additionally, setting OLLAMA_MAX_LOADED_MODELS=1 and OLLAMA_NUM_PARALLEL=1 prevents the server from crashing due to out-of-memory (OOM) errors when multiple requests hit a CPU-only backend.

Deployment and Maintenance

The deployment process is streamlined via Docker Compose, using a healthcheck based on ollama list to ensure the daemon is responsive before the UI starts. Once the stack is up, users must immediately create an admin account and then flip ENABLE_SIGNUP to false in the .env file to lock down public registration. For backups, the guide wisely excludes the massive ollama_data volume (model weights can be re-downloaded) and focuses on securing the .env file and the open_webui_data volume, which contains user accounts, chat history, and RAG embeddings.

Key Takeaways

  • Memory is King: On a CPU-only VPS, 12GB RAM is the sweet spot for running 7B/8B models without constant OOM kills.
  • Hide the API: Never expose port 11434 to the public; use the Open WebUI API gateway with authentication for external access.
  • Secrets Matter: WEBUI_SECRET_KEY is mandatory in v0.13.4; without it, the UI fails to start with auth enabled.
  • Control Concurrency: Limit OLLAMA_NUM_PARALLEL to 1 on low-resource VPS instances to prevent memory spikes.

The Bottom Line

Self-hosting LLMs is finally viable for small-scale production use, but only if you respect the hardware constraints. This guide nails the security defaults that most tutorials miss, making it a solid blueprint for anyone tired of paying API taxes.