Run Ollama and Open WebUI on a VPS
Run open AI models on your own server with Ollama, chat with them in Open WebUI, and keep both private. CPU only, so small models and modest speeds.
To run Ollama with Open WebUI on a VPS, install Ollama with its official script, pull a model that fits the server's memory, and run Open WebUI's Docker image pointed at Ollama, with both kept on localhost. On VPSNine the Ollama + Open WebUI one-click app does that on the first boot, starts you with a small model, and creates Open WebUI's admin account for you.
Be clear about one thing first: our servers have no GPU. Models run on the CPU, so replies are slow next to ChatGPT or Claude, and the models that fit are small. It suits trying open models privately, a small assistant for yourself, or an API for your own scripts, with prompts that never leave the server.
What you need
- The Standard plan (2 vCPU, 4 GB) or bigger. Standard fits 1B to 3B models next to Open WebUI:
llama3.2:1bis 1.3 GB andllama3.2:3bis 2 GB. - The Extreme plan (4 vCPU, 8 GB) for 7B and 8B models, such as
llama3.1:8bat 4.9 GB. They answer noticeably slower on a CPU. - Realistic expectations. We haven't benchmarked it, and Ollama publishes no CPU figures. Expect the 3B model to be usable for short questions and larger ones to be slow. Longer conversations use more memory and time.
To choose a model, count its download size plus room for its context and for Open WebUI. Ollama's model library lists every model's size.
Install it with the one-click app
Order a server with the Ollama + Open WebUI app. On the first boot we install Ollama with its own script as a systemd service, with its API on 127.0.0.1:11434, and pull llama3.2:3b (about 2 GB). Then we install Docker and run Open WebUI's image listening on 127.0.0.1:8080, with sign-ups off and an admin account created at its first start from a password generated on the server. One-click apps shows how to follow the install.
It's ready when ollama list shows llama3.2:3b and this answers on the server:
curl http://127.0.0.1:8080/healthOpen WebUI's first start takes a few minutes. Then:
Open an SSH tunnel from your computer:
ssh -L 8080:127.0.0.1:8080 root@203.0.113.10Leave it open, browse to
http://localhost:8080, and log in with the email and password fromcat /root/open-webui-admin.txt.Change the admin's email and password in Open WebUI's account settings.
Chat with
llama3.2:3b, or download another model that fits your plan:ollama pull llama3.2:1bFor HTTPS on a domain, allow ports 80 and 443 in the panel firewall and run
vps9-https ai.example.com.
Put it on your domain with HTTPS
Point ai.example.com at the server, then:
vps9-https ai.example.comIt installs Caddy from Caddy's own packages, writes a site for your domain that passes everything to Open WebUI on 127.0.0.1:8080, and reloads Caddy, which gets and renews a Let's Encrypt certificate. Only Open WebUI goes on the domain. Ollama's API stays on 127.0.0.1:11434, because it has no authentication: anyone who reaches it can use your models.
Sign-ups stay off, so the login page on your domain only lets in accounts you create in Open WebUI's admin settings.
Doing it by hand on another server
Install Ollama with its Linux script, which sets it up as a systemd service running as an ollama user:
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2:3bThen run Open WebUI with Docker, following its quick start. Its examples publish port 3000 on every address and reach Ollama through host.docker.internal, which needs Ollama listening beyond localhost. To keep both private instead, do what the one-click app does: run the container on the host network, tell Open WebUI to listen on 127.0.0.1 and to find Ollama there, and keep the settings in a root-only file:
install -d -m 0700 /opt/open-webui
cat > /opt/open-webui/open-webui.env <<EOF
HOST=127.0.0.1
PORT=8080
OLLAMA_BASE_URL=http://127.0.0.1:11434
WEBUI_SECRET_KEY=$(openssl rand -hex 32)
EOF
chmod 600 /opt/open-webui/open-webui.env
docker run -d --name open-webui --restart always --network host --env-file /opt/open-webui/open-webui.env -v open-webui:/app/backend/data ghcr.io/open-webui/open-webui:mainThe first account created in Open WebUI becomes its admin, so open it through an SSH tunnel and create that account before you put a reverse proxy in front.
Updates and backups
Update Ollama by running its install script again:
curl -fsSL https://ollama.com/install.sh | shUpdate Open WebUI by pulling the image and re-creating the container with the same volume and the same settings file, which keeps the same secret key so nobody is logged out:
docker pull ghcr.io/open-webui/open-webui:main
docker rm -f open-webui
docker run -d --name open-webui --restart always --network host --env-file /opt/open-webui/open-webui.env -v open-webui:/app/backend/data ghcr.io/open-webui/open-webui:mainWe turn on the operating system's automatic security updates; they don't update Ollama or Open WebUI.
Back up the open-webui Docker volume, which holds chats, users and settings. Models don't need backing up, since you can download them again.
docker run --rm -v open-webui:/data -v /root:/backup alpine tar czf /backup/open-webui-$(date +%F).tgz -C /data .Copy the archive off the server; Backups you should run shows how to do it nightly.
When it goes wrong
- A model won't load, or the server runs out of memory: the model is too big for the plan. Check what's loaded with
ollama ps, remove models you don't use withollama rm <model>, and pick one whose size, plus room for its context and Open WebUI, fits in memory. On Standard, stay with 1B to 3B models. - Replies are slow: that's a CPU doing the work. Smaller models answer faster, and longer conversations use more memory and time, so start a new chat rather than continuing a very long one. Bigger plans fit bigger models, but they won't be fast either.
- You want your own scripts to use the models: don't open port 11434 in any firewall. Ollama's API has no authentication. Reach it through an SSH tunnel,
ssh -L 11434:127.0.0.1:11434 root@203.0.113.10, or use Open WebUI's API with keys you create in its settings.
If you'd rather have an assistant that calls a hosted model from your own server, see Run OpenClaw on a VPS securely.