DO - Testing Environment

On this page

Initial setup

This guide involves configuring a Digital Ocean droplet and setting up Docker locally, it assumes you're using Mac OS X.

Install Docker Toolbox


Create new docker host

  1. Login to Digital Ocean
  2. Generate a new API token at

This command will create a new DO droplet called gitlab-test-evn-do that will act as a docker host.

Note: 4GB is the minimum requirement for a Docker host that will run more then one GitLab instance

Set the DO token - Replace the string below with your generated token

export DOTOKEN=cf3dfd0662933203005c4a73396214b7879d70aabc6352573fe178d340a80248

Create the machine

docker-machine create \
  --driver digitalocean \
  --digitalocean-access-token=$DOTOKEN \
  --digitalocean-size "4gb" \

Creating GitLab test instance

Connect your shell to the new machine

In this example we'll create a GitLab EE 8.10.8 instance.

First connect the docker client to the docker host you created previously.

eval "$(docker-machine env gitlab-test-env-do)"

You can add this to your ~/.bash_profile file to ensure the docker client uses the gitlab-test-env-do docker host

Create new GitLab container

Setup container settings
export SSH_PORT=2222
export HTTP_PORT=8080
export VERSION=8.10.8-ee.0
export NAME=gitlab-test-8.10
Create container
docker run --detach \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://$(docker-machine ip gitlab-test-env-do):$SSH_PORT'; gitlab_rails['gitlab_shell_ssh_port'] = $SSH_PORT;" \
--hostname $(docker-machine ip gitlab-test-env-do) \
-p $HTTP_PORT:80 -p $SSH_PORT:22 \
--name $NAME \

Connect to the GitLab container

Retrieve the docker host IP
docker-machine ip gitlab-test-env-do
# example output:
Execute interactive shell/edit configuration
docker exec -it $NAME /bin/bash
# example commands
root@192:/# vi /etc/gitlab/gitlab.rb
root@192:/# gitlab-ctl reconfigure