Running your own LLM on a VPS in India keeps prompts and documents on a server you control, inside the country, with no per-token bill. This guide sets up Ollama (the model runner) and Open WebUI (a ChatGPT-style interface) on Ubuntu 24.04, behind HTTPS, in about 20 minutes.
1. Size the server for the model
Without a GPU, Ollama runs models on the CPU, and RAM decides what fits. A 4-bit quantised model needs very roughly 0.6 to 0.7 GB of RAM per billion parameters, plus room for the system and context:
| Model size | Example models | RAM to plan for |
|---|---|---|
| 3B to 4B | Llama 3.2 3B, Gemma 3 4B | 8 GB |
| 7B to 8B | Qwen 2.5 7B, Llama 3.1 8B | 16 GB |
| 14B | Qwen 2.5 14B | 32 GB |
| 30B and up | larger open-weight models | 64 GB or more |
More vCPU cores mean faster replies. For fast interactive answers from 70B-class models you need a GPU.
2. Install Ollama
sudo apt update && sudo apt -y upgrade curl -fsSL https://ollama.com/install.sh | sh ollama pull qwen2.5:7b ollama run qwen2.5:7b "Explain GST input credit in two lines" The installer creates a systemd service. By default the API listens only on 127.0.0.1:11434. Keep it that way: an open Ollama port lets anyone on the internet use your server.
3. Install Open WebUI with Docker
curl -fsSL https://get.docker.com | sh sudo docker run -d --network=host \ -e OLLAMA_BASE_URL=http://127.0.0.1:11434 \ -v open-webui:/app/backend/data \ --name open-webui --restart always \ ghcr.io/open-webui/open-webui:main With host networking, Open WebUI listens on port 8080 and reaches Ollama on localhost.
4. Add HTTPS with Caddy
Point a DNS record (for example ai.example.com) at your VPS IP, then:
sudo apt -y install caddy echo 'ai.example.com { reverse_proxy 127.0.0.1:8080 }' | sudo tee /etc/caddy/Caddyfile sudo systemctl reload caddy Caddy fetches a Let's Encrypt certificate on its own.
5. Lock down the firewall
sudo ufw default deny incoming sudo ufw allow 22/tcp sudo ufw allow 80,443/tcp sudo ufw enable Ports 8080 and 11434 stay closed to the internet. Open https://ai.example.com, create the first account (it becomes the admin), and turn off open sign-ups in the admin settings.
6. Keep it healthy
-
ollama psshows loaded models and memory use. -
journalctl -u ollama -fshows Ollama logs. - Update Open WebUI:
sudo docker pull ghcr.io/open-webui/open-webui:main, then remove and re-run the container (data stays in the volume).
Where to run it in India
Pick a KVM VPS with dedicated RAM, current CPUs and servers physically in India. Inservers runs KVM VPS on AMD EPYC 7C13 with NVMe at Yotta D1 (Delhi NCR), behind always-on Cloudflare Magic Transit, with plans sized for Ollama from 16 GB to 512 GB RAM: Ollama VPS in India.

