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:1b is 1.3 GB and llama3.2:3b is 2 GB.
  • The Extreme plan (4 vCPU, 8 GB) for 7B and 8B models, such as llama3.1:8b at 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:

bash
curl http://127.0.0.1:8080/health

Open WebUI's first start takes a few minutes. Then:

  1. Open an SSH tunnel from your computer:

    bash
    ssh -L 8080:127.0.0.1:8080 root@203.0.113.10

    Leave it open, browse to http://localhost:8080, and log in with the email and password from cat /root/open-webui-admin.txt.

  2. Change the admin's email and password in Open WebUI's account settings.

  3. Chat with llama3.2:3b, or download another model that fits your plan:

    bash
    ollama pull llama3.2:1b
  4. For 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:

bash
vps9-https ai.example.com

It 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:

bash
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2:3b

Then 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:

bash
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:main

The 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:

bash
curl -fsSL https://ollama.com/install.sh | sh

Update 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:

bash
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:main

We 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.

bash
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 with ollama 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.

Be first when orders open

Join the waitlist and we'll send you one email when VPSNine launches. Pick a plan if you already know which one you want, and we'll size the first servers around it.

  • One email, on launch day
  • Monthly or yearly, no lock-in
  • 14-day money-back guarantee