Tutorial: Setting up Local Databases with Ease using Kitematic from Docker Toolbox

Using Kitematic for your local development databases

In an earlier post, we showed you how to set up MongoDB Image Instance with Docker Toolbox using Docker command line tools.

Since Docker released Kitematic as part of Docker Toolbox a few months ago, working with Docker on your local machine has never been easier. Below is a quick walkthrough of one of the most common ways I've been using the new Kitematic GUI: installing databases for local development (in this case MongoDB and Redis).

Why use Kitematic?

The great thing about using Docker for local development is that it allows you to install any version of your system-level dependencies or services (referred to as containers) without polluting your host Operating System. This is especially handy if you have different projects that require you to have different versions of the dependency. i.e. a different version of MongoDB, Redis, or even WordPress can be installed via Kitematic (and even be running at the same time).

If you’ve used Vagrant before, you’re already familiar with these benefits. Kitematic works much the same way: it creates a Virtual Machine inside of VirtualBox, running the lightweight boot2docker OS. The extra upside that Kitematic gives you is how easy it is fire up a new container. With just one click it will docker pull the image you want, docker run the container instance, and map all of the exposed ports from the automatically generated VirtualBox VM through to your host machine.

Getting Started

Download Docker Toolbox

You can find it here: https://www.docker.com/docker-toolbox

Open Kitematic

If you have an account at Docker Hub you can log in here to view your hosted docker repositories, otherwise go ahead and "SKIP FOR NOW"

Select the Docker images you want to use

In my case I needed a MongoDB and Redis instance.

Find the connection details

This is the host and port you will use to connect to the database from your application running on localhost.

Change Port

If you need to change the port, you can do so here:

And you're done!

I'm a big fan of how easy the Docker team has made it to fire up new database instances (and other software services). I'm sure you will be to!


About Author: Ian Grail
Ian Grail

Software Developer. Aspiring Pool Lounger.