installdockerinubuntu
Tested in Ubuntu Server 24.x
Update and install dependencies:
sudo apt update sudo apt install ca-certificates curl gnupg lsb-release -y
Add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg
Set up the repository:
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" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install Docker Engine:
sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
Create base folder (suggest to put in home folder or /opt folder) create as regular user, not root if in home folder
sudo cd /opt sudo mkdir docker
However, to make your life easier when using Docker as a regular user (if under /opt), there is a specific way to handle the permissions.
Change Ownership to your user, this is the “secret sauce.” It allows your regular user (and Webmin's file manager) to edit the config files without needing sudo every single time.
sudo chown -R $USER:$USER /opt/docker
installdockerinubuntu.txt · Last modified: by jwan
