How to Check for Docker Installation

July 10, 2015 12.7k views
Docker Email Ubuntu

Does Ubuntu 14.04 have Docker already installed, how do I find out if I have it installed or not?

2 Answers

Ubuntu 14.04 does not come with Docker pre-installed by default. There is a Docker "one-click" image available on the "Applications" tab of the create page:

To check if it is installed, you can simply run the command. If you need to do this programmatically, you can check the exit code by running echo $?. If it's installed, you'll see:

$ docker -v
Docker version 1.7.0, build 0baf609
$ echo $?

If it's not installed, you'll see:

$ docker -v
The program 'docker' is currently not installed. You can install it by typing:
apt-get install docker
$ echo $?

The exit code 0 means that the command was successful, and the code 127 mean "command not found."

We already created a droplet on which we host our site. Can we still create and apply a Docker on this droplet? Basically we want to install PEPS on our system, but needed to install Docker first, any tip on easier way to install Docker on the system?

Have another answer? Share your knowledge.