Purpose
This article explains how to install Docker Engine and the Docker Compose plugin on an Ubuntu VM.
This guide follows Docker's official Ubuntu instsallation method: https://docs.docker.com/engine/install/ubuntu/
Overview
Giotto relies on containerized services, so Docker is a core prerequisite for running the platform.
This article shows one working installation example for:
- Docker Engine
- Docker Compose plugin
on Ubuntu 22.04+.
When to use this article
Use this article when:
- you are preparing a fresh VM for Giotto
- Docker is not yet installed
- you need
docker composesupport - you want a clean baseline installation using Docker’s official repository
What this installation does
This setup:
- installs required system packages
- adds Docker’s official APT repository and GPG key
- installs Docker Engine and related plugins
- enables and starts the Docker service
- verifies the installation
Example installation script
The following script is a working example for Ubuntu 22.04+:
#!/usr/bin/env bash
set -euo pipefail
# Installs Docker Engine + docker compose plugin on Ubuntu 22.04+.
# Run as root (or via sudo).
apt-get update
apt-get install -y ca-certificates curl gnupg lsb-release
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker
echo "Docker installed:"
docker --version
docker compose version
Step-by-step explanation
1. Install base packages
The script begins by installing:
ca-certificatescurlgnupglsb-release
These are needed to securely add Docker’s package repository.
2. Add Docker’s repository key
The script downloads Docker’s GPG key and stores it in:
/etc/apt/keyrings/docker.gpg
This allows APT to trust packages from Docker’s repository.
3. Add Docker’s APT repository
The script creates a repository entry that points to Docker’s official Ubuntu package source.
This ensures that Docker packages are installed from the official Docker distribution channel rather than the default Ubuntu repository.
4. Install Docker Engine and plugins
The script installs:
docker-cedocker-ce-clicontainerd.iodocker-buildx-plugindocker-compose-plugin
This provides both the core Docker runtime and the Compose functionality needed for multi-service deployments.
5. Enable and start Docker
The command:
systemctl enable --now docker
starts Docker immediately and also ensures it starts automatically on boot.
6. Verify the installation
The script ends by printing:
docker --versiondocker compose version
This is a quick confirmation that both Docker Engine and the Compose plugin are installed.
How to verify the installation
After installation, run:
docker --version
docker compose version
You can also check that the Docker service is active:
systemctl status docker
If everything is installed correctly, Docker should be running and docker compose should be available as a command.
Optional post-install step
If you want to use Docker without sudo, you may later add your user to the docker group.
That is optional and depends on your VM administration and security model. If you do this, remember that group changes usually require a new shell session or re-login.
Common issues
docker command not found
This usually means the installation did not complete or the package repository was not added correctly.
docker compose does not work
This usually indicates that the Compose plugin was not installed, even if Docker itself is present.
Docker service is installed but not running
Check the service status with:
systemctl status docker
and inspect logs if the service failed to start.
Permission denied when using Docker
This usually means the current user is not allowed to access the Docker socket without elevated privileges.
Best practices
Use Docker’s official repository
This helps keep the Docker installation current and aligned with official package releases.
Verify both Docker and Compose
Do not stop at docker --version. Make sure docker compose version also works.
Install Docker before Giotto
Docker is a prerequisite for the platform installation, so it should be validated first.
Combine with NVIDIA Container Toolkit for GPU workloads
If the VM is GPU-enabled, Docker should be installed together with the NVIDIA Container Toolkit so containers can access the GPU.
Comments
0 comments
Article is closed for comments.