Guide to Installing Open WebUI and Ollama on Linux VPS

VPTS Team Content has been moderated
Published date:13/9/2026 Update:16/9/2026 Views:180 Reviews: 4.8/577reviews
VPTS on

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 -y

Install required packages:

apt install -y curl ca-certificates gnupg openssl ufw

2. 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 EOF

Update repository:

apt update apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Check Docker

systemctl enable --now docker docker run hello-world docker compose version
install Open WebUI

If 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/openwebui

Create a secret key for Open WebUI

Run:

WEBUI_SECRET_KEY=$(openssl rand -hex 32) echo "WEBUI_SECRET_KEY=$WEBUI_SECRET_KEY" > .env

This key is used to enhance security for Open WebUI.

Next, create the Docker Compose file:

nano docker-compose.yml

Paste 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:
install Open WebUI

After completion, 

Save file: Ctrl + O, Enter, Ctrl + X

4. Start Open WebUI and Ollama

Navigate to the directory:

cd /opt/openwebui

Start the containers:

docker compose up -d
install Open WebUI

Check status:

docker compose ps

5. 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 ls
install Open WebUI

Test model

Run:

docker exec -it ollama ollama run qwen3:1.7b

Then try entering: Hello, who are you?

If the model responds, Ollama is functioning normally.

To exit model:

/bye
install Open WebUI

6. Open Firewall

Run:

ufw allow OpenSSH ufw allow 3000/tcp ufw enable ufw status

Once completed, open your browser and access:

http://IP_VPS_CUA_BAN:3000
install Open WebUI

7. Create Admin account

On first access, the system will prompt to:

  • Name
  • Email
  • Password

Fill in information and click Create Administrator Account

install Open WebUI

8. Select Qwen3 model

At the top of the chat interface, select model: qwen3:1.7b

install Open WebUI

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

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.