How to install docker in ubuntu?

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

How to install docker in ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by tina , 2 years ago

@sarai_bergstrom 

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

  1. First, update the package manager index by running the following command:
1
sudo apt update


  1. Next, install the dependencies required to add a new repository to your system by running the following command:
1
sudo apt install apt-transport-https ca-certificates curl software-properties-common


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


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


  1. Once the repository is added, update the package manager index again by running the following command:
1
sudo apt update


  1. Finally, install Docker by running the following command:
1
sudo apt install docker-ce


After installation is complete, you can verify that Docker is running by running the following command:

1
sudo systemctl status docker


This will display the status of the Docker service, including whether it is running or not. If the service is running, you should see a message similar to the following:

1
2
3
4
5
6
7
8
9
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-06-04 15:50:41 UTC; 1h 7min ago
     Docs: https://docs.docker.com
 Main PID: 4673 (dockerd)
    Tasks: 16
   Memory: 31.2M
   CGroup: /system.slice/docker.service
           └─4673 /usr/bin/dockerd -H fd://


by cathrine_goyette , a year ago

@sarai_bergstrom 

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