Setup Docker in Ubuntu » History » Revision 7
Revision 6 (Gareth Eaton, 08/03/2023 10:19 PM) → Revision 7/8 (Gareth Eaton, 08/03/2023 10:22 PM)
h1. Setup Docker in Ubuntu
Set up an Ununtu server - we will use 22.10
Update Package Index:
<pre>
sudo apt update && apt upgrade
</pre>
Install Prerequisites:
<pre>
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
</pre>
Add Docker Repository:
Your might have to install curl - apt install curl
<pre>
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
</pre>
Add the Docker repository:
For x86_64/amd64 architecture:
<pre>
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
</pre>
For arm64 architecture:
<pre>
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
</pre>
Install Docker:
<pre>
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
</pre>
Start and Enable Docker:
<pre>
sudo systemctl start docker
</pre>
Run the following command to enable the Docker service to start on boot:
<pre>
sudo systemctl enable docker
</pre>
Verify Docker Installation:
<pre>
sudo docker --version
sudo docker info
</pre>
Run a Test Container:
<pre>
sudo docker run hello-world
</pre>