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 4B Setup: Local AI with Docker
Ollama, Qwen3, Docker and Ubuntu 24.04

How to Install Ollama + Qwen3 4B on Ubuntu 24.04 with Docker

In this real Ubuntu 24.04.4 LTS VPS test we ran Ollama in Docker, pulled qwen3:4b at roughly 2.5 GB, sent a real /api/chat inference request and kept the Ollama API restricted to 127.0.0.1:11434 instead of exposing it directly to the public Internet.

Ubuntu 24.04OllamaQwen3qwen3:4bDockerLocal AISelf Hosted AILLMLinux VPSCPU InferenceEKA Sunucu
Ollama / Qwen3 / Open WebUI / Ubuntu 24.04
Ubuntu 24.04.4 LTS
   ↓ Docker / eka-ai
Ollama :11434
   ↓
qwen3:4b
   ↓
Real /api/chat test
   ↓
127.0.0.1 local API
Ollama0.32.6Open WebUI0.11.0 test
13real WebP screenshots
3TR · EN · DE content
443public HTTPS
127.0.0.1AI service loopback
01Ollama in Docker
02qwen3:4b model
03Real API inference
04localhost port security
00
Table of contents

Ubuntu 24.04 Ollama + Qwen3 4B installation steps

  1. 01What are we building with Ollama and Qwen3 4B 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. 08Verify CPU/RAM usage and localhost port security
01
Real test architecture

What are we building with Ollama and Qwen3 4B on Ubuntu 24.04?

This guide documents a real Docker-based Ollama deployment on Ubuntu 24.04.4 LTS. The goal is to run qwen3:4b fully on the VPS while keeping the API off the public interfaces.

The final setup attaches Ollama to the eka-ai Docker network, stores models in the persistent ollama_data named volume and exposes the host API only on 127.0.0.1:11434.

Command 1
Ubuntu 24.04.4 LTS
   ↓
Docker / eka-ai
   ↓
Ollama :11434
   ↓
qwen3:4b
   ↓
127.0.0.1 local API
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

Verify CPU/RAM usage and localhost port security

After real inference, qwen3:4b was loaded on CPU and the Ollama container used about 3 GiB of memory in our test. Actual use changes with model, context and concurrency.

The key final check is that port 11434 listens only on 127.0.0.1, preventing the default Ollama API from being published directly on public interfaces.

Command 1
docker exec ollama ollama ps
docker stats --no-stream ollama
Command 2
ss -lntp | grep ':11434'
docker network inspect eka-ai --format '{{range .Containers}}Network={{$.Name}} IP={{.IPv4Address}}{{end}}'
Production checklist

Ollama production security checklist

Do not expose port 11434 directly on 0.0.0.0 without controls.
Keep the host API on 127.0.0.1 or a private network.
Back up the ollama_data volume regularly.
Monitor RAM and disk usage as model sizes grow.
Use a Docker restart policy.
Create snapshots or a rollback plan before image updates.
Add TLS and authentication when publishing the API remotely.
Re-check the container, model list and API health after reboot.
R
Official sources

Official Ollama and Qwen3 resources

+
EKA Sunucu

Related EKA Sunucu Linux and AI guides

?
FAQ

Frequently asked questions about Ollama and Qwen3 4B

Does Ollama run on Ubuntu 24.04 with Docker?

Yes. In this real test Ollama ran on Ubuntu 24.04.4 LTS using the ollama/ollama Docker image.

Is a GPU required for Ollama?

No. The test VPS had no compute GPU passthrough and qwen3:4b ran in CPU mode.

How much disk space did qwen3:4b use?

The real ollama list output showed qwen3:4b at about 2.5 GB.

How many parameters does qwen3:4b have?

The real API metadata reported parameter_size 4.0B and Q4_K_M quantization.

Which port does Ollama use?

The default API port is 11434. This setup binds it only to 127.0.0.1:11434 on the host.

Should I expose the Ollama API to the Internet?

Prefer a private network, authenticated reverse proxy or another access-control layer instead of exposing the default local API directly.

How was qwen3:4b downloaded?

We used docker exec ollama ollama pull qwen3:4b inside the running container.

How do I list installed models?

Use docker exec ollama ollama list or query http://127.0.0.1:11434/api/tags.

How was inference verified?

A POST request was sent to /api/chat and qwen3:4b returned the expected EKA-OLLAMA-TEST-BASARILI text.

How much RAM was used in CPU mode?

With the model loaded, the tested Ollama container used roughly 3.06 GiB of memory.

Will models survive container recreation?

Yes if the ollama_data named volume is preserved. Deleting the volume can remove model data.

How can another Docker container reach Ollama?

Put both services on the same user-defined network and use http://ollama:11434.

Can I use a larger Qwen3 model?

Yes if your server has enough RAM, disk capacity and preferably an appropriate GPU.

What should I verify before production?

Check port bindings, volume backups, restart policy, resource usage and the API access policy.

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

Need a Linux VPS for Ollama and local AI?

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

Updated: 10.08.2026
View Linux VPS PlansLinux & VPS Guides
Top