Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Ubuntu 24.04 Ollama + Qwen3 + Open WebUI Setup: Local AI, Nginx and SSL
Ollama, Qwen3, Open WebUI, Docker and Ubuntu 24.04

How to Install Ollama + Qwen3 4B + Open WebUI on Ubuntu 24.04: Complete Illustrated Local AI Guide

In this real Ubuntu 24.04.4 LTS VPS deployment we ran Ollama in Docker on a localhost-only API, downloaded qwen3:4b and performed a real inference test, attached Open WebUI to the same private Docker network, enabled Nginx + Let's Encrypt HTTPS for openwebui.ekasunucu.com, and kept ports 11434/3000 off the public Internet.

Ubuntu 24.04OllamaQwen3qwen3:4bOpen WebUILocal AISelf Hosted AIDockerNginxLet's EncryptLinux VPSLLMEKA Sunucu
Ollama / Qwen3 / Open WebUI / Ubuntu 24.04
Ubuntu 24.04.4 LTS
   ↓ Docker / eka-ai
Ollama 0.32.6 :11434
   ↓ qwen3:4b
Open WebUI :8080
   ↓ 127.0.0.1:3000
Nginx + Let's Encrypt :443
   ↓
openwebui.ekasunucu.com
Ollama0.32.6Open WebUI0.11.0 test
13real WebP screenshots
3TR · EN · DE content
443public HTTPS
127.0.0.1AI service loopback
01Ollama CPU mode + localhost API
02qwen3:4b model + real inference test
03Open WebUI + persistent data + private Docker network
04Nginx + HTTPS + local-only service ports
00
Table of contents

Ubuntu 24.04 Ollama + Qwen3 + Open WebUI installation steps

  1. 01What are we building with Ollama + Qwen3 + Open WebUI on Ubuntu 24.04?
  2. 02Check CPU, RAM, disk and GPU status before installation
  3. 03Verify Docker Engine and Compose are ready
  4. 04Create the eka-ai Docker network and ollama_data volume
  5. 05Run Ollama on localhost port 11434 only
  6. 06Pull qwen3:4b and verify the Ollama model inventory
  7. 07Send a real qwen3:4b chat request to verify inference
  8. 08Confirm port 11434 is private and the Docker-internal address is available
  9. 09Prepare DNS, persistent storage and a stable secret key
  10. 10Attach Open WebUI to eka-ai and bind it to localhost port 3000
  11. 11Watch the logs if health does not return 200 immediately
  12. 12Verify Ollama and qwen3:4b from inside the Open WebUI container
  13. 13Reverse proxy openwebui.ekasunucu.com to localhost port 3000
  14. 14Issue a Let's Encrypt certificate and move the domain to HTTPS
  15. 15Keep ports 3000 and 11434 on localhost and publish only Nginx 80/443
  16. 16Verify Certbot renewal, container health and failed services
  17. 17Open the Open WebUI welcome screen through the HTTPS hostname
  18. 18Create the first Open WebUI administrator account
  19. 19Select qwen3:4b in Open WebUI and start a local chat
  20. 20Back up volumes, update images deliberately and test after reboot
01
Real test architecture

What are we building with Ollama + Qwen3 + Open WebUI on Ubuntu 24.04?

This guide documents the local-AI stack we built on a real Ubuntu 24.04.4 LTS VPS. Ollama provides model inference, qwen3:4b is the local language model, and Open WebUI is the browser interface; both application containers share one Docker network.

In the final layout the Ollama API is bound to 127.0.0.1:11434 and Open WebUI to 127.0.0.1:3000. Nginx on HTTPS 443 is the only public web entry point, while Open WebUI reaches Ollama privately at http://ollama:11434 over the eka-ai Docker network.

Command 1
Internet :443
     ↓
Nginx + Let's Encrypt
     ↓
127.0.0.1:3000 → Open WebUI :8080
     ↓ eka-ai Docker network
ollama:11434 → qwen3:4b
02
Resource verification

Check CPU, RAM, disk and GPU status before installation

The test VPS ran Ubuntu 24.04.4 LTS with 8 vCPUs and about 31 GiB RAM. The exposed processor was based on AMD Ryzen 9 7950X. No NVIDIA driver or usable ROCm compute device was present, so the first deployment was validated in CPU mode.

Local models consume RAM and disk. Size the server using quantization, context window, concurrent users and operating-system overhead instead of looking only at parameter count.

Command 1
cat /etc/os-release | grep -E 'PRETTY_NAME|VERSION_ID|VERSION_CODENAME'
uname -r
free -h
df -h /
Command 2
lscpu | grep -E 'Architecture|CPU\(s\)|Model name'
nvidia-smi 2>/dev/null || true
ls -la /dev/dri 2>/dev/null || true
03
Docker foundation

Verify Docker Engine and Compose are ready

Because both Ollama and Open WebUI run in Docker, we first verified the Docker daemon and Compose plugin. The real test used Docker Engine 29.7.2 and Docker Compose v5.4.0.

If Docker is not installed yet, complete the Ubuntu 24.04 Docker and Portainer guide first using Docker's official repository.

Command 1
docker --version
docker compose version
systemctl is-active docker
04
Network and persistence

Create the eka-ai Docker network and ollama_data volume

We created a dedicated bridge network named eka-ai so Open WebUI can resolve Ollama by container name. A named volume called ollama_data keeps downloaded models independent from the container lifecycle.

Containers can be recreated during upgrades while model data remains in the named volume. Do not remove the volume without a verified backup.

Command 1
docker network inspect eka-ai >/dev/null 2>&1 || docker network create eka-ai
docker volume create ollama_data
Command 2
docker network inspect eka-ai --format 'Network={{.Name}} Driver={{.Driver}} Scope={{.Scope}}'
docker volume inspect ollama_data
05
Ollama in CPU mode

Run Ollama on localhost port 11434 only

No GPU passthrough was detected in the test, so we ran the official Ollama Docker image in CPU mode. Host port 11434 was published on 127.0.0.1 rather than 0.0.0.0, preventing direct Internet exposure of the Ollama API.

The container also joined eka-ai. Open WebUI can therefore reach it as ollama:11434 without exposing that private service to users.

Command 1
docker pull ollama/ollama:latest
Command 2
docker run -d --name ollama --restart unless-stopped --network eka-ai -p 127.0.0.1:11434:11434 -v ollama_data:/root/.ollama ollama/ollama:latest
Command 3
docker ps --filter name='^/ollama$'
curl -sS http://127.0.0.1:11434/api/tags
06
Local model

Pull qwen3:4b and verify the Ollama model inventory

After Ollama became available we pulled qwen3:4b inside the container. In the real API output the model occupied about 2.5 GB and reported parameter_size 4.0B with Q4_K_M quantization.

Download time depends on disk and network performance. Wait for the pull to finish before expecting the model to appear in Open WebUI.

Command 1
docker exec ollama ollama pull qwen3:4b
Command 2
docker exec ollama ollama list
curl -sS http://127.0.0.1:11434/api/tags
07
API verification

Send a real qwen3:4b chat request to verify inference

Seeing a model in the inventory does not prove inference works, so we sent a real request to /api/chat and confirmed qwen3:4b returned the expected test phrase.

With the model loaded in our CPU test, Ollama used roughly 3 GiB RAM and ollama ps reported 100% CPU. These figures describe only the captured test moment; longer context and concurrent requests change resource usage.

Command 1
curl -sS http://127.0.0.1:11434/api/chat -d '{"model":"qwen3:4b","messages":[{"role":"user","content":"Write only EKA-OLLAMA-TEST-BASARILI."}],"stream":false}'
Command 2
docker exec ollama ollama ps
docker stats --no-stream ollama
08
Ollama final check

Confirm port 11434 is private and the Docker-internal address is available

The final Ollama layout used http://127.0.0.1:11434 from the host and http://ollama:11434 inside the Docker network. Port 11434 listened only on loopback.

This lets Open WebUI access Ollama privately while preventing Internet clients from reaching the raw Ollama API directly.

Command 1
ss -lntp | grep ':11434'
Command 2
docker network inspect eka-ai --format '{{range .Containers}}{{.Name}} {{.IPv4Address}}{{println}}{{end}}'
Command 3
docker exec ollama ollama list
09
Open WebUI preparation

Prepare DNS, persistent storage and a stable secret key

We pointed openwebui.ekasunucu.com to the test VPS and verified DNS resolution. A named volume called openwebui_data was created for application data.

A WEBUI_SECRET_KEY was also generated. For production, persist this value securely in a protected file or secret manager and reuse it when the container is recreated.

Command 1
dig +short openwebui.ekasunucu.com @1.1.1.1
dig +short openwebui.ekasunucu.com @8.8.8.8
Command 2
docker volume create openwebui_data
Command 3
umask 077
[ -s /root/.openwebui_secret_key ] || openssl rand -hex 32 > /root/.openwebui_secret_key
WEBUI_SECRET_KEY="$(cat /root/.openwebui_secret_key)"
10
Open WebUI Docker

Attach Open WebUI to eka-ai and bind it to localhost port 3000

The real test used ghcr.io/open-webui/open-webui:main. Host port 3000 was limited to 127.0.0.1, the application kept its internal port 8080, and openwebui_data was mounted at /app/backend/data.

Because Ollama shared the eka-ai network, OLLAMA_BASE_URL was set to http://ollama:11434. Docker DNS resolves the container name without making Ollama public.

Command 1
docker pull ghcr.io/open-webui/open-webui:main
Command 2
WEBUI_SECRET_KEY="$(cat /root/.openwebui_secret_key)"
docker run -d --name open-webui --restart unless-stopped --network eka-ai -p 127.0.0.1:3000:8080 -e OLLAMA_BASE_URL=http://ollama:11434 -e WEBUI_SECRET_KEY="$WEBUI_SECRET_KEY" -v openwebui_data:/app/backend/data ghcr.io/open-webui/open-webui:main
Command 3
docker ps --filter name='^/open-webui$'
11
First-start timing

Watch the logs if health does not return 200 immediately

On first start Open WebUI may run database migrations and prepare local helper models. During our test the first few minutes produced connection-reset and HTTP 000 results even though the container process was running.

After migrations and the embedding model load completed, /health returned HTTP 200 with {"status":true}. Monitoring logs is better than repeatedly recreating the container during this initialization window.

Command 1
docker logs -f --tail 150 open-webui
Command 2
until [ "$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3000/health || true)" = "200" ]; do sleep 5; done
curl -sS http://127.0.0.1:3000/health
Command 3
docker inspect open-webui --format 'State={{.State.Status}} Health={{if .State.Health}}{{.State.Health.Status}}{{else}}none{{end}}'
12
Model connection

Verify Ollama and qwen3:4b from inside the Open WebUI container

A successful host-side Ollama test is not enough; the Open WebUI container must be able to reach it too. On the shared Docker network the target is ollama:11434.

Open WebUI retrieves models through that connection. If qwen3:4b is missing, check Ollama /api/tags, the Open WebUI connection setting and membership of both containers in eka-ai.

Command 1
docker exec open-webui python -c "import urllib.request; print(urllib.request.urlopen('http://ollama:11434/api/tags').read().decode())"
Command 2
docker network inspect eka-ai --format '{{range .Containers}}{{.Name}} {{.IPv4Address}}{{println}}{{end}}'
13
Nginx + WebSocket

Reverse proxy openwebui.ekasunucu.com to localhost port 3000

Instead of publishing Open WebUI's host port to the Internet, Nginx became the public entry layer. Nginx listens on 80/443, forwards traffic to 127.0.0.1:3000 and preserves WebSocket upgrade headers.

Use the correct server_name and always run nginx -t before reloading the service.

Command 1
cat >/etc/nginx/sites-available/openwebui.ekasunucu.com <<'EOF'
server {
    listen 80;
    listen [::]:80;
    server_name openwebui.ekasunucu.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        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 $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 3600;
    }
}
EOF
ln -sfn /etc/nginx/sites-available/openwebui.ekasunucu.com /etc/nginx/sites-enabled/openwebui.ekasunucu.com
nginx -t
systemctl reload nginx
14
HTTPS publishing

Issue a Let's Encrypt certificate and move the domain to HTTPS

Once the Nginx reverse proxy was ready, Certbot issued a Let's Encrypt certificate for openwebui.ekasunucu.com and deployed it to Nginx successfully.

Both origin HTTPS and the public domain returned HTTP 200 in the final checks, so users access the secure hostname rather than a Docker port.

Command 1
certbot --nginx -d openwebui.ekasunucu.com
Command 2
curl -I https://openwebui.ekasunucu.com
Command 3
certbot certificates
15
Reduce attack surface

Keep ports 3000 and 11434 on localhost and publish only Nginx 80/443

At the end of the deployment Ollama listened on 127.0.0.1:11434 and Open WebUI on 127.0.0.1:3000, while Nginx listened publicly on 80 and 443. This separation avoids exposing the raw Ollama API to the Internet.

Docker publishing can interact with firewall rules, so inspect actual listening sockets with ss and published ports with docker ps instead of relying on only one firewall view.

Command 1
ss -lntp | grep -E ':80 |:443 |:3000 |:11434' || true
Command 2
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}'
16
Final infrastructure test

Verify Certbot renewal, container health and failed services

We ran certbot renew --dry-run instead of assuming automatic renewal would work. The simulated renewals for Open WebUI and Portainer completed successfully.

The final state showed a healthy Open WebUI container, running Ollama, HTTP 200 on the HTTPS domain and no failed systemd units.

Command 1
certbot renew --dry-run
Command 2
curl -sS -o /dev/null -w '%{http_code}\n' https://openwebui.ekasunucu.com
Command 3
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
systemctl --failed
17
First browser access

Open the Open WebUI welcome screen through the HTTPS hostname

After the infrastructure was complete, we opened https://openwebui.ekasunucu.com and reached the Open WebUI welcome page. The Get Started action led to the account setup flow.

The browser should use the hostname directly. There should be no need for public access to port 3000 because Nginx and TLS terminate user traffic.

18
First user

Create the first Open WebUI administrator account

On the first registration screen we created the administrator with a name, email address and strong password. The first account controls administrative settings.

Use a unique production password and review the registration/approval policy before allowing additional users.

19
Local AI ready

Select qwen3:4b in Open WebUI and start a local chat

After account setup, qwen3:4b became available in the Open WebUI model selector. This completed the browser → Open WebUI → Ollama → qwen3:4b chain end to end.

Inference runs on the Ollama side of the server while Open WebUI provides the interface, user and conversation layer. Recalculate CPU/RAM/GPU capacity before moving to larger models or more concurrent users.

20
Production maintenance

Back up volumes, update images deliberately and test after reboot

Ollama model data lives in ollama_data and Open WebUI application data in openwebui_data. A VPS snapshot plus volume backups before upgrades makes rollback safer.

The real test used :main. Before production updates, record or pin the image version, back up data, recreate containers deliberately, then re-test /health, Ollama /api/tags, HTTPS, local-only port binds and startup after reboot.

Command 1
docker run --rm -v ollama_data:/source -v /root:/backup alpine sh -c 'tar czf /backup/ollama_data-$(date +%F).tar.gz -C /source .'
Command 2
docker run --rm -v openwebui_data:/source -v /root:/backup alpine sh -c 'tar czf /backup/openwebui_data-$(date +%F).tar.gz -C /source .'
Command 3
docker restart ollama open-webui
curl -sS http://127.0.0.1:3000/health
curl -sS http://127.0.0.1:11434/api/tags
Production checklist

Ollama + Open WebUI production security checklist

Do not expose the unauthenticated Ollama 11434 API directly to the public Internet.
Keep Open WebUI host port 3000 on localhost and publish user access through Nginx 443.
Persist and protect WEBUI_SECRET_KEY across container recreation.
Use a strong unique password for the Open WebUI administrator account.
Back up ollama_data and openwebui_data volumes regularly.
Create a VPS snapshot and rollback plan before image upgrades.
Verify WebSocket headers through the Nginx reverse proxy.
Check Certbot renewal scheduling and renew --dry-run periodically.
After reboot, re-test Ollama, Open WebUI health, HTTPS and local-only port bindings.
R
Official sources

Official Ollama and Open WebUI resources

+
EKA Sunucu

Related EKA Sunucu self-hosted AI and Linux guides

?
FAQ

Frequently asked questions about Ollama, Qwen3 and Open WebUI

Does Ollama run in Docker on Ubuntu 24.04?

Yes. In this real test Ollama 0.32.6 ran as a Docker container on Ubuntu 24.04.4 LTS in CPU mode.

Is a GPU required for Ollama?

No. CPU inference works, although speed depends on the model and processor. Our qwen3:4b deployment was validated without GPU passthrough.

How much disk space did qwen3:4b use in this test?

The Ollama model list showed about 2.5 GB; API metadata reported 4.0B and Q4_K_M quantization.

Which port does Ollama use?

The default Ollama API port is 11434. In this architecture it was bound only to 127.0.0.1:11434 on the host.

Which port does Open WebUI use?

It used port 8080 inside the container and only 127.0.0.1:3000 on the host. Public access was provided through Nginx on 443.

Which URL does Open WebUI use for Ollama?

On the shared eka-ai Docker network we used http://ollama:11434. If Ollama runs on the host, Open WebUI documentation also describes host.docker.internal:11434 for Docker.

Why can Open WebUI remain unhealthy during first startup?

First boot can include database migrations and embedding-model preparation. In our test /health returned 200 with status true after initialization finished.

Should I use the Open WebUI :main tag in production?

The real test used :main. It is a rolling tag; pinning a tested version can make production updates more predictable.

Do ports 3000 and 11434 need to be public?

No. Both were restricted to localhost in this guide; only Nginx 80/443 listened publicly.

Does Open WebUI require WebSocket support?

Yes. A reverse proxy should preserve HTTP/1.1 Upgrade and Connection headers.

Is the first Open WebUI account an administrator?

The first account created receives administrator privileges. Review the registration and approval policy before adding more users.

Will Open WebUI data survive container recreation?

Yes if the openwebui_data named volume is preserved. Removing the volume can destroy application data.

How do I test automatic SSL renewal?

Use certbot renew --dry-run to simulate renewal without replacing the live certificate. The real deployment passed this test.

Can I run a larger model on an EKA Sunucu VPS?

Yes if the server has sufficient RAM, disk and preferably suitable GPU resources. Larger models increase inference time and memory requirements.

EKA YAZILIM VE BİLİŞİM SİSTEMLERİ

Need a Linux VPS for self-hosted local AI?

Run Ollama, Qwen3, Open WebUI, n8n and other self-hosted AI services on your own infrastructure with EKA Sunucu Linux VPS plans.

Updated: 10.08.2026
View Linux VPS PlansLinux & VPS Guides
Top