Install Docker CE on Ubuntu 18.04 | 18.10 | 20.04

Table of Contents

Install Docker CE on Ubuntu 18.04 | 18.10 | 20.04

 

 

 

Docker CE can be used to create containers for free. This is a rebranded open-source alternative to Docker that has been freely available since Docker was launched in 2013. Among the operating systems supported by CE are Windows 10 and Mac, Azure and AWS, as well as CentOS, Debian, Fedora, and Ubuntu. For users who are looking to integrate cloud services into applications, it is utilized as a container system.

 

 

 

 

Throughout this guide, we provide instructions on how to install Docker CE on Ubuntu 18.04, 18.10, and 20.04.

 

 

 

 

 

 

So let’s begin,

 

 

 

 

 

 

 

Step 1: Getting your system up and running

 

 

 

 

  1. Sign in to your system or register a newly created one by logging in to your VPSie account. 
  2. Connect by SSH using the credentials we emailed you.
  3. Once you have logged into your Ubuntu instance, run these commands to update your system.
apt-get update && apt-get upgrade -y

 

 

 

 

 

 

Step 2: Remove old versions

 

 

 

 

 

Skip this step if your machine is brand new. Docker used to be called docker.io, docker or docker-engine. Uninstall them if you have them installed on your machine:

 

 

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

 

 

 

 

 

 

Step 3: Configure the repository

 

 

 

 

 

Set up apt to use an HTTPS repository by installing the following packages:  

 

 

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

 

 

 

 

Include Docker’s GPG key:

 

 

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

 

 

Make sure you have the fingerprint for the key at hand 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 using the following methods:  

 

 

 

sudo apt-key fingerprint 0EBFCD88

pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <[email protected]>
sub   rsa4096 2017-02-22 [S]

 

 

 

 

 

Set up the stable repository by running the following command,

 

 

 

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

 

 

 

 

 

 

Step 4: Installation of Docker CE

 

 

 

 

Create an updated apt package index,

 

 

sudo apt-get update

 

 

 

 

Install Docker CE and containers using the latest version,

 

 

sudo apt-get install docker-ce docker-ce-cli containerd.io

 

 

 

 

 

 

Step 5: Create and test user

 

 

 

 

 

Once the group is created, users are not added, so let’s add them

 

adduser user
usermod -aG docker user

 

 

 

Start the Docker service again,

 

systemctl restart docker

 

 

 

 

 

Test the installation by running the Docker hello-world container,

 

docker run hello-world

 

 

 

OUTPUT

 

# docker run hello-world

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

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

 

 

 

 

 

 

Step 6: Set Docker to start on boot

 

 

 

 

 

Run the following command,

 

 

 

systemctl enable docker

 

 

 

 

Docker has been installed successfully. Check out the official documentation to learn more.  

 

 

 

 

 

 

 

Thanks for reading! I hope it was informative for you! 

 

 

 

 


 

 

Try VPSie for free today!


Share on
Facebook
Twitter
LinkedIn
Print