This approach is recommended for full compatibility and security, as Docker and Proxmox kernels may conflict.
Update the system:
sudo apt update && sudo apt upgrade -y
Install Docker:
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
Verify the installation:
docker --version
(Optional) Add your user to the Docker group:
sudo usermod -aG docker $USER
Install Docker Compose:
sudo apt install docker-compose