install docker ubuntu 20.04

A Step-by-Step Guide to Installing Docker on Ubuntu 20.04

Ubuntu

To install Docker on Ubuntu 20.04, you can use the following steps:

  1. Update the package index:
Copy codesudo apt update
  1. Install the packages to allow apt to use a repository over HTTPS:
Copy codesudo apt install apt-transport-https ca-certificates curl software-properties-common
  1. Add the Docker official GPG key:
Copy codecurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  1. Verify the fingerprint of the key:
Copy codesudo apt-key fingerprint 0EBFCD88
  1. Add the Docker repository to your system:
Copy codesudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  1. Update the package index again:
Copy codesudo apt update
  1. Install Docker CE:
Copy codesudo apt install docker-ce
  1. Start the Docker service and enable it to start at boot:
Copy codesudo systemctl start docker
sudo systemctl enable docker

You can verify that Docker is working by running the following command:

Copy codedocker run hello-world

You can also add user to the docker group

Copy codesudo usermod -aG docker $USER

and logout or restart the session to take effect the permission.

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *