This guide uses Docker to run Unbound.
For Docker installation, see Docker.
Create a directory to store your configuration and compose files.
mkdir -p /opt/unbound
cd /opt/unbound
Define a container for Unbound.
services:
unbound:
image: mvance/unbound:latest
ports:
- "53:53/udp"
- "53:53/tcp"
volumes:
- ./config:/opt/unbound
restart: unless-stopped
Note: There is no official Unbound Docker image from NLnet Labs. This guide uses mvance/unbound, a well-maintained community image (10M+ pulls). Alternative: madnuttah/unbound.
Start the container in the background.
docker compose up -d
Deploying Unbound in containers for production? Our consulting covers:
Get expert help: office@linux-server-admin.com | Contact Page