Back to tutorials
Tutorial

Open WebUI With Tailscale on a VPS

Run Open WebUI with Tailscale on a VPS so your team gets private access only—no public ports, plus Docker and firewall steps.

By Anurag Singh
Updated on Nov 25, 2026
Category: Tutorial
Share article
Open WebUI With Tailscale on a VPS

You don’t need to expose a chat UI to the public internet to get value from it. This walkthrough shows how to run Open WebUI with Tailscale on a VPS, so only devices in your tailnet can reach it.

You’ll run Open WebUI in Docker and bind it to the Tailscale IP. Then you’ll back it up with firewall rules, so a misclick doesn’t turn into an incident.

This pattern works well for internal support, content and research workflows, code-review helpers, and private “ask our docs” RAG testing.

It also fits operators who prefer simple setups you can audit in five minutes.

What you’ll build (and what you won’t)

  • Build: Open WebUI reachable at a Tailscale IP (100.x.y.z) or a Tailscale DNS name, over HTTPS with a Tailscale certificate.
  • Build: No public inbound ports for the UI. SSH stays as you already run it.
  • Optional: Connect Open WebUI to an LLM backend (Ollama on the same VPS, or an OpenAI-compatible API proxy).
  • Not building: Public SSO, OAuth, or a full zero-trust gateway. Tailscale is the access control boundary here.

Prerequisites

Use a VPS where you control the firewall. Ubuntu or Debian works well.

  • A VPS with at least 2 vCPU, 4 GB RAM, and 25 GB disk for Open WebUI alone. Add more if you also run models locally.
  • Docker + Docker Compose plugin installed.
  • A Tailscale account and admin access to your tailnet.
  • Root (or sudo) on the server.

If you need a machine for this, a standard HostMyCode VPS is a good fit for private internal tools.

If you’d rather not babysit patching and monitoring, consider managed VPS hosting.

Step 1: Install Docker (Ubuntu/Debian)

If Docker is already installed, skip to the Tailscale step.

Otherwise:

sudo apt update
sudo apt -y install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo $VERSION_CODENAME) stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

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

sudo systemctl enable --now docker

Sanity check:

docker version
docker compose version

Step 2: Install and join Tailscale on the VPS

Install Tailscale, then authenticate the node into your tailnet.

curl -fsSL https://tailscale.com/install.sh | sh
sudo systemctl enable --now tailscaled

sudo tailscale up

Follow the login URL it prints.

After the node joins, grab the server’s Tailscale IPv4 address:

tailscale ip -4

You should see a 100.x.y.z address.

Step 3: Create a locked-down Docker Compose for Open WebUI with Tailscale

Here’s the key safety move: publish the port only on the VPS’s Tailscale IP.

Docker won’t listen on the public interface. That stays true even if firewall rules drift later.

Create a working directory:

sudo mkdir -p /opt/open-webui
cd /opt/open-webui

Create a compose.yml like this (edit the IP on the left side of the port mapping):

sudo tee /opt/open-webui/compose.yml > /dev/null <<'YAML'
services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    restart: unless-stopped
    environment:
      # If you later add Ollama locally, set OLLAMA_BASE_URL to http://ollama:11434
      # OLLAMA_BASE_URL: http://ollama:11434
      WEBUI_AUTH: "True"
      # Keep defaults unless you have a reason to change them.
    volumes:
      - open-webui:/app/backend/data
    ports:
      # Bind ONLY on the VPS Tailscale IP, not 0.0.0.0
      - "100.64.0.10:3000:8080"

volumes:
  open-webui:
YAML

Important: Replace 100.64.0.10 with your server’s real Tailscale IP from tailscale ip -4.

Start it:

sudo docker compose up -d
sudo docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'

From a machine on your tailnet, open:

http://100.x.y.z:3000

Open WebUI will prompt you to create the first admin user.

Step 4: Enforce “Tailscale-only” with firewall rules

Binding to the Tailscale IP does most of the work. Still, set explicit policy at the host firewall.

The goal is simple. Allow port 3000 only on the Tailscale interface, and deny it everywhere else.

If you use UFW:

sudo ufw default deny incoming
sudo ufw default allow outgoing

# Keep SSH reachable (adjust if you use a non-standard port)
sudo ufw allow 22/tcp

# Allow Open WebUI only on Tailscale interface
tailscale0_if="tailscale0"
sudo ufw allow in on ${tailscale0_if} to any port 3000 proto tcp

sudo ufw enable
sudo ufw status verbose

Quick diagnostic on the VPS: confirm Docker is listening only on the Tailscale address.

sudo ss -lntp | grep ':3000'

You should see the local address as 100.x.y.z:3000, not 0.0.0.0:3000.

If you want a stronger baseline for anything reachable over the internet (especially SSH), pair this with your normal SSH hardening and intrusion prevention.

For Nginx servers, the patterns in Set Up Fail2ban for Nginx on Ubuntu VPS translate cleanly to most admin endpoints.

Step 5: Add HTTPS using Tailscale certificates (recommended)

Even for internal tools, HTTPS is worth doing.

It prevents token leakage over plaintext. It also keeps browsers from throwing warnings.

Enable HTTPS cert support in your tailnet (in the Tailscale admin console). Then request a cert for the VPS’s Tailscale DNS name.

First, find the MagicDNS name:

tailscale status

You’ll see something like vps-name.tailnet-name.ts.net. Use that name below:

sudo mkdir -p /etc/tailscale/certs
sudo tailscale cert --cert-file /etc/tailscale/certs/openwebui.crt --key-file /etc/tailscale/certs/openwebui.key vps-name.tailnet-name.ts.net

Next, put Nginx in front of Open WebUI to terminate TLS.

You’ll run a small Nginx container bound only to the Tailscale IP. It will proxy back to Open WebUI.

Edit compose.yml to add Nginx:

cd /opt/open-webui
sudo tee /opt/open-webui/nginx.conf > /dev/null <<'NGINX'
server {
  listen 8443 ssl;
  server_name _;

  ssl_certificate     /etc/nginx/certs/openwebui.crt;
  ssl_certificate_key /etc/nginx/certs/openwebui.key;

  # Basic sane defaults for internal tooling
  ssl_protocols TLSv1.2 TLSv1.3;
  ssl_prefer_server_ciphers off;

  location / {
    proxy_pass http://open-webui:8080;
    proxy_http_version 1.1;
    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 https;
  }
}
NGINX

Update the Compose file (again, replace the Tailscale IP):

sudo tee /opt/open-webui/compose.yml > /dev/null <<'YAML'
services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    restart: unless-stopped
    environment:
      WEBUI_AUTH: "True"
    volumes:
      - open-webui:/app/backend/data
    expose:
      - "8080"

  nginx:
    image: nginx:alpine
    container_name: openwebui-nginx
    restart: unless-stopped
    depends_on:
      - open-webui
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
      - /etc/tailscale/certs:/etc/nginx/certs:ro
    ports:
      # Bind only to Tailscale IP
      - "100.64.0.10:8443:8443"

volumes:
  open-webui:
YAML

Apply changes:

sudo docker compose up -d
sudo docker logs --tail=50 openwebui-nginx

Allow the new port (still Tailscale-only):

sudo ufw allow in on tailscale0 to any port 8443 proto tcp

Now browse:

https://vps-name.tailnet-name.ts.net:8443

You can keep port 3000 closed entirely and use only 8443 via Nginx.

Step 6: Connect Open WebUI to an LLM backend (two practical options)

Open WebUI is the front end. You still need an inference backend.

Choose based on your hardware, latency expectations, and how strict data locality needs to be.

Option A: Use a remote OpenAI-compatible endpoint (common for teams)

If models live elsewhere (or you’ve standardized on an internal API), point Open WebUI at an OpenAI-compatible proxy.

Keep that proxy reachable only over Tailscale.

HostMyCode has a dedicated walkthrough you can reuse for that layer: Install OpenAI-Compatible LLM Proxy on Your VPS.

In Open WebUI, set the OpenAI API URL to your proxy’s Tailscale address. Store API keys in the UI’s secret storage, not in notes, shell history, or browser autofill.

Option B: Run Ollama on the same VPS (simple, but watch RAM)

If you want everything on one box, Ollama is usually the quickest route.

The catch is capacity. Even quantized models can chew through RAM on a CPU-only VPS.

For a basic Ollama install and service management, follow Install Ollama on Ubuntu VPS With Systemd.

Then add an Ollama service to your Compose stack, or run it on the host and set:

OLLAMA_BASE_URL=http://host.docker.internal:11434

On Linux, host.docker.internal may not exist by default.

The cleaner approach is to run Ollama as a container in the same Compose network. Then reference http://ollama:11434.

If you’re unsure what fits on your VPS, don’t guess. Quantize first, then measure.

This HostMyCode guide stays practical: Quantize Llama Models for Ollama on a VPS.

Resource sizing that won’t surprise you later

Open WebUI itself is small. The backend drives CPU, RAM, and cost.

  • UI only: 2 vCPU / 4 GB RAM is usually fine for a small team.
  • CPU-only inference: Plan for 8–16 GB RAM even for modest quantized models, plus patience. Latency can jump under concurrent load.
  • GPU inference: A dedicated GPU server is the practical path for multiple users. VRAM, not vCPU, becomes your main limiter.

If your team needs private models with predictable response times, a GPU-capable dedicated machine is often the cleanest upgrade.

A HostMyCode dedicated servers plan gives you isolation and headroom for VRAM-heavy workloads.

Operational checks: make sure it’s really private

Run these before you hand the URL to the team.

  1. Public port scan from outside: From a machine not on your tailnet, confirm ports 3000/8443 are closed.
  2. Listen addresses:
    sudo ss -lntp | egrep ':3000|:8443'

    You should only see the 100.x Tailscale IP bound.

  3. Firewall rules:
    sudo ufw status numbered

    Look for explicit allows on tailscale0 only.

  4. Tailscale ACLs: In the admin console, restrict which user groups can reach the VPS on ports 22/8443.

Hardening basics for an AI UI endpoint

Even though this UI is private, treat it like a production service.

  • Keep auth enabled: Leave WEBUI_AUTH=True. Don’t rely on “it’s internal.”
  • Separate admin accounts: Give each operator an account. Don’t share one password.
  • Limit outbound data: If you connect external model APIs, document what data can be sent. Then enforce it by policy.
  • Update hygiene: Pin images if you need strict change control, or schedule regular updates and verify after restart.

If you already run multiple Docker apps on this VPS, automatic updates can help.

That only works if you review changes and watch rollouts.

This guide shows a clean Watchtower approach: Docker Compose Auto-Updates With Watchtower on a VPS.

Backup: don’t lose chat history and settings

Open WebUI stores its state in a persistent Docker volume.

Back it up the same way you would any other application data.

Quick backup example (stops containers briefly for consistency):

cd /opt/open-webui
sudo docker compose down
sudo tar -czf /root/open-webui-backup-$(date +%F).tar.gz /var/lib/docker/volumes/open-webui_open-webui/_data
sudo docker compose up -d

On production systems, prefer volume-aware backups.

More importantly, test restores.

If this VPS also hosts databases, adopt a restore-tested routine similar to Set Up Automatic MySQL Backups With Tested Restores—the principle matters more than the specific engine.

Troubleshooting: common failures and fast fixes

Open WebUI loads on the VPS, but not from your laptop

  • Confirm your laptop is on Tailscale: tailscale status.
  • Ping the VPS Tailscale IP: ping 100.x.y.z.
  • Check ACLs in the tailnet admin console.
  • Verify the container is bound to the right IP: ss -lntp | grep 8443.

Nginx shows a certificate error

  • Confirm the cert files exist: ls -l /etc/tailscale/certs.
  • Re-issue the cert: sudo tailscale cert vps-name.tailnet-name.ts.net.
  • Restart Nginx container: sudo docker restart openwebui-nginx.

The UI works, but the model list is empty

  • You haven’t connected an LLM backend yet, or the backend URL isn’t reachable from the container network.
  • If using Ollama, ensure it listens on the expected interface and port, and that Open WebUI points to it.
  • Check container logs: sudo docker logs --tail=200 open-webui.

Summary: private AI UI, no public exposure

The safe pattern is boring on purpose: bind the service to the Tailscale IP, then enforce that decision with firewall rules.

Add Tailscale HTTPS certs behind a small Nginx proxy. You’ll get a private chat UI your team can reach from anywhere, without opening it to the internet.

If you want a stable place to run internal tools like this, start with a HostMyCode VPS.

If you’re planning to add GPU inference or support more users, move to HostMyCode dedicated servers so performance doesn’t depend on squeezing models into limited RAM.

Need a clean, private place to run Open WebUI for your team? Put it on a HostMyCode VPS and keep the UI reachable only over Tailscale. If you don’t want to manage updates, firewall rules, and Docker upkeep yourself, managed VPS hosting keeps the day-to-day noise down.

FAQ

Can I run Open WebUI without opening any ports at all?

Yes. If you use Tailscale Serve on the VPS, you can avoid exposing even a Tailscale-bound TCP port. This tutorial uses the more transparent “bind to Tailscale IP + firewall” approach because it’s easy to audit with ss and UFW.

Is Tailscale enough as the only security layer?

It’s a strong access boundary, but you should still keep Open WebUI authentication enabled, patch the host, and restrict tailnet ACLs to the smallest group that needs access.

What VPS size do I need if I also want to run models locally?

For CPU-only inference, start at 8–16 GB RAM and expect higher latency under concurrency. For multiple users, a GPU server (VRAM sized to your chosen model) is usually the first real upgrade that changes the experience.

How do I integrate RAG later?

If you want document search, start with pgvector-backed RAG. HostMyCode has a full walkthrough here: Open WebUI RAG With pgvector on a VPS.

How do I avoid accidental public exposure in the future?

Use both controls: bind ports to the Tailscale IP (not 0.0.0.0) and keep an explicit firewall rule that only allows traffic on tailscale0. Then periodically verify with ss -lntp and an external port scan.

Open WebUI With Tailscale on a VPS | HostMyCode