| Work | Research and Development (R&D) | Engineering | Infrastructure | How to install Docker on Digital Ocean
How to install Docker on Digital Ocean

This guide will walk you through how to install Docker on Digital Ocean.

Provision Server

Visit Digital Ocean and click "Create Droplet".

Here are the options I chose when creating a droplet.
- Select Ubuntu 20.04.
- Choose a plan. I selected Basic, Shared CPU, 1 vCPUs, 2 GB Memory, 50 GB SSD, 2 TB transfer, $10/mo to start but may increase its size if I run into performance issues.
- Add block storage. I skipped this as I didn't need this.
- Choose a datacenter region. I chose Toronto 1 as I'm based in Canada.
- Select additional options. I chose IPv6 and Monitoring.
- Authentication. I chose SSH keys.
- How many Droplets? 1.
- Choose a hostname. I used the following naming scheme "sitename-gitlab-runner1-prd".
- Add tags. None.
- Select Project. None.
- Add backups. I selected Yes for $2/mo.
- Press "Create Droplet"

Install Packages

Update your packages

sudo apt update

Install pre-requisite packages for using apt over HTTPS

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Install docker

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce

Check that the service (daemon) is started

sudo systemctl status docker

Conclusion

That's it! Docker is now available on this machine. You can now run dockerized applications such as running a Dockerized GitLab runner.