Introducing our new CEO Don Johnson - Read More

ubuntu/nginx

Verified Publisher

By Canonical

Updated 2 months ago

Nginx, a high-performance reverse proxy & web server. Long-term tracks maintained by Canonical.

Image
Web Servers
126

10M+

Nginx | Ubuntu

Current Nginx Docker Image from Canonical, based on Ubuntu. Receives security updates and tracks the newest combination of Nginx and Ubuntu. This repository is free to use and exempted from per-user rate limits.

About Nginx

Nginx ("engine X") is a high-performance web and reverse proxy server created by Igor Sysoev. It can be used both as a standalone web server and as a proxy to reduce the load on back-end HTTP or mail servers. Read more on the nginx website.

Tags and Architectures

LTS Up to 5 years free security maintenance on LTS channels.

ESM Up to 10 years customer security maintenance from canonical/nginx. Request access.

Tags in italics are not available in ubuntu/nginx but are shown here for completeness.

Channel TagCurrentlyArchitectures
1.18-22.04_betaLTSNginx 1.18 on Ubuntu 22.04 LTSamd64, arm64, ppc64el, s390x
1.18-20.04_betaLTSNginx 1.18.0 on Ubuntu 20.04 LTSamd64, arm64, ppc64el, s390x
track_risk

Channel Tag shows the most stable channel for that track. A track is a combination of both the application version and the underlying Ubuntu series, eg 1.0-22.04. Channels are ordered from the most stable to the least stable, candidate, beta, edge. More risky channels are always implicitly available. So if beta is listed, you can also pull edge. If candidate is listed, you can pull beta and edge. When stable is listed, all four are available. Images are guaranteed to progress through the sequence edge, beta, candidate before stable.

Commercial use and Extended Security Maintenance channels

If your usage includes commercial redistribution or requires unavailable channels/versions, please get in touch with the Canonical team (or using rocks@canonical.com).

Usage

Launch this image locally:

docker run -d --name nginx-container -e TZ=UTC -p 8080:80 ubuntu/nginx:1.18-22.04_beta

Access your Nginx server at http://localhost:8080.

Parameters

ParameterDescription
-e TZ=UTCTimezone.
-p 8080:80Expose Nginx on localhost:8080.
-v /local/path/to/website:/var/www/htmlMount and serve a local website.
-v /path/to/conf.template:/etc/nginx/templates/conf.templateMount template files inside /etc/nginx/templates. They will be processed and the results will be placed at /etc/nginx/conf.d. (e.g. listen ${NGINX_PORT}; will generate listen 80;).
-v /path/to/nginx.conf:/etc/nginx/nginx.confLocal configuration filenginx.conf (try this example).

Testing/Debugging

To debug the container:

docker logs -f nginx-container

To get an interactive shell:

docker exec -it nginx-container /bin/bash

Deploy with Kubernetes

Works with any Kubernetes; if you don't have one, we recommend you install MicroK8s and microk8s.enable dns storage then snap alias microk8s.kubectl kubectl.

Download nginx.conf, index.html and nginx-deployment.yml and set containers.nginx.image in nginx-deployment.yml to your chosen channel tag (e.g. ubuntu/nginx:1.18-22.04_beta), then:

kubectl create configmap nginx-config --from-file=nginx=nginx.conf --from-file=nginx-site=index.html
kubectl apply -f nginx-deployment.yml

You will now be able to connect to the nginx server on http://localhost:31080.

Bugs and feature requests

If you find a bug in our image or want to request a specific feature, please file a bug here:

https://bugs.launchpad.net/ubuntu-docker-images/+filebug

Please title the bug "nginx: <issue summary>". Make sure to include the digest of the image you are using, from:

docker images --no-trunc --quiet ubuntu/nginx:<tag>

Deprecated channels & tags

These channels (tags) are not updated anymore. Please upgrade to newer channels, or reach out if you can't upgrade.

TrackVersionEOLUpgrade Path
1.18-21.10Nginx 1.18.0 on Ubuntu 21.10 07/2022 1.18-22.04_beta
1.18-21.04Nginx 1.18.0 on Ubuntu 21.04 01/20221.18-21.10
track

Docker Pull Command

docker pull ubuntu/nginx