Project

General

Profile

Actions

Setup Docker in Ubuntu » History » Revision 4

« Previous | Revision 4/8 (diff) | Next »
Gareth Eaton, 08/03/2023 10:17 PM


Setup Docker in Ubuntu

Set up an Ununtu server - we will use 22.10

Update Package Index:

sudo apt update && apt upgrade

Install Prerequisites:

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

Add Docker Repository:

Your might have to install curl - apt install curl

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Add the Docker repository:

For x86_64/amd64 architecture:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
For arm64 architecture:

echo "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker:

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io

Start and Enable Docker:

sudo systemctl start docker
sudo systemctl enable docker

Verify Docker Installation:

sudo docker --version
sudo docker info

Run a Test Container:

sudo docker run hello-world

Updated by Gareth Eaton over 1 year ago · 4 revisions