admin/ July 18, 2017/ Docker/ 1 comments

Docker-machine create machine on Cloud (DigitalOcean)

Docker-machine allows you to manage the docker machines (VMs) using your local system weather VMs on AWS, Digitalocean, etc.

Here, I am going to tell you how to create the docker machine on digitalocean.

Step1-: Install the docker-machine in your local system using below command.

$ curl -L`uname -s`-`uname -m` >/tmp/docker-machine &&
chmod +x /tmp/docker-machine &&
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

Step 2-: Generate the digitalocean api token to access the digitalocean account using the docker-machine.

a) Login the

b) Click on the “API” tab on the menu bar

c) Click on the “Generate New Token” button on the right.

Step 3-: Use the below command to create the docker-machine.

docker-machine create --driver digitalocean --digitalocean-access-token "digitalocean token" docker-sandbox

Note-: Paste the digitalocean token where the double quote without double quote and make sure the you have enabled the Port 2376 on your localsystem or Server.


Creating CA: /root/.docker/machine/certs/ca.pem
Creating client certificate: /root/.docker/machine/certs/cert.pem
Running pre-create checks...
Creating machine...
(docker-sandbox) Creating SSH key...
(docker-sandbox) Creating Digital Ocean droplet...
(docker-sandbox) Waiting for IP address to be assigned to the Droplet...
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...

Step 4-: Setup the docker environment using below command-:

$ docker-machine env docker-sandbox
$ eval $(docker-machine env docker-sandbox)

Now you have successfully created the docker-machine on the digitalocean cloud.

To check the docker machine. use docker-machine ls command.

$ docker-machine ls


NAME             ACTIVE   DRIVER         STATE     URL                         SWARM   DOCKER        ERRORS
docker-sandbox   *        digitalocean   Running   tcp://           v17.06.0-ce

To connect the docker machine using docker-machine command.

$ docker-machine ssh docker-sandbox

Use the docker-machine name in place of docker-sandbox

Share this Post

1 Comment

  1. Very helpful article for those who want to know more about Amazon Digital Ocean Cloud. I want to notify you about our firm that is Support Wala offer you this service at a cheaper rate. Feel free to call us.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.