Deploy Open WebUI on a VPS: Self-Hosted ChatGPT Alternative (2026 Guide)

One-sentence verdict: Open WebUI gives you a polished ChatGPT-style interface on your own server for $5–$20/month, connecting to either local models via Ollama or external APIs like OpenAI and Anthropic — with full data ownership.

Who This Guide Is For

If you just need personal ChatGPT access for basic tasks and don’t care about data sovereignty, this is overkill — just pay for a ChatGPT subscription.

What Open WebUI Actually Is

Open WebUI (formerly Ollama WebUI) is a self-hosted web application that provides a ChatGPT-like interface. It supports multiple backends:

Key features that matter in practice:

FeatureWhat it means for you
Multi-user authShare one server with your team, each gets their own chat history
RAG (document upload)Upload PDFs/docs and chat with them using local models
Model managementPull and delete Ollama models from the UI
Prompt templatesSave and share system prompts across the team
Web search integrationModels can search the web for current information
API key managementConnect to OpenAI/Anthropic without sharing keys with end users

Hardware Requirements

Open WebUI itself is lightweight. The VPS sizing depends entirely on whether you run local models or just proxy to external APIs.

Scenario A: API Proxy Only (cheapest)

You connect Open WebUI to OpenAI, Anthropic, or other cloud APIs. No local inference.

ResourceMinimumRecommended
RAM1 GB2 GB
CPU1 vCPU2 vCPU
Disk10 GB20 GB
Monthly cost$4–$6$6–$10

Best providers for this: Racknerd ($11/year deals), Contabo ($5/mo), Hetzner CX22 (€4/mo).

Scenario B: Local Models via Ollama

You run Ollama alongside Open WebUI for fully private inference.

Model targetRAMCPUDiskMonthly cost
Small models (3B)4 GB2 vCPU30 GB$6–$12
Medium models (7–8B)8 GB4 vCPU50 GB$12–$24
Large models (13B+)16 GB6 vCPU80 GB$24–$48

Best providers for this: Hetzner CPX31 (€15/mo for 8GB), Contabo VPS M (€10/mo for 16GB), DigitalOcean Premium 8GB ($56/mo but better CPU).

Warning: Contabo offers the most RAM per dollar but has older CPUs with slower single-thread performance. For CPU-only LLM inference, single-thread speed matters. Hetzner AMD EPYC instances are noticeably faster at the same core count.

Step-by-Step Deployment

Prerequisites

Step 1: Install Docker

# Update system
sudo apt update && sudo apt upgrade -y

# Install Docker using the official script
curl -fsSL https://get.docker.com | sh

# Add your user to docker group
sudo usermod -aG docker $USER

# Log out and back in, then verify
docker --version

Step 2: Deploy Open WebUI with Docker Compose

Create a project directory:

mkdir -p ~/open-webui && cd ~/open-webui

Create docker-compose.yml:

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    restart: unless-stopped
    ports:
      - "3000:8080"
    volumes:
      - open-webui-data:/app/backend/data
    environment:
      - OLLAMA_BASE_URL=http://host.docker.internal:11434
      - WEBUI_SECRET_KEY=change-this-to-a-random-string
      - ENABLE_SIGNUP=true
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  open-webui-data:

Start the container:

docker compose up -d

Open WebUI is now running on port 3000. The first user to register becomes the admin.

Step 3: (Optional) Install Ollama for Local Models

Skip this if you only plan to use external APIs.

# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Pull a starter model
ollama pull llama3.2:3b

# Verify it's running
curl http://localhost:11434/api/tags

Step 4: Set Up Reverse Proxy with Caddy

Caddy handles HTTPS automatically via Let’s Encrypt.

# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy

Edit /etc/caddy/Caddyfile:

chat.yourdomain.com {
    reverse_proxy localhost:3000
}

Restart Caddy:

sudo systemctl restart caddy

Your Open WebUI instance is now live at https://chat.yourdomain.com with automatic HTTPS.

Step 5: Connect External APIs

Once logged in as admin:

  1. Go to Admin Panel → Settings → Connections
  2. Add OpenAI API:
    • URL: https://api.openai.com/v1
    • Key: your OpenAI API key
  3. Add Anthropic (via OpenAI-compatible proxy like LiteLLM, or use the built-in Anthropic connection if available in your version)

Now users can choose between local Ollama models and cloud models in the same interface.

Step 6: Secure the Installation

# Disable public signups after your team registers
# Edit docker-compose.yml, change:
#   ENABLE_SIGNUP=true → ENABLE_SIGNUP=false
# Then: docker compose up -d

# Set up UFW firewall
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable

# Enable automatic security updates
sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

Cost Comparison: Open WebUI vs. Commercial Alternatives

SolutionMonthly cost (5 users)Data privacyLocal model support
ChatGPT Team$125 ($25/user)Data used for training (opt-out available)No
Claude for Work$150 ($30/user)Better privacy policyNo
Open WebUI + API keys$6–$15 (server) + API usageFull ownershipYes
Open WebUI + Ollama only$12–$24 (server)Complete — no external callsYes

For a 5-person team doing moderate AI usage, expect $30–$60/month total with Open WebUI + API keys — about half the cost of commercial plans with better privacy.

Common Problems and Fixes

Open WebUI can’t connect to Ollama

Most common cause: Docker networking. The container can’t reach localhost on the host.

# Verify Ollama is listening on all interfaces
sudo systemctl edit ollama
# Add under [Service]:
# Environment="OLLAMA_HOST=0.0.0.0"
sudo systemctl restart ollama

# Test from inside the container
docker exec open-webui curl http://host.docker.internal:11434/api/tags

High memory usage with multiple models

Ollama keeps the last used model loaded in RAM. With limited memory:

# Set Ollama to unload models after 5 minutes of inactivity
sudo systemctl edit ollama
# Add: Environment="OLLAMA_KEEP_ALIVE=5m"
sudo systemctl restart ollama

Slow responses with local models

CPU-only inference is inherently slow. Mitigations:

Database corruption after hard reboot

Open WebUI uses SQLite by default. If your VPS provider force-reboots machines:

# Back up regularly
docker exec open-webui cp /app/backend/data/webui.db /app/backend/data/webui.db.bak

# Or switch to PostgreSQL for production reliability
# Add to docker-compose.yml environment:
#   DATABASE_URL=postgresql://user:pass@db:5432/openwebui

Maintenance Checklist

TaskFrequencyCommand
Update Open WebUIWeeklydocker compose pull && docker compose up -d
Update OllamaMonthlycurl -fsSL https://ollama.ai/install.sh | sh
Back up dataDaily (cron)docker exec open-webui cp /app/backend/data/webui.db /backups/
Check disk usageWeeklydf -h && docker system df
Review user accountsMonthlyAdmin Panel → Users

Who Should NOT Self-Host This

Bottom Line

Open WebUI on a VPS is the best option for small teams and privacy-conscious developers who want ChatGPT-level UX with full data control. The sweet spot is a $10–$15/month Hetzner or Contabo VPS running Open WebUI as an API proxy, with Ollama for sensitive queries that can’t leave your server. You get multi-user access, conversation history, document chat, and model flexibility — all for less than a single ChatGPT Team subscription.