blog

DigitalOcean Setup

Get a Ubuntu 22.04 server setup for git and docker compose

Image by 3D Animation Production Company from Pixabay

Basic Steps

Create Non-Root User and Adjust Permissions

See Initial Server Setup with Ubuntu 22.04

Setup User

adduser karl
usermod -aG sudo karl
ufw app list
ufw allow OpenSSH
ufw enable
ufw status

Test access

SSH Settings

rsync --archive --chown=karl:karl ~/.ssh /home/karl

Setup Docker and Docker Compose

See Install the Compose plugin

Setup Repository

See Install Docker Engine on Ubuntu

sudo apt install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update

Install Docker Engine

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world

Install Plugin

Should already be installed with Docker Engine above.

docker compose version