A robust, automated script for installing Docker Engine and Docker Compose on Linux systems. Supports Debian, Ubuntu, Fedora, and RHEL/CentOS distributions.
- Automatic distribution detection
- Handles repository setup and GPG keys
- Removes conflicting packages
- Retries failed network operations
- Verifies installation success
- Comprehensive error handling
- Supports both Docker Engine and Docker Compose
- Ubuntu 20.04 or later
- Debian 10 or later
- Fedora 35 or later
- RHEL/CentOS 7 or later
- Root access or sudo privileges
- Bash shell
- curl
- Basic system utilities (already present on supported distributions)
- Download the script:
curl -O https://raw.githubusercontent.com/segunjkf/docker-install/main/docker-install.sh- Make it executable:
chmod +x install-docker.sh- Run the script:
sudo ./install-docker.sh- Checks system requirements
- Removes conflicting packages
- Sets up Docker repositories
- Installs Docker Engine and Docker Compose
- Configures Docker service
- Adds user to docker group (if not root)
- Verifies installation
- Automatically retries failed network operations
- Creates backups of modified system files
- Provides detailed error messages
- Cleans up on failure