To install the latest Docker version on a Linux machine, perform the following steps:
- Update your apt packages index by using the following command:
$ sudo apt-get update
- After updating apt package, let's start the docker-engine installation by using the following command:
$ sudo apt-get install docker-engine
- The preceding command will install Docker on your Linux machine. Now let's start the Docker daemon by using the following command:
$ sudo service docker start
- You can test Docker on your machine by using the following command:
$ sudo docker run hello-world
The preceding command verifies that Docker is installed correctly by running the hello-world image; this command downloads a test image and runs it in a container. The following output will be displayed after executing the preceding command: