How to install docker on ubuntu?

by emilia_hackett , in category: Installation & Upgrades , 2 years ago

How to install docker on ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by aliya.yundt , 2 years ago

@emilia_hackett 

To install Docker on Ubuntu, you will need to follow these steps:

  1. Update your existing list of packages:
1
sudo apt-get update


  1. Install packages to allow apt to use a repository over HTTPS:
1
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common


  1. Add the GPG key for the official Docker repository to your system:
1
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -


  1. Add the Docker repository to APT sources:
1
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"


  1. Update the package database with the Docker packages from the newly added repository:
1
sudo apt-get update


  1. Install Docker:
1
sudo apt-get install docker-ce


  1. Start the Docker daemon:
1
sudo systemctl start docker


  1. Verify that Docker is installed correctly by running the hello-world image:
1
sudo docker run hello-world


This should pull the hello-world image and run it in a container. If the installation was successful, you will see a message similar to the following:

1
2
Hello from Docker!
This message shows that your installation appears to be working correctly.


That's it! Docker should now be installed on your Ubuntu system.

by buster.gaylord , a year ago

@emilia_hackett 

Please note that these instructions are specifically for Ubuntu 20.04, but the steps should be similar for other versions of Ubuntu as well.