-
Go to root folder with root priviliges
-
Update and upgrade
$ sudo apt-get update && sudo apt-get upgrade
- Uninstall Old Docker version
$ sudo apt-get remove docker docker-engine docker.io
- Install Docker
$ sudo apt install docker.io
- Start and configure docker
$ sudo systemctl start docker
$ sudo systemctl enable docker
- Check docker version to verify installation
$ docker --version
- Run Hello World container to verify successfull installation of client, daemon etc.
$ docker run hello-world
Note: Run Ubuntu bash using:
$ docker run -it ubuntu bash
- Ensure the downloads are valid, add the GPG key for the official Docker repository to your system:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- Add the Docker repository to APT sources:
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- Update the package database with the Docker packages from the newly added repo:
$ sudo apt-get update
- Make sure you are about to install from the Docker repo instead of the default Ubuntu 18.04 repo:
$ apt-cache policy docker-ce
- Install Docker engine:
$ sudo apt-get install -y docker-ce
- Verify Docker Installtion
$ sudosystemctl status docker