Local stack to run Ollama (custom image with Qwen3 preloaded) and Open WebUI using Docker Compose.
This setup provides a ready-to-use local AI chat environment without downloading models at runtime.
- ollama-qwen3 → Ollama runtime with model
qwen3:4bpreloaded
API available athttp://localhost:11434 - open-webui → Web-based chat interface available at
http://localhost:3000
- Docker (Docker Desktop on macOS)
- Docker Compose v2 (
docker compose) - Free ports:
11434(Ollama + Qwen3 API)3000(Open WebUI)
Fedora / RHEL / CentOS
sudo dnf install -y docker
sudo systemctl enable --now dockerUbuntu / Debian
sudo apt update && sudo apt install -y docker.iomacOS
brew install --cask dockerVerify installation:
docker --version
docker compose versionCreate a .env file in the same directory as docker-compose.yaml:
WEBUI_SECRET_KEY=change-me-to-a-long-random-secret
ENABLE_SIGNUP=trueGenerate a secure secret:
openssl rand -hex 32From the project directory:
docker compose up -dAccess:
- Open WebUI → http://localhost:3000
- Ollama API → http://localhost:11434
On first access, Open WebUI will ask you to create the first user (admin). This is expected behavior.
curl http://localhost:11434Expected response:
Ollama is running
curl http://localhost:11434/api/tagsOpen in the browser:
http://localhost:3000
Create a user, log in, and test a chat with the model.
docker logs ollama-qwen3
docker logs open-webuidocker compose stopdocker compose startdocker compose downdocker compose down -vThis removes:
- Downloaded models (Ollama)
- Users and conversations (Open WebUI)
ghcr.io/r3xakead0/qwen3-container/ollama-qwen3:latest
- Change
WEBUI_SECRET_KEYto a long, random secret - After creating the first user, disable signups:
then recreate containers:
ENABLE_SIGNUP=false
docker compose up -d --force-recreate
- Ollama responding on
localhost:11434 - Open WebUI accessible on
localhost:3000 - Model available and functional
This project uses the following open-source components:
-
Ollama – MIT License
https://github.com/ollama/ollama -
Open WebUI – MIT License
https://github.com/open-webui/open-webui -
Buildah – Apache License 2.0
https://github.com/containers/buildah -
Docker / Docker Compose – Apache License 2.0
https://www.docker.com/
This project is licensed under the MIT License. See the LICENSE file for details.
