SabaKore

Run AI on a VPS / Chat UI

Install Open WebUI on a VPS and use a local LLM from a browser chat

On its own, Ollama is used from a terminal. With Open WebUI you get a ChatGPT-like chat screen in the browser that keeps your history. Here we run it in a single Docker container without exposing it to the outside. This assumes a VPS without a GPU (CPU only).

1Install Docker

On Ubuntu it is available as a package (the official instructions are fine too). Signing up and connecting are the same as step 1 of the Ollama install guide.

sudo apt update && sudo apt install -y docker.io

2Create a secret key

This key protects login sessions. If you don't keep it fixed, everyone is logged out each time the container is recreated.

openssl rand -hex 32

Use the output as YOUR_SECRET_KEY in the next step.

3Start Open WebUI with Ollama

We use Open WebUI's official single container that includes Ollama (CPU-only). The one difference from the official example is -p 127.0.0.1:3000:8080, which makes the UI reachable only from inside the server. Ports published by Docker can bypass the firewall.

sudo docker run -d \
  -p 127.0.0.1:3000:8080 \
  -v ollama:/root/.ollama \
  -v open-webui:/app/backend/data \
  -e WEBUI_SECRET_KEY=YOUR_SECRET_KEY \
  --name open-webui --restart always \
  ghcr.io/open-webui/open-webui:ollama

The two -v lines are where models and chats are stored. Do not remove them, or you will lose data. If startup takes a while, run sudo docker logs -f open-webui and wait for "Application startup complete".

4Open it from your PC (SSH tunnel)

Keep this running on your PC:

ssh -N -L 3000:localhost:3000 USER@SERVER_IP

Open http://localhost:3000 in your browser and create an account with "Create Admin Account". The first person to register becomes the admin, and sign-up then closes automatically.

5Download a model and start chatting

Have the Ollama inside the container download a model. Start with a small one (see the plan finder).

sudo docker exec -it open-webui ollama pull llama3.2:3b

Then pick the model in the chat screen. Stop it with sudo docker stop open-webui and start it again with sudo docker start open-webui.

6Updates and backups

Chat history, accounts and settings are stored in the open-webui volume from step 3. They survive recreating the container, but the official docs recommend backing up before updates and regularly.

# Run in your home directory (cd ~); creates openwebui-DATE.tar.gz there
sudo docker run --rm -v open-webui:/data -v $(pwd):/backup \
  alpine tar czf /backup/openwebui-$(date +%Y%m%d).tar.gz /data

Also copy the file to your PC so it survives if the VPS becomes unavailable (run on your PC; replace the date in the file name).

scp USER@SERVER_IP:~/openwebui-20261030.tar.gz .

To update, remove the container, pull the new image and start it again with the same command as step 3 (with the same secret key). Data stays in the volume.

sudo docker rm -f open-webui
sudo docker pull ghcr.io/open-webui/open-webui:ollama
# then run the docker run command from step 3 again

Restoring a backup replaces the volume's contents, so check the file first. Models are in the ollama volume and can be downloaded again if lost. For pinning versions, see the official update guide.

FAQ

How much extra memory does it need?

The chat UI needs memory on top of the model. We do not measure it, so we cannot give a number. For headroom, choose one plan up from the smallest one the model fits on.

I already installed Ollama. Can I use it?

These steps use a single container that includes Ollama. Your existing Ollama and models are not shared, so you download models again in the chat UI. Setups that use an existing Ollama exist, but they require making Ollama reachable from outside, which we do not recommend (per the official notes).

I want others to use it too.

An SSH tunnel only works for people who can log in to the server. For several users, put a reverse proxy with HTTPS and password authentication in front. That means opening a port, so check the configuration carefully.

Will updating delete my chat history?

No. History and accounts are stored in a volume (open-webui) outside the container. But if you restart without the -v line in docker run, the saved data is not loaded and it starts empty. Take a backup before updating, just in case.

Plans that suit this use

The steps use Llama 3.2 3B. For more natural writing, an 8B model is the next candidate.

Open WebUI runs on the same VPS as Ollama, so it uses memory on top of the model. One plan up from the estimates below is safer.

Llama 3.2 3B

~3.5 GB memory · ollama run llama3.2:3b

  1. KAGOYA CLOUD VPS4 GB · ¥1,760/mo
  2. ABLENET VPS4 GB · ¥2,167/mo
  3. ConoHa VPS4 GB · ¥2,189/mo

Llama 3.1 8B

~6.4 GB memory · ollama run llama3.1:8b

  1. ABLENET VPS8 GB · ¥2,936/mo
  2. KAGOYA CLOUD VPS8 GB · ¥3,410/mo
  3. ConoHa VPS12 GB · ¥4,389/mo

Cheapest first. This compares fit and monthly price only, not speed. Affiliate programs have no effect on the order.

The commands are based on Open WebUI's official quick start (only the published port range is changed). Things may change between versions, so check the official docs if something does not work.