Install Docker
Learn how to install Docker in Ubuntu (64bit) with these simple steps (for other distributions or architectures, see: Install Docker Engine).
- Update repositories and install required packages:
sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg \ lsb-release
- Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- Add the repository:
echo \ "deb [arch=amd64 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
- Install Docker
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
- Add current user to “docker” group
sudo usermod -aG docker $USER # or sudo adduser $USER docker
Now you can run containers, for example:
docker run -p 8080:80 nginx
To install Docker Compose, check https://docs.docker.com/compose/install/.
If you have any suggestion, feel free to contact me via social media or email.
Latest tutorials and articles:
Featured content: