Digital Ocean and Docker Machine test environment (FREE SELF)

This guide is for quickly testing different versions of GitLab and not recommended for ease of future upgrades or keeping the data you create.

Initial setup

This guide configures a Digital Ocean droplet and sets up Docker locally on either macOS or Linux.

On macOS

Install Docker Desktop

On Linux

Install Docker Engine

Install Docker Machine

NOTE: The rest of the steps are identical for macOS and Linux.

Create new Docker host

  1. Login to Digital Ocean.

  2. Generate a new API token at

    This command creates a new Digital Ocean droplet called gitlab-test-env-do that acts as a Docker host.

    NOTE: 4GB is the minimum requirement for a Docker host that runs more than one GitLab instance.

    • RAM: 4GB
    • Name: gitlab-test-env-do
    • Driver: digitalocean
  3. Set the DO token:

    export DOTOKEN=<your generated token>
  4. 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

This example creates 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

  • HTTP port: 8888
  • SSH port: 2222
    • Set gitlab_shell_ssh_port using --env GITLAB_OMNIBUS_CONFIG
  • Hostname: IP of Docker host
  • Container name: gitlab-test-8.10
  • GitLab version: EE 8.10.8-ee.0

Set up container settings

export SSH_PORT=2222
export HTTP_PORT=8888
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):$HTTP_PORT'; gitlab_rails['gitlab_shell_ssh_port'] = $SSH_PORT;" \
--hostname $(docker-machine ip gitlab-test-env-do) \
--name $NAME \

Connect to the GitLab container

Retrieve the Docker host IP

docker-machine ip gitlab-test-env-do
# example output:

Browse to:

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