sudo: docker-machine: command not found

Solution 1:

You need to install Docker Machine first on your local machine. If you use Ubuntu, just use this snippet (Update the version from the Official Repository Releases if needed) :

$ curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
chmod +x /tmp/docker-machine &&
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

Solution 2:

The accepted answer contains outdated install instructions!

Up to date instructions for Docker Machine can be found in the official documentation here. This includes instructions for MacOS, Linux (including Ubuntu) & Windows with Git BASH. Full documentation can be found here.

While @sdey0081's answer is more or less correct, running the posted commands will result in an outdated version of Docker Machine being installed. The version it installs is v0.13.0 while the current release at the time of writing is v0.15.0. You can find the available releases in the GitHub repo here.

Solution 3:

On MacOS installing with brew is the simplest solution: brew install docker-machine

Solution 4:

Just additional information with steps to the main answer:

1) To install docker-machine you need to write this as mantioned @coturiv:

$ curl -L https://github.com/docker/machine/releases/download/v0.16.1/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
    chmod +x /tmp/docker-machine &&
    sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

2) If you get the error after running the command docker-machine create:

Error creating machine: Error with pre-create check: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path

be sure that you also installed virtualbox:

sudo apt-get install virtualbox

3) If you get again the error like:

This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory 

try to run the command docker-machine create using --virtualbox-no-vtx-check like:

docker-machine create default --virtualbox-no-vtx-check