Install Docker on Ubuntu 18.04

Continuing to our series Docker for Beginners, In the previous post we’ve seen What is Docker and its related terminologies. In this post we will be seeing how one can get started with Docker i.e. Installation of Docker on Ubuntu 18.04.

So let’s get started.

Step 1: Update your Ubuntu system and  Install Prerequisite Packages for Docker

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

Step 2: Add the Docker Repositories

curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
sudo apt update
apt-cache policy docker-ce

Step 3: Use the apt command to install Docker

sudo apt install docker-ce

Step 4: Start and Automate Docker on startup

sudo systemctl start docker
sudo systemctl enable docker

Step 4: Verify

docker --version

docker -version
docker -version

Step 5: Run container

sudo docker container run hello-world
docker hello-world
docker hello-world

So, this is how you can get started with Docker, In the next post we will be seeing how to pull existing image from Docker hub and get inside the docker container.

One thought on “Install Docker on Ubuntu 18.04

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s