Install Docker¶
Docker is an open-source platform for building, shipping, and running applications in isolated containers. It packages code and all dependencies together so the application runs consistently across environments.
Ubuntu and its derivatives only
This script targets Ubuntu-based systems (Debian family). It is not supported on RHEL, Fedora, Alpine, or macOS.
Not for production use
This installer is designed for local development, lab clusters, and CI environments. For production, follow the official Docker hardening guide.
What Gets Installed¶
| Component | Purpose |
|---|---|
docker-ce | Docker Engine (daemon + CLI) |
docker-ce-cli | Docker CLI |
containerd.io | Low-level container runtime |
docker-buildx-plugin | Multi-platform image build support |
docker-compose-plugin | docker compose subcommand |
Prerequisites¶
- Ubuntu or an Ubuntu-based OS
curlavailable- Run as root or with
sudo
Install¶
curl -fsSL https://raw.githubusercontent.com/ibtisam-iq/silver-stack/main/scripts/installers/install-docker.sh | sudo bash
Idempotent — safe to re-run
If Docker is already installed, the script detects it, validates the daemon state, repairs it if inactive, and exits without reinstalling.
What the Script Does¶
- Runs preflight checks (OS, connectivity, root access)
- Installs
ca-certificatesandcurlas prerequisites - Adds the official Docker APT repository and GPG key
- Installs all five Docker components in one
apt-get install - Enables and starts the Docker daemon via
systemctl - Adds the invoking user to the
dockergroup
Post-Install¶
Apply the docker group to the current shell session without logging out:
Verify the installation: