Created
March 2, 2025 16:21
-
-
Save skshahriarahmedraka/4aa39f3be441cbef2500b8a4c8c9e494 to your computer and use it in GitHub Desktop.
Install Docker on Linux/Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### **Install Docker on Linux/Ubuntu** | |
๐น **Step 1: Add Docker's official GPG key** | |
```bash | |
sudo apt-get update | |
sudo apt-get install -y 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 | |
``` | |
๐น **Step 2: Add the Docker repository to Apt sources** | |
```bash | |
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 | |
``` | |
๐น **Step 3: Install Docker** | |
```bash | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
``` | |
๐น **Step 4: Verify Installation** | |
```bash | |
sudo docker run hello-world | |
``` | |
Now, **Docker is installed** and ready to use! ๐ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment