Background
The following steps outline how to install Docker Engine on Ubuntu.
Requirements
- OS
- Ubuntu Impish 21.10
- Ubuntu Hirsute 21.04
- Ubuntu Focal 20.04 (LTS)
- Ubuntu Bionic 18.04 (LTS)
Installation
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
Setup the Repo
Run the following commands to prepare:[1]
1 | $ sudo apt-get update |
Add Docker’s official GPG key:
1 | $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg |
Configure the repo:
1 | $ echo \ |
Install the Docker Engine
1 | $ sudo apt-get update |
Post-Install Configuration
Once that completes, run the following commands to allow docker to run as non-root:[2]
1 | $ sudo groupadd docker |
Sources
Title: Docker Docs: Install on Ubuntu
Publication: Docker Docs ↩︎Title: Docker Docs: Post-Install for Linux
Publication: Docker Docs ↩︎