Developer Tools Azure

Docker Engine 29 on Ubuntu 26.04 LTS on Azure User Guide

| Product: Docker Engine 29 on Ubuntu 26.04 LTS on Azure

Overview

This guide covers the deployment and use of Docker Engine 29 on Ubuntu 26.04 LTS on Azure using the cloudimg Azure Marketplace image. Docker Engine is the open source container runtime for building, shipping and running containers: the dockerd daemon, the docker command line, containerd, and the Compose and Buildx plugins.

The image installs Docker Engine from Docker's own signed APT repository for Ubuntu 26.04 (download.docker.com/linux/ubuntu, suite resolute, channel stable), so apt keeps Docker current on your running VM.

What is included:

  • Docker Engine 29.10 (docker-ce and docker-ce-cli), enabled and running at boot

  • containerd 2.4 (containerd.io) and runc 1.5 as the container runtime

  • Docker Compose v5 (docker compose) and Docker Buildx 0.39 (docker buildx, BuildKit) as Docker CLI plugins

  • A first boot service that adds the administrator account you choose at deployment to the docker group, so you run containers without sudo, and writes a short summary to /root/docker-info.txt (root only)

  • Container log rotation: the json-file log driver capped at three 10 MB files per container (/etc/docker/daemon.json)

  • The Docker API on its local Unix socket (/var/run/docker.sock, root:docker, mode 660) only: nothing listens on the Docker API's TCP ports

  • Ubuntu 26.04 LTS with unattended security upgrades left on

  • cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Default user: the administrator account you create when you deploy the VM (for example azureuser), with sudo and membership of the docker group. Docker has no password of its own.

Prerequisites

  • An active Azure subscription and an SSH public key

  • A virtual network and subnet in your target region (the Portal creates them for you if needed)

  • Network Security Group rules allowing TCP 22 from your own network; open any port you publish from a container only to the clients that need it

Recommended virtual machine size: Standard_B2s (2 vCPU, 4 GB RAM) for development, testing and light container workloads. Use Standard_D4s_v5 (4 vCPU, 16 GB RAM) or larger for production container hosts and image builds.

Step 1: Deploy the virtual machine

Option A: Azure Portal

Search for Docker Engine 29 on Ubuntu 26.04 LTS in the Azure Marketplace, select the cloudimg offer and click Create. Choose your resource group, region and size, set the administrator username and your SSH public key, and allow inbound SSH (TCP 22). Review and create.

Option B: Azure CLI

Accept the Marketplace terms once per subscription, then create the VM:

RG="docker-prod"; LOCATION="eastus"; VM_NAME="docker-host"
IMAGE_URN="cloudimg1647283583153:docker-engine-ubuntu-26-04:default:latest"
az group create --name "$RG" --location "$LOCATION"
az vm image terms accept --urn "$IMAGE_URN"
az vm create \
  --resource-group "$RG" --name "$VM_NAME" \
  --image "$IMAGE_URN" \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_rsa.pub \
  --public-ip-sku Standard

Step 2: Connect over SSH

Find the VM's public IP address and connect as the administrator you chose:

PUBLIC_IP=$(az vm show -d --resource-group "$RG" --name "$VM_NAME" --query publicIps -o tsv)
ssh azureuser@"$PUBLIC_IP"

The login message shows the Docker Engine version, the user in the docker group and a pointer to this guide.

Step 3: First boot

On first boot the image reads your administrator's name from Azure, waits for the account to exist, adds it to the docker group, checks the Docker daemon answers, and writes a summary file. This completes within a minute of the VM starting. Read it:

sudo cat /root/docker-info.txt

For a VM whose administrator is azureuser, the file reads:

# Docker Engine on this VM - written on first boot.
# Docker has no password of its own: access is by membership of the 'docker' group.
#
docker.engine.version=29.10.1
docker.group.member=azureuser
docker.socket=/var/run/docker.sock
docker.api.tcp=off
vm.address=<your VM's public IP>
#
# azureuser is in the 'docker' group. Sign out and back in once so the group applies:
#   exit
#   ssh azureuser@<your VM's public IP>
#   docker run --rm hello-world
#
# Membership of the 'docker' group is equivalent to root on this VM: add only
# users you would give sudo to (sudo usermod -aG docker <user>).
# The Docker API listens on the Unix socket only, never on TCP.
# Container logs rotate at 3 x 10 MB per container (/etc/docker/daemon.json).

If you signed in before first boot finished, sign out and back in once so your session picks up the docker group. Until then docker commands answer "permission denied" on the socket.

If Azure told the VM no public IP (for example, a VM with only a private address), the file and the login message show <your-vm-public-ip> instead; run sudo cloudimg-set-public-address <public-ip-or-dns-name> to set the address they show. Docker works on every address the VM has either way.

Step 4: Confirm Docker is running

docker.service and containerd.service are active and enabled, so they start on every boot. The client and the server both report Docker Engine 29, and the packages come from Docker's repository for Ubuntu 26.04.

systemctl is-active docker.service containerd.service
systemctl is-enabled docker.service containerd.service
docker version --format 'Client: {{.Client.Version}}  Server: {{.Server.Version}}  API: {{.Server.APIVersion}}'
dpkg-query -W -f='${Package} ${Version}\n' docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

docker.service and containerd.service are active and enabled; the Docker client and server both report version 29.10.1 with API 1.57; and the five packages docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin and docker-compose-plugin are installed from Docker's Ubuntu 26.04 resolute repository

Step 5: Run your first container

hello-world pulls a tiny image from Docker Hub and runs it, which proves the daemon, the registry connection and the container runtime end to end:

docker run --rm hello-world

docker run hello-world pulls the hello-world image from Docker Hub and the container prints Hello from Docker, This message shows that your installation appears to be working correctly, followed by the four steps Docker took

Step 6: Run a stack with Docker Compose

Compose starts multi container applications from a compose.yaml file. This example runs nginx and publishes it on the VM's loopback address only, so it is reachable from the VM (or through an SSH tunnel) but not from the internet:

mkdir -p ~/web && cd ~/web
cat > compose.yaml <<'YAML'
services:
  web:
    image: nginx:alpine
    ports:
      - "127.0.0.1:8080:80"
    restart: unless-stopped
YAML

Check the plugin versions, start the stack in the background and read the page it serves:

cd ~/web
docker compose version
docker buildx version
docker compose up -d --quiet-pull
docker compose ps --format 'table {{.Name}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}'
curl -s http://127.0.0.1:8080/ | grep -o '<title>.*</title>'

Docker Compose version v5.8.1 and Docker Buildx v0.39.1; docker compose up starts the web container from nginx alpine, docker compose ps shows it up with port 127.0.0.1 8080 mapped to 80, and curl returns the Welcome to nginx page title

To reach a loopback-published port from your own computer, open an SSH tunnel and browse to http://localhost:8080/:

ssh -L 8080:127.0.0.1:8080 azureuser@"$PUBLIC_IP"

Stop and remove the stack (its containers and network) when you are done:

cd ~/web && docker compose down

Step 7: Build an image with Buildx

docker build uses BuildKit through the Buildx plugin. Build a small image from a Dockerfile and run it:

mkdir -p ~/hello-image && cd ~/hello-image
cat > Dockerfile <<'DF'
FROM alpine:3.22
CMD ["echo", "Hello from an image built on this VM"]
DF
docker buildx build -t hello-image:latest --load .
docker run --rm hello-image:latest

The last command prints Hello from an image built on this VM. docker image ls lists the images you have pulled and built.

Step 8: The docker group, log rotation and the API socket

The Docker API is a Unix socket owned by root:docker with mode 660, so only root and members of the docker group can use it. Container logs use the json-file driver with rotation at three 10 MB files, and nothing listens on the Docker API's TCP ports (2375 and 2376): the only TCP listener open to the network is SSH.

stat -c '%n %U:%G %a' /var/run/docker.sock
cat /etc/docker/daemon.json
docker info --format 'Logging: {{.LoggingDriver}}  Cgroup: {{.CgroupDriver}}  Storage: {{.Driver}}  Root: {{.DockerRootDir}}'
sudo ss -Hlnt

The Docker socket /var/run/docker.sock is owned by root and the docker group with mode 660; daemon.json sets the json-file log driver with max-size 10m and max-file 3; docker info reports json-file logging, the systemd cgroup driver and overlayfs storage under /var/lib/docker; and ss lists only SSH on port 22 and the local DNS resolver, with nothing on the Docker API ports

To let another user run Docker without sudo, add it to the group and have it sign in again. Membership of the docker group is equivalent to root on the VM, so add only users you would give sudo to:

sudo usermod -aG docker <user>

Step 9: Keep Docker up to date

Ubuntu's unattended upgrades keep the operating system patched. Docker's packages come from Docker's repository, so upgrade them with apt when a new release is out:

sudo apt-get update
sudo apt-get install -y --only-upgrade docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
docker version --format 'Server: {{.Server.Version}}'

Upgrading docker-ce restarts the daemon; containers started with a restart policy (such as restart: unless-stopped above) come back on their own.

Server components

Component Version Source
Docker Engine (docker-ce, docker-ce-cli) 29.10.1 download.docker.com, resolute/stable
containerd (containerd.io) 2.4.2 download.docker.com, resolute/stable
runc 1.5.3 bundled with containerd.io
Docker Compose (docker-compose-plugin) 5.8.1 download.docker.com, resolute/stable
Docker Buildx (docker-buildx-plugin) 0.39.1 download.docker.com, resolute/stable
Operating system Ubuntu 26.04 LTS Canonical

Filesystem layout

Path What it holds
/ The 30 GB OS disk (about 28 GB usable); Docker's data lives here
/var/lib/docker Docker's data root: images, containers, volumes and build cache
/var/lib/containerd containerd's content store and snapshots
/etc/docker/daemon.json Daemon settings (log rotation)
/var/run/docker.sock The Docker API socket (root:docker, 660)
/root/docker-info.txt The first boot summary (root only)
/mnt The Azure temporary disk: its contents are lost when the VM is deallocated, so never keep Docker data there

Images and volumes can fill the OS disk. Check usage with docker system df, and free space with docker system prune (add -a to remove every unused image). For a busy host, resize the OS disk in the Azure portal.

Managing the service

sudo systemctl status docker.service --no-pager --lines=0
docker ps -a
docker system df

Restart the daemon after changing /etc/docker/daemon.json with sudo systemctl restart docker, and read its log with sudo journalctl -u docker.service.

Troubleshooting

  • permission denied while trying to connect to the Docker daemon socket: your session started before your user joined the docker group. Sign out and back in. Check with id -nG.

  • Cannot connect to the Docker daemon: check systemctl status docker.service and sudo journalctl -u docker.service -n 50. A syntax error in /etc/docker/daemon.json stops the daemon from starting.

  • A published port does not answer from outside: check that the container publishes on 0.0.0.0 (not 127.0.0.1) and that the VM's Network Security Group allows the port from your address. Docker writes its own firewall rules, so a port published on all addresses bypasses ufw; the NSG still applies.

  • The disk is full: docker system df shows what uses the space; docker system prune -a removes unused images, stopped containers and build cache.

  • First boot details: sudo journalctl -u docker-firstboot.service and /var/log/cloudimg-firstboot.log.

Security recommendations

  • Restrict the NSG. Allow TCP 22 only from your own network, and open container ports only to the clients that need them. Publish internal services on 127.0.0.1 and reach them through an SSH tunnel.

  • Keep the API on the socket. Do not expose the Docker API on TCP; anyone who can reach it controls the host. Use ssh (or a Docker context over SSH) for remote access.

  • Treat the docker group as root. Add only trusted administrators.

  • Use trusted images. Pull official or verified images, pin tags or digests in production, and rebuild regularly to pick up base image fixes.

  • Keep Docker and Ubuntu current. Unattended security upgrades stay on for the OS; upgrade Docker's packages as shown in Step 9.

Support and licensing

Docker Engine (the Moby project), the Docker CLI, containerd, runc, Docker Compose and Docker Buildx are open source software under the Apache License 2.0; this image does not include Docker Desktop. cloudimg provides the packaging, the first boot setup, the image maintenance and support. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours.

Docker is a trademark of Docker, Inc. Ubuntu is a registered trademark of Canonical Ltd. cloudimg is not affiliated with, endorsed by or sponsored by either of them.

Deploy on Azure

Find Docker Engine 29 on Ubuntu 26.04 LTS on the Azure Marketplace, published by cloudimg, and deploy it from the Portal or the Azure CLI as shown above.

Need help?

Email support@cloudimg.co.uk for deployment help, configuration questions or licensing enquiries.