Skip to content

How to Install Open WebUI on Ubuntu 24.04 (Self-Hosted ChatGPT Alternative)

Install Open WebUI on Ubuntu 24.04, connect it to Ollama, vLLM or llama.cpp, and run a private ChatGPT-style chat behind Nginx and HTTPS.

Category
AI & LLMs
Covers
Docker, Nginx, Ubuntu
On this page

Open WebUI is a self-hosted chat interface for local and remote language models. It looks and feels like ChatGPT, but it runs on your own server: it supports multiple user accounts, chat history, document upload (RAG), web search and model switching, and it connects to Ollama or to any OpenAI-compatible API such as vLLM or llama-server.

This guide shows two ways to install Open WebUI on Ubuntu 24.04 LTS (Noble Numbat): with Docker (recommended) or with Python using uv. You’ll then connect it to Ollama, create the admin account and put it behind Nginx with HTTPS.

Prerequisites

Check that Ollama is running and has at least one model:

ollama list

Docker keeps Open WebUI and its dependencies separate from the system and makes updates a two-command job. Ollama listens on 127.0.0.1 by default, so the simplest setup is to run the container on the host network, where it can reach Ollama directly:

docker run -d --network=host 
  -v open-webui:/app/backend/data 
  -e OLLAMA_BASE_URL=http://127.0.0.1:11434 
  --name open-webui --restart always 
  ghcr.io/open-webui/open-webui:main

What the options do:

  • –network=host: the container shares the server’s network, so 127.0.0.1 inside it is the host.
  • -v open-webui:/app/backend/data: stores users, chats and settings in a Docker volume that survives updates.
  • OLLAMA_BASE_URL: where Open WebUI finds Ollama.
  • –restart always: starts the container again after a reboot.

With host networking, Open WebUI listens on port 8080. Check the container is up:

docker ps
docker logs -f open-webui

Note: If you prefer port mapping (-p 3000:8080) instead of host networking, Ollama must listen on an address the container can reach. Set OLLAMA_HOST=0.0.0.0 as shown in the Ollama guide, firewall port 11434, and use –add-host=host.docker.internal:host-gateway -e OLLAMA_BASE_URL=http://host.docker.internal:11434.

Method 2: Install Open WebUI with Python (uv)

Open WebUI’s documentation recommends Python 3.11. Ubuntu 24.04 ships Python 3.12, so use uv, which downloads the right Python version for you without touching the system one:

curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc

Start Open WebUI. DATA_DIR keeps your data in a fixed folder; without it, data could end up in a temporary cache:

DATA_DIR=~/.open-webui uvx --python 3.11 open-webui@latest serve

The first start downloads packages and takes a few minutes. Open WebUI then listens on port 8080 and finds Ollama on 127.0.0.1:11434 automatically. To keep it running in the background, create a systemd service that runs the same command as your user.

Create the Admin Account

Open http://your-server-ip:8080 in a browser (or http://localhost:8080 on a desktop). Click Get started and create an account. The first account becomes the administrator, so do this immediately after installation, before anyone else can reach the page.

Pick a model from the drop-down at the top of the chat window and send a message. If the list is empty, open Admin Panel → Settings → Connections and check the Ollama URL.

Connect vLLM, llama.cpp or a Cloud API

Open WebUI can use several backends at once. In Admin Panel → Settings → Connections, add an OpenAI API connection with the base URL and key of the server:

BackendBase URL
vLLMhttp://127.0.0.1:8000/v1
llama-serverhttp://127.0.0.1:8080/v1 (change one of the two ports if both run on this host)
OpenAI or another hosted APIThe provider’s API URL and your API key

Put Open WebUI Behind Nginx with HTTPS

For access from the internet, keep port 8080 closed and publish Open WebUI through Nginx. Open WebUI streams answers over WebSockets, so the proxy must pass the upgrade headers. Install Nginx and create a site file:

sudo apt install nginx -y
sudo nano /etc/nginx/sites-available/openwebui
server {
    listen 80;
    server_name chat.example.com;
    client_max_body_size 50M;

    location / {
        proxy_pass http://127.0.0.1:8080;
        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_read_timeout 300s;
    }
}
sudo ln -s /etc/nginx/sites-available/openwebui /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

Then add a free certificate with Certbot:

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d chat.example.com

Finally, allow only SSH and web traffic through the firewall so port 8080 isn’t reachable directly:

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable

Note: Docker publishes ports with -p through its own iptables rules, which bypass UFW. With the host-network setup above this doesn’t apply, but if you switch to -p 3000:8080, bind it to localhost with -p 127.0.0.1:3000:8080.

Update Open WebUI

Docker: pull the new image, remove the old container and start it again with the same command. Your data stays in the open-webui volume:

docker pull ghcr.io/open-webui/open-webui:main
docker stop open-webui
docker rm open-webui

Then re-run the docker run command from Method 1. Python (uvx): the open-webui@latest part fetches the newest release each time you start it.

Troubleshooting

  • No models in the list: run curl http://127.0.0.1:11434/api/tags on the server. If that works, the URL in Settings → Connections is wrong.
  • Answers never appear behind Nginx: the WebSocket headers (Upgrade and Connection) are missing from the proxy config.
  • Forgot the admin password: see the password reset steps in the Open WebUI documentation.

Conclusion

Open WebUI now gives your team a private, ChatGPT-style interface on Ubuntu 24.04, backed by models that run on your own hardware. Use the LLM VRAM calculator to choose models that fit your GPU, and see vLLM when many people use it at the same time.

Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top