This guide uses Docker to run NGINX.
For Docker installation, see Docker.
Create a directory to store your configuration and compose files.
mkdir -p /opt/nginx
cd /opt/nginx
Define a container for NGINX.
services:
nginx:
image: nginx:1.29.6 # Use specific version that includes security fix for CVE-2026-1642 and sticky sessions support
ports:
- "80:80"
- "443:443"
volumes:
- ./config:/etc/nginx
restart: unless-stopped
Start the container in the background.
docker compose up -d
nginx:1.29.6 (mainline) or nginx:1.28.2 (stable)nginx-plus:latestdocker exec <container> nginx -vRunning containers in production? We help with:
Need help? office@linux-server-admin.com or Contact Us