Docker has become an essential tool for developers and system administrators to build, ship, and run applications in isolated environments. Whether you're on Debian or Ubuntu, setting up Docker can be done quickly using a simple script.
One-Command Setup
I’ve created a handy installation script that automates the entire process. Just run the following commands in your terminal:
wget -O install_docker.sh https://gist.githubusercontent.com/maheshpalamuttath/f454a85ca8704d75de5c7fb2eb803f61/raw/dc189737afdeead3e595a35dc66c778c8713fd63/install_docker.sh
sudo chmod +x install_docker.sh
sudo ./install_docker.sh
What the Script Does
- Updates your package index and installs required dependencies.
- Creates a secure directory to store Docker’s GPG key.
- Detects your OS version (Debian or Ubuntu).
- Adds Docker's GPG key to verify authenticity.
- Configures Docker’s official repository in your package sources.
- Installs Docker packages (docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin)
- Adds the current user to the Docker group.
- Verifies Docker installation.
- Prompts to log out and log back in to apply changes.
Once the script finishes, you’ll have Docker installed and ready to use.
Final Step: Verify Docker Installation
Run the following command to confirm Docker is installed:
docker --version
You should see the installed Docker version printed on your screen.