Guide to Installing Open WebUI and Ollama on Linux VPS
Detailed guide on installing Open WebUI and Ollama on Ubuntu Linux VPS using Docker Compose, from installing Docker and downloading AI models to configuring firewalls and accessing the AI web interface in your browser.
Open WebUI combined with Ollama allows you to build a private AI system right on your VPS, featuring a chat interface similar to ChatGPT. You can run AI models such as Llama, Qwen, Gemma, and many others without being completely dependent on external AI services.
In this article, we will installOllama + Open WebUI on Ubuntu 22.04 or Ubuntu 24.04 VPS.
1. What Is Open WebUI?
Open WebUI is an open-source, self-hosted web interface platform (running on a server or personal computer) that allows users to interact visually with large language models (LLMs) just like ChatGPT
2. What is Ollama?
Ollama is open-source software that lets you easily download, install, and run large language models (AI) right on your personal computer. You can use well-known AI models such as Llama, Gemma, or DeepSeek completely offline without sending data to the cloud
3. Guide to Installing Open WebUI and Ollama
1. System update
First, SSH into the VPS and update system packages:
apt update && apt upgrade -yInstall required packages:
apt install -y curl ca-certificates gnupg openssl ufw2. Install Docker Engine
Create directory for Docker keys:
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
-o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
tee /etc/apt/sources.list.d/docker.sources > /dev/null <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOFUpdate repository:
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginCheck Docker
systemctl enable --now docker
docker run hello-world
docker compose versionIf the above commands run normally, Docker has been successfully installed.
3. Create directory to run Open WebUI + Ollama
Create folder:
mkdir -p /opt/openwebui
cd /opt/openwebuiCreate a secret key for Open WebUI
Run:
WEBUI_SECRET_KEY=$(openssl rand -hex 32)
echo "WEBUI_SECRET_KEY=$WEBUI_SECRET_KEY" > .envThis key is used to enhance security for Open WebUI.
Next, create the Docker Compose file:
nano docker-compose.ymlPaste all of the following content into:
services:
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: unless-stopped
volumes:
- ollama:/root/.ollama
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
restart: unless-stopped
depends_on:
- ollama
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY}
volumes:
- open-webui:/app/backend/data
volumes:
ollama:
open-webui:After completion,
Save file: Ctrl + O, Enter, Ctrl + X
4. Start Open WebUI and Ollama
Navigate to the directory:
cd /opt/openwebuiStart the containers:
docker compose up -dCheck status:
docker compose ps5. Download the first AI model
Once Ollama is running, we will download the AI model.
docker exec -it ollama ollama pull qwen3:1.7b
docker exec -it ollama ollama lsTest model
Run:
docker exec -it ollama ollama run qwen3:1.7bThen try entering: Hello, who are you?
If the model responds, Ollama is functioning normally.
To exit model:
/bye6. Open Firewall
Run:
ufw allow OpenSSH
ufw allow 3000/tcp
ufw enable
ufw statusOnce completed, open your browser and access:
http://IP_VPS_CUA_BAN:3000Note: requires:3000at the end of the IP because Open WebUI is configured to run on port 3000.
7. Create Admin account
On first access, the system will prompt to:
- Name
- Password
Fill in information and click Create Administrator Account
8. Select Qwen3 model
At the top of the chat interface, select model: qwen3:1.7b
Above are the complete instructions for installing Open WebUI and Ollama on a Linux VPS. Hopefully, these steps will help you deploy your AI system quickly and conveniently.
Frequently asked questions
Are Open WebUI and Ollama free?
Yes. Both Open WebUI and Ollama can be installed and used for free on a VPS or dedicated server. However, you still need to pay for the VPS or dedicated server costs to run the system.
Can Open WebUI and Ollama be used for multiple users?
Yes. Open WebUI supports a user account system, allowing it to be deployed as a shared AI interface for individuals, working teams, or enterprises.
However, if multiple people use it concurrently, the VPS needs sufficient CPU, RAM, and especially GPU to handle concurrent requests.
VPTS – Comprehensive Digital Infrastructure Solutions Provider
VPTS is a digital infrastructure solution provider in Vietnam, serving deployment, operation, and data storage needs for individuals, developers, and enterprises. The service ecosystem includesVietnam VPS, International VPS, VPS Anti DDoS, Hosting cPanel, dedicated server, Rack rental, Proxy IPv4/IPv6, S3 MinIOandCloud Storage.
Besides providing infrastructure resources, VPTS also focuses on assisting customers with deployment, configuration, and practical troubleshooting. Content on the VPTS Blog is drawn from common scenarios in operating VPS, servers, and online systems, helping readers understand root causes and apply clear solutions.
VPTS – Stable infrastructure, flexible solutions, and continuous partnership throughout operations.
VPTS Team Contact Information
Website: https://vpts.shop
Facebook: https://www.facebook.com/trang.vpsttt/
Zalo OA: https://zalo.me/vpstttgroup
Hotline: 0328 812 674
CONCLUSION
In this article, VPTS has guided you on how toinstall Open WebUI and Ollama on Linux VPSusing Docker Compose simply and easily.
If you need a Linux VPS to run AI, Ollama, or Open WebUI, VPTS provides flexible configurations suitable for everything from testing needs to production deployment.
◉ 180