Categories
Tags
235 words
1 minutes
π³ How to Install Docker on Ubuntu
Ready to start containerizing your apps? Letβs get Docker up and running on Ubuntu in no time! Whether youβre spinning up microservices or just curious about containers, this guide has you covered β with a sprinkle of emojis to keep it fresh! π
π§° Prerequisites
Before we dive in, make sure you have:
- π§ An Ubuntu system (20.04 or newer recommended)
- π Sudo privileges
π Step 1: Update Your System
sudo apt update -y
Stay fresh, stay updated! π±
π¦ Step 2: Install Required Dependencies
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
π Step 3: Set Up the Docker Repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
π Step 4: Install Docker Engine
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
sudo systemctl start docker
sudo systemctl enable docker
sudo systemctl status docker
β Step 5: Verify the Installation
sudo docker --version
sudo docker run hello-world
π€ Optional: Run Docker as a Non-root User
To avoid typing sudo every time:
sudo usermod -aG docker $USER
exec bash
ConclusionThis is it! You now have Docker running on your Ubuntu system like a boss! Go ahead and: β’ π§ͺ Build your first container β’ π³ Pull images from Docker Hub β’ π Start developing microservices If you have any doubts/issues/errors with the above contents, feel free to contact me. Cheers, Happy Dockering! π’β¨.