Skip to main content
install the latest version of Docker on Ubuntu

How to install the latest version of Docker on Ubuntu

We have discussed how to install Docker CE on CentOS 7 here. In this article, I will tell you how to install the latest version of Docker on Ubuntu systems. If you are new here, please take a look at my first article on Docker here. It will give you an overall idea about Docker and its working.

How to install the latest version of Docker on Ubuntu?

Requirements

You need a 64-bit version of Ubuntu for installing Docker as Docker is only supported on 64-bit arch.

Uninstall Old Versions

If you have installed an older version of Docker, please uninstall using the following command.

sudo apt-get remove docker docker.io docker-engine

 

Method 1 – Installing Docker CE using the repository (Recommended)

First, update the apt package index using the command:

sudo apt-get update

Now, execute the following command to allow apt to use a repository over HTTPS:

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

Next, add Docker’s official GPG key using:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

We can now set up the stable repository using the following command:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Now, again update the apt package index using:

sudo apt-get update

Then, install the latest version of Docker CE using:

sudo apt-get install docker-ce

You can verify that Docker CE is installed correctly by running the hello-world image:

sudo docker run hello-world

Check the installed Docker CE version using the following command:

docker --version

Method 2 – Manually install by downloading the .deb file

In this method, we download the .deb file for the Docker CE release and install it manually.

So, go to https://download.docker.com/linux/ubuntu/dists/, download the .deb file for the Docker version you want to install.

The path to the package will be “distribution/pool/stable/arch/”.

Once, the file is downloaded, you can install Docker CE, by executing the following command:

sudo dpkg -i /path/to/package.deb

The Docker daemon will start automatically.

Verify that Docker CE is installed correctly by running the hello-world image:

sudo docker run hello-world

Check the installed Docker Version by using:

docker --version

That’s it. We have installed Docker CE on your Ubuntu System. Any queries? Please leave a comment below.

How to install the latest version of Docker on Ubuntu
5 (100%) 1 vote[s]

GeeksAlive

TheGeeksAlive is all about Linux, Server Administration, Web Hosting and other Open Source Technologies.