A comprehensive, interactive shell script to install Docker on Debian-based Linux distributions with visual progress indicators and loading bars.
- Interactive Installation - Step-by-step progress with visual feedback
- Loading Bars & Spinners - Real-time progress indicators during installation
- Error Handling - Comprehensive error checking at each step
- Automatic OS Detection - Automatically detects your OS version codename
- Complete Setup - Installs Docker CE, CLI, Containerd, Buildx, and Compose
- Service Management - Automatically starts and enables Docker service
- Verification - Tests installation with hello-world container
Simply run this command in your terminal:
curl -fsSL https://raw.githubusercontent.com/USFAkbari/docker_Initiation/main/install_docker.sh | sudo bash# Download the script
curl -fsSL https://raw.githubusercontent.com/USFAkbari/docker_Initiation/main/install_docker.sh -o install_docker.sh
# Make it executable
chmod +x install_docker.sh
# Run with sudo
sudo ./install_docker.sh-
Clone this repository:
git clone https://github.com/USFAkbari/docker_Initiation.git cd docker_Initiation -
Make the script executable:
chmod +x install_docker.sh
-
Run the script with sudo:
sudo ./install_docker.sh
- Operating System: Debian-based Linux distribution (Debian, Ubuntu, etc.)
- Privileges: Root or sudo access
- Internet Connection: Required for downloading packages and Docker images
The script performs the following steps automatically:
- OS Detection - Detects your OS version codename
- Update Package List - Updates apt package list
- Install Prerequisites - Installs ca-certificates and curl
- Add Docker GPG Key - Downloads and installs Docker's official GPG key
- Add Docker Repository - Configures Docker's official apt repository
- Update Package List - Refreshes package list with Docker repository
- Install Docker - Installs Docker CE, CLI, Containerd, Buildx, and Compose
- Start Docker Service - Starts and enables Docker daemon
- Verify Installation - Checks Docker service status
- Test Installation - Runs hello-world container to verify everything works
During installation, you'll see:
- Progress Indicators - Step-by-step progress (Step X/10)
- Loading Spinners - For quick operations
- Progress Bars - For longer operations like package installation
- Color-Coded Messages - Green for success, yellow for warnings, red for errors
After successful installation, you can:
-
Check Docker version:
docker --version
-
Check Docker Compose version:
docker compose version
-
Run a test container:
docker run hello-world
-
View Docker system information:
docker info
If you get a "permission denied" error, make sure you're running the script with sudo:
sudo ./install_docker.shIf the installation fails due to network issues:
- Check your internet connection
- Verify you can access
download.docker.com - Check your firewall settings
If you encounter GPG key errors:
- The script will automatically retry
- Make sure your system time is correct
- Check if there are proxy settings interfering
If Docker service fails to start:
sudo systemctl status docker
sudo journalctl -u dockerTo remove Docker installed by this script:
sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
sudo rm -rf /etc/apt/keyrings/docker.asc
sudo rm -rf /etc/apt/sources.list.d/docker.sourcescurl | sh installation method, always verify the script source. Only run scripts from trusted repositories.
Contributions are welcome! Please feel free to submit a Pull Request.
This script is provided as-is for educational and practical purposes.
For issues or questions, please open an issue on the GitHub repository.
Made with ❤️ for the Docker community