Install Docker on Ubuntu 18.04/16.04
Install Docker on Ubuntu 18.04/16.04
to install docker on Ubuntu 18.04/16.04 or to install docker on Debian, we need to follow two steps. one is setup the repository and second one is installing the docker. in the following steps i will show you how to install docker on Ubuntu 18.04/16.04/Debian step by step. for the installation of Docker CE, you need the 64-bit version Ubuntu.
to install docker on Ubuntu 18.04/16.04 or to install docker on Debian run the following commands.
Setup Repository:
sudo apt-get update sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update
Check List of The Docker Versions Available:
apt-cache madison docker-ce
you can see in the image different versions of docker.
Install Docker on ubuntu 18.04/16.04 -Latest Version:
apt-get install docker-ce -y
it will install the latest version of docker available in your repo list that is top one in the list. in my case it is 18.06.1~ce~3-0~ubuntu.
Install Specific Version Of Docker:
sudo apt-get install docker-ce=<VERSION> sudo apt-get install docker-ce=17.09.0~ce-0~ubuntu
from above list you can select your version
this will install 17.09.0~ce-0~ubuntu docker version
- DockerFile Commands Explained-cheat sheet-Tutorial
- How To Install Docker Compose
- Docker Compose Example Yml File
Use Docker With Non-Root User:
If you want to use docker with non root user you must add that user to docker group. You can see in the below image i executed docker command with devops user but it is showing permission denied. For that we have to add devops user to docker group.
sudo –i usermod -aG docker <username> usermod –aG docker devops
now you can run docker commands
Install Docker on Ubuntu 18.04/16.04 With Script:
if you want to install the docker with one simple script use below command.
curl -ssl https://get.docker.com | bash
you can find official documentation here https://docs.docker.com/install/linux/docker-ce/ubuntu/
- install docker linux
- docker install
- docker install Debian
- install docker ce Ubuntu
- install docker ubuntu 18