Over a million developers have joined DZone.

Docker.io and Redis on DigitalOcean in Five Minutes

DZone's Guide to

Docker.io and Redis on DigitalOcean in Five Minutes

· DevOps Zone ·
Free Resource

Discover a centralized approach to monitor your virtual infrastructure, on-premise IT environment, and cloud infrastructure – all on a single platform.

It all started when I casually spotted a sponsored tweet offering me $10 worth of virtual computing power from DigitalOcean. I had seen their ads on everything from Facebook to Gmail and thought I’d check out what the fuss was about.

I had been planning to try Docker.io on something other than my MacBook for a while and was tempted to run up another Linode server. Instead, I decided to see if I could get Docker running on DigitalOcean.

Docker turned 0.6 over the weekend and is heading full speed toward a production-grade container platform. If you are reading this post you are probably already interested in Docker, but for the uninitiated, Docker allows you to ship applications as containers running in what appears to be self-contained Linux environments. It's is based on Linux container magic and runs within the same operating system as its host.

So here is my guide to get Docker 0.6.1 running on the DigitalOcean VM. Five minutes starts now!

First, create a new droplet based upon the Ubuntu 13.04 x64 image

ImageCreate the droplet and within a minute or so you should be able to interact with your new machine. Your root password is emailed to the registered email address

Once it is created, SSH directly on to the box as root. For me it was as simple as:

 ssh root@

Now, following Docker’s install guide, I ran:

apt-get update
apt-get install linux-image-extra-`uname -r`

sh -c "curl http://get.docker.io/gpg | apt-key add -"

sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

apt-get update
apt-get install lxc-docker

Which allowed me to run Docker for the first time.

root@blog:~# docker version
Client version: 0.6.1
Server version: 0.6.1
Git commit: 5105263
Go version: go1.1.2
Last stable version: 0.6.1

Now, to run something exciting, let's run Redis.

docker run -d johncosta/redis 

Install redis-cli on the host machine.

apt-get install redis-server

redis-cli -h -p 6379

Or connect from your MacBook.

brew install redis

redis-cli -h -p 6379

Now, it's time to play with Redis.

redis localhost:6379> set docker magic
redis localhost:6379> get docker

Five minutes must be up by now!

Learn how to auto-discover your containers and monitor their performance, capture Docker host and container metrics to allocate host resources, and provision containers.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}