Back to blog

Self-Host Open WebUI on a VPS: A Private AI Chat for Your Team

IM Host EditorialOctober 25, 20266 min read
Self-Host Open WebUI on a VPS: A Private AI Chat for Your Team

Open WebUI is an open-source chat interface for language models. It looks and works much like the hosted AI chat apps, but it runs on your own server. Your team signs in with accounts you control, chats and uploaded files stay in your database, and you choose which models to connect: commercial APIs, a local model, or both. This guide sets it up on a VPS with Docker, connects it to an API provider, locks down sign-ups and puts it behind HTTPS. It also explains honestly what running models locally on a VPS requires.

What "private" means here

Be clear about this before you start. With Open WebUI, the interface, user accounts, chat history and documents live on your server. If you connect a commercial API, the prompts you send are still processed by that provider under its own terms. You gain control over access, history and which provider you use, and you can use API terms that differ from consumer apps. Only a model that runs on your own hardware keeps prompts entirely on your server, and that has hardware costs we cover below.

What you need

  • A Linux VPS with Docker and the Docker Compose plugin installed.

  • A domain or subdomain pointing to the server, for example chat.example.com.

  • An API key from a provider with an OpenAI-compatible API, if you use hosted models.

As a rule of thumb, Open WebUI with external APIs runs comfortably for a small team on 2 vCPU and 4 GB RAM. The container image is large, so keep several GB of disk free. Document search (RAG) runs an embedding model on the server by default, which adds CPU and memory load when people upload files.

Run Open WebUI with Docker Compose

Create a directory, for example /opt/open-webui, and add a compose.yaml:

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    restart: unless-stopped
    ports:
      - "127.0.0.1:3000:8080"
    environment:
      WEBUI_URL: https://chat.example.com
      WEBUI_SECRET_KEY: replace-with-a-long-random-string
      OPENAI_API_BASE_URL: https://api.openai.com/v1
      OPENAI_API_KEY: replace-with-your-api-key
      ENABLE_OLLAMA_API: "false"
    volumes:
      - open-webui:/app/backend/data

volumes:
  open-webui:

Generate the secret key with openssl rand -hex 32. It signs login sessions, so a fixed value keeps users signed in across container restarts. Then start the service:

cd /opt/open-webui
docker compose up -d
docker compose logs -f open-webui

Notes on this file:

  • The port is bound to 127.0.0.1, so the app is not reachable from the internet until the reverse proxy is in place.

  • The main tag follows the latest release. For a stable team setup, pin a specific version tag and update on purpose.

  • All data, including the user database and uploads, lives in the open-webui volume. That is what you back up.

  • Many settings are saved in the database after the first start. Later changes to those environment variables may be ignored, so change them in the Admin Panel instead.

  • Move the API key and secret into an .env file with restricted permissions for production.

Create the admin account and close sign-ups

The first account created becomes the administrator. Create it immediately after the first start, before anyone else can reach the page. Then, in Admin Panel → Settings → General:

  • Turn off new sign-ups and create accounts for your team yourself, or

  • Keep sign-ups on with the default user role set to pending, so every new account waits for your approval.

Use groups and permissions to control which models each group can use. For larger teams, Open WebUI also supports single sign-on through OpenID Connect, so people use their existing company accounts.

Connect API providers

Under Admin Panel → Settings → Connections, you can add more than one OpenAI-compatible endpoint, each with its own base URL and key. Many providers and inference servers expose this API format, so one interface can offer models from several sources. Two practical points:

  • Set a spending limit at each provider. A shared chat tool can use more tokens than you expect.

  • Hide models you do not want people to use, so costs stay predictable.

Add HTTPS

Open WebUI streams responses and uses WebSockets, so the proxy must pass upgrade headers and avoid buffering. Caddy handles this by default and gets a certificate automatically:

chat.example.com {
    reverse_proxy 127.0.0.1:3000
}

With Nginx, the important lines inside the location / block are:

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-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_read_timeout 300s;
client_max_body_size 50m;

Without the upgrade headers, chats may hang or the page may show connection errors. Without proxy_buffering off, answers arrive in one block at the end instead of streaming. Raise client_max_body_size if your team uploads large documents.

Running local models: the honest version

Open WebUI works well with Ollama, which runs open models on your own server. Add it as a second service:

  ollama:
    image: ollama/ollama
    restart: unless-stopped
    volumes:
      - ollama:/root/.ollama

Add ollama: under the top-level volumes, then in the Open WebUI service set OLLAMA_BASE_URL: http://ollama:11434 and remove ENABLE_OLLAMA_API: "false". Pull a small model with docker compose exec ollama ollama pull llama3.2:3b.

Now the hardware reality. Language models are limited mainly by memory bandwidth, and graphics cards have far more of it than server RAM.

  • Small models on CPU work, but slowly. A 1–3 billion parameter model in 4-bit quantization runs on a VPS with enough RAM. Expect answers that appear word by word, which is fine for one person and frustrating for a team at the same time.

  • Memory sets the limit. As a rule of thumb, a 4-bit model needs a little over half a GB of RAM per billion parameters, plus room for context and the operating system. A 7–8B model needs around 5–6 GB just for the model.

  • Large models need a GPU. Models in the 30B–70B range, or several people chatting at once, need a server with a suitable GPU and enough video memory. On a CPU-only VPS they are too slow for daily use.

For most teams, the practical setup is Open WebUI on a CPU VPS connected to API providers, with perhaps one small local model for simple tasks.

Backups and updates

Back up the data volume regularly and keep a copy off the server:

docker run --rm -v open-webui_open-webui:/data -v /root/backups:/backup alpine \
  tar czf /backup/open-webui-$(date +%F).tar.gz -C /data .

Compose prefixes volume names with the project name, so check the exact name with docker volume ls. To update, take a backup, change the image tag if you pinned one, then run docker compose pull and docker compose up -d. For larger teams, Open WebUI can store its data in PostgreSQL through DATABASE_URL and use pgvector for document search.

Run it on IM HOST

IM HOST AI Agent Hosting comes ready with Docker, Node.js, Python and PostgreSQL with pgvector, which covers the setup in this guide, including a PostgreSQL backend later. If you want guaranteed resources for a team, Cloud VPS plans start at $16/month with 4 dedicated vCPU, 8GB RAM and 80GB NVMe, a free automatic backup every 3 days, and upgrades anytime. These are CPU servers, so they suit the API-provider setup and small local models. Our engineers are available 24/7, and a 30-day money-back guarantee applies.

More from our blog

Discover more practical guides and product insights from the IM Host team.

View all articles