Using the Linode Docker Machine Driver

Installing the tools and plugin

The Linode Docker Machine driver creates a Linode instance as the target environment for Docker container management.

Docker will need to be installed. Docker for Mac, Docker for Windows, Docker Toolbox, or Docker CE can be used.

If your Docker installation doesn't include the docker-machine command, you'll need to upgrade or install it from:

With docker-machine in place, install the docker-machine-driver-linode binary into your PATH from the binaries offered at:

Be sure to grab the appropriate binaries for your operating system. OSX and Linux builds are available.

Using the Linode Driver

With the binary in your path, the docker-machine command will handle Linode provisioning:

docker-machine create -d linode --help

The only arguments that are required for provisioning are the Linode APIv4 Token and a label. In practice, you will want to avoid the defaults and choose the Linode Instance type, base image, and region that best suits your needs.

Provisioning a Linode

You will need to provide a Personal Access Token for Linode APIv4 (referred to below as $LINODE_TOKEN).

$ docker-machine create -d linode --linode-token $LINODE_TOKEN  dockode
Running pre-create checks...
Creating machine...
(dockode) Creating Linode machine instance...
(dockode) Creating linode instance
(dockode) Waiting for Machine Running...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env dockode

Interacting with the Docker Machine

The metadata being managed can be viewed with: docker-machine inspect dockode

Take a look at docker-machine -h for more examples of what can be done through this management interface.

Now that we have a Linode running Docker-CE managed by docker-machine, we can target all of our docker commands to run in that environment.

eval $(docker-machine env dockode)

The eval command ran the output of the docker-machine env command, adding the following variables to the environment:

export DOCKER_HOST="tcp://"
export DOCKER_CERT_PATH="/Users/username/.docker/machine/machines/dockode"
export DOCKER_MACHINE_NAME="dockode"

With these variables in place, Docker will execute commands against Docker running from the Linode instance.

$ docker run -it alpine /bin/sh -c 'echo hello world'
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
6c40cc604d8e: Pull complete
Digest: sha256:b3dbf31b77fd99d9c08f780ce6f5282aba076d70a513a8be859d8d3a4d0c92b8
Status: Downloaded newer image for alpine:latest
hello world

See the official Docker Machine Getting Started guide for more information.

3 Replies

Thanks, Marques--this is awesome!

Hi Marques,

I followed your instructions and it built a new linode for the docker machine. How would I build a docker machine on an existing linode?



Hi Marques,

I tried to follow the download and make install the docker-machine-driver-linode on Ubuntu 20.04 server. But it is failed.

make install
go get -d ./
go: downloading v0.16.1
go: downloading v0.0.0-20190115181402-5dab4167f31c
go: downloading v0.9.0
go: downloading v1.11.0
go: downloading v0.0.0-20190103213133-ff983b9c42bc
go: downloading v1.13.1
go: downloading v1.4.0
go: downloading v0.0.0-20190108225652-1e06a53dbb7e
go: downloading v1.2.0
go: downloading v0.0.0-20190116161447-11f53e031339
go: finding module for package
go: finding module for package
go: finding module for package
go: downloading v0.0.0-20170929234023-d6e3b3328b78
go: downloading v1.7.0
go: found in v0.0.0-20170929234023-d6e3b3328b78
go: found in v0.0.0-20170929234023-d6e3b3328b78
go: found in v1.7.0
go: imports imports imports imports imports parsing go.mod:
module declares its path as:
but was required as:
make: *** [Makefile:20: dep] Error 1

I have also download the binary of the docker-machine-driver-linode for MacBook Air. How can I install the plugin binary into my MacBook Air?


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct