Installation

For more details follow the official installation guide to install in Ubuntu. In essence

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get 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

# Add the repository to Apt sources:
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-get update

# Install docker packages:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Note

If you plan to use docker as github runner for CI/CD, provide privileges to the docker.sock files:

sudo chmod 666 /var/run/docker.sock

More details here.

Arch install

Link to the Arch Wiki. To install the docker engine:

sudo pacman -Sy docker

Then either the docker.service or the docker.socket system service must be enabled. The former loads docker at boot up (thus more load time could be required), while the latter loads on first usage:

sudo systemctl enable docker.socket
# Or alternatively
# sudo systemctl enable docker.socket

As discussed in the Arch wiki page and here, to run docker with sudo privileges it is recommended to add the own user to the docker group. You can check the existance of the group by calling

grep docker /etc/group

If the group exists, then add the user simply with the command

sudo usermod -aG docker $USER  # or set the <user_name>

or alternatively create the group:

sudo groupadd docker

After this operation, remember to restart the docker service:

sudo systemctl restart docker