The instructions vary slightly depending on the distribution of Linux you’re using. Below are the general steps for a few major versions.
Ubuntu:
1. Update your existing list of packages.
```
sudo apt-get update
```
1. Install a few prerequisite packages.
```
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
```
1. Add the GPG key for the official Docker repository.
```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```
1. Add the Docker repository to apt sources.
```
sudo add-apt-repository \
“deb \
$(lsb_release -cs) \
stable“
```
1. Update the package database with Docker packages.
```
sudo apt-get update
```
1. Install Docker.
```
sudo apt-get install docker-ce
```
1. Verify that Docker is installed correctly.
```
sudo systemctl status docker
```
Centos:
1. Update the package database.
```
sudo yum check-update
```
1. Install the Docker-ce package.
```
sudo yum install docker-ce
```
1. Start Docker.
```
sudo systemctl start docker
```
1. Verify Docker was installed correctly.
```
sudo systemctl status docker
```
1. Enable Docker to start on boot.
```
sudo systemctl enable docker
```
Debian:
1. Update the package list for upgrades for security, and to install Docker.
```
sudo apt update
```
1. Install Docker.
```
sudo apt install docker-ce
```
1. Verify that Docker was installed correctly.
```
sudo systemctl status docker
```
These instructions will install the latest community edition of Docker. For enterprise edition, proprietary software from Docker, refer Docker documentation to get the install instruction.