Installation guide

Install Docker on Ubuntu 24.04.4 LTS with one reviewed command

A practical guide to using install_docker_ubuntu_2404.sh on Ubuntu 24.04.4 LTS, including where it fits best, what it changes, and how to verify the result safely.

6 min read · 2026-03-23

What this script is for

install_docker_ubuntu_2404.sh is designed for Ubuntu 24.04.4 LTS hosts that need a clean Docker Engine and Docker Compose installation path without manually repeating the official repository setup steps.

It is best used when you want a reviewed, curlable installer published through helper.sh, rather than a long checklist copied into a runbook or chat window.

Terminal output showing the beginning of install_docker_ubuntu_2404.sh on Ubuntu 24.04.4 LTS
The installer starts by checking Ubuntu version, preparing dependencies, and configuring the Docker repository.

What it changes on the host

The script removes older conflicting Docker packages, installs the Docker signing key and APT repository, installs Docker Engine plus the Compose plugin, writes a baseline /etc/docker/daemon.json, and restarts Docker.

For package installation, it prefers the official Docker Ubuntu repository first. If download.docker.com is unreachable, it falls back to the Aliyun Docker CE mirror automatically.

It also tries to add the invoking non-root user into the docker group so later Compose or docker commands do not need sudo after re-login.

  • Removes docker.io and other legacy packages if present
  • Uses the official Docker Ubuntu repository instead of older distro packages
  • Runs docker --version, docker compose version, and hello-world validation at the end

How to use it safely in production-like environments

If the server already runs containers, treat this as a change operation rather than a casual bootstrap command. Review the script first, confirm whether /etc/docker/daemon.json already contains custom settings, and schedule a short maintenance window because Docker will restart.

If the server is brand new, the one-liner is usually enough. For stricter environments, download the raw file first, review it internally, and then execute it from local storage.

What happens when Docker Hub is unreachable

The script now checks whether the host can reach the Docker registry. If that connectivity check fails, it merges a registry mirror into /etc/docker/daemon.json instead of leaving the installation half-usable.

The mirror added by the script is https://docker.1ms.run. After writing that value into registry-mirrors, the script restarts Docker automatically and then retries the hello-world validation path.

Terminal output showing automatic registry mirror fallback during Docker installation
When Docker Hub cannot be reached, the script backs up daemon.json, adds docker.1ms.run, restarts Docker, and continues validation.
  • Works for fresh installs where daemon.json does not exist yet
  • Also works when Docker is already installed but registry-mirrors is still missing
  • Preserves existing daemon.json content by merging instead of blindly overwriting

Recommended verification after installation

After the script finishes, confirm both the version output and the service state. If a non-root user was added to the docker group, remember that the permission change does not apply to existing shells until re-login or newgrp docker.

Terminal output showing the final Docker and Docker Compose versions after installation
A successful end state: Docker and Docker Compose versions are printed, useful commands are listed, and the registry mirror plus daemon.json backup are shown.
  • Check docker --version
  • Check docker compose version
  • Check systemctl status docker
  • Run docker run --rm hello-world again if you need a second validation

Related topics

Ubuntu 24.04 deployment basics

Install Docker, bootstrap common runtime services, and keep fresh Ubuntu 24.04 hosts ready for application rollout.

Open topic

Problem pages

How to install Docker on Ubuntu 24.04

Use a one-shot install flow that handles package cleanup, official repositories, and Docker Hub reachability checks.

Open page