Open WebUI is a ChatGPT-like web interface; Ollama runs the language models on the graphics card behind it. The result is your own AI chat on a GPU-VPS: neither prompts nor documents leave your server, and you don't pay per token.
Prerequisites #
- A GPU-VPS with Ubuntu 24.04 or 26.04 LTS and SSH access with
sudorights. - For HTTPS access, a domain or subdomain whose
Arecord points to the server's IP address.
The commands run as a regular user with sudo. If you are logged in as root, leave out sudo.
Which model to choose #
The model has to fit entirely into the graphics card's memory (VRAM); otherwise the CPU takes over part of the work and answers slow down a lot. The sizes assume Ollama's default quantization and leave room for the context.
| GPU-VPS | VRAM | Suitable models |
|---|---|---|
| RTX 3090 / RTX 4090 | 24 GB | gpt-oss:20b, gemma3:27b, qwen3:30b, mistral-small3.2 |
| 2 × RTX 3090 | 48 GB | the same with a longer context, llama3.3:70b |
| RTX PRO 6000 Blackwell | 96 GB | gpt-oss:120b, llama3.3:70b with a long context |
From 48 GB of VRAM, Ollama sets a context of up to 256,000 tokens by default. With llama3.3:70b on 2 × RTX 3090 it then no longer fits in the GPU memory and the CPU takes over part of the work. Set a shorter context, for example Environment="OLLAMA_CONTEXT_LENGTH=8192" with sudo systemctl edit ollama, and check with ollama ps that the model runs fully on the GPU.
The current models and their sizes are listed in the Ollama library.
Installation #
Graphics card driver
-
Check that the system sees the card:
nvidia-smiIf the output shows the card's name and the driver version, continue with installing Ollama.
-
If the command doesn't exist, install the recommended server driver and restart the server:
sudo apt update sudo apt install -y ubuntu-drivers-common sudo ubuntu-drivers install --gpgpu sudo reboot -
After the restart, run
nvidia-smiagain.
The RTX PRO 6000 Blackwell needs driver 570 or newer with the open kernel modules (the package with -open in its name). ubuntu-drivers picks it on its own; just check that nvidia-smi lists the card.
Ollama
-
Install Ollama with the official script. It registers Ollama as a systemd service and finds the NVIDIA driver by itself:
sudo apt install -y curl zstd curl -fsSL https://ollama.com/install.sh | sh -
Download a model from the table above and try it in the terminal:
ollama pull gemma3:27b ollama run gemma3:27b "Write one sentence about Prague."
Ollama listens only on 127.0.0.1:11434, that is, only inside the server.
Never expose port 11434 to the internet. The Ollama API has no login, and anyone could use your graphics card.
Open WebUI
-
Install Docker from the official repository following the Docker and Docker Compose installation tutorial.
-
Start Open WebUI:
sudo docker run -d --network=host \ -e OLLAMA_BASE_URL=http://127.0.0.1:11434 \ -e HOST=127.0.0.1 -e PORT=3000 \ -v open-webui:/app/backend/data \ --name open-webui --restart always \ ghcr.io/open-webui/open-webui:main -
Check that the interface listens only locally:
sudo ss -tlnp | grep 3000The output should show
127.0.0.1:3000. The first start takes a minute or two while it downloads the files it needs.
The container runs in the host's network (--network=host) so that it can reach Ollama on 127.0.0.1. Docker therefore opens no port to the internet and doesn't bypass the firewall rules.
Accessing the interface #
Make the interface available through Nginx with a Let's Encrypt certificate.
-
Install Nginx and Certbot:
sudo apt install -y nginx certbot python3-certbot-nginx -
Create the file
/etc/nginx/sites-available/open-webui:server { listen 80; server_name <domain>; client_max_body_size 100M; location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; proxy_read_timeout 300s; } }Replace
<domain>with the domain pointing to the server, for exampleai.example.com. -
Enable the site and issue the certificate:
sudo ln -s /etc/nginx/sites-available/open-webui /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx sudo certbot --nginx -d <domain> -
If you use the UFW firewall, allow HTTP and HTTPS:
sudo ufw allow 'Nginx Full'
The interface is then at https://<domain>. More on certificates in Setting Up Let's Encrypt with Nginx Server, on the firewall in Setting up firewall with UFW on linux.
Without a domain and without opening any ports, reach the interface through an SSH tunnel from your computer:
ssh -L 3000:127.0.0.1:3000 <user>@<server-ip>
Replace <user> with your user on the server and <server-ip> with its IP address. While the connection is open, the interface is at http://localhost:3000 in your browser.
First login #
- Open the interface in your browser and create an account. The first registered account becomes the administrator, so do this right after starting it.
- In Admin Panel → Settings → General, turn off Enable New Sign Ups unless you want other people to register. You then create accounts for colleagues yourself in Admin Panel → Users.
- Pick the model you downloaded with Ollama at the top and ask your first question.
Checking that the model runs on the GPU #
While a reply is being generated, run on the server:
ollama ps
The PROCESSOR column should say 100% GPU. If you see a CPU share (for example 30%/70% CPU/GPU), the model doesn't fit into VRAM. Choose a smaller model. nvidia-smi shows the card's load too.
Updates #
Update Ollama by running the install script again and Open WebUI with a new container image. The data (accounts, conversations) stays in the open-webui volume.
curl -fsSL https://ollama.com/install.sh | sh
sudo docker pull ghcr.io/open-webui/open-webui:main
sudo docker rm -f open-webui
sudo docker run -d --network=host \
-e OLLAMA_BASE_URL=http://127.0.0.1:11434 \
-e HOST=127.0.0.1 -e PORT=3000 \
-v open-webui:/app/backend/data \
--name open-webui --restart always \
ghcr.io/open-webui/open-webui:main
Want your own private AI chat? #
Configure your GPU-VPS and get Ollama with Open WebUI running today.