A universal, automated Docker installation script that detects your Linux distribution and installs the latest Docker Engine with proper configuration and logging.
Deploy this script effortlessly on your MyHBD.net server with just a single click!
✅ High-performance VPS solutions
✅ Multiple data centers across Europe & Asia
✅ Reliable and optimized for seamless deployment
Start now and streamline your server setup with ease!
- Multi-platform support: Works across major Linux distributions
- Automated detection: Automatically identifies your OS and version
- Comprehensive logging: Detailed installation logs with timestamps
- Error handling: Robust error checking and validation
- Post-installation setup: Configures Docker service and user permissions
- Installation verification: Tests Docker installation with hello-world container
- Production-ready: Follows Docker's official installation guidelines
| Distribution | Versions | Package Manager |
|---|---|---|
| Ubuntu | 18.04, 20.04, 22.04, 24.04+ | APT |
| Debian | 10, 11, 12+ | APT |
| Raspbian | Buster, Bullseye+ | APT |
| CentOS | 7, 8, 9+ | YUM |
| RHEL | 7, 8, 9+ | YUM |
| Fedora | 35, 36, 37+ | DNF |
| Rocky Linux | 8, 9+ | YUM |
| AlmaLinux | 8, 9+ | YUM |
| Amazon Linux | 2, 2023+ | YUM |
| SUSE/openSUSE | 15+ | Zypper |
| Arch Linux | Rolling | Pacman |
- Linux-based operating system (see supported distributions above)
- Root privileges (sudo access)
- Active internet connection
- curl (installed automatically if missing)
# Download and run the script
curl -fsSL https://raw.githubusercontent.com/itsredbull/universal-docker-installer/main/install_docker.sh -o install_docker.sh
chmod +x install_docker.sh
sudo ./install_docker.sh-
Download the script:
wget https://raw.githubusercontent.com/itsredbull/universal-docker-installer/main/install_docker.sh
-
Make it executable:
chmod +x install_docker.sh
-
Run with sudo:
sudo ./install_docker.sh
# Basic usage
sudo ./install_docker.sh
# The script will:
# 1. Detect your Linux distribution
# 2. Install required prerequisites
# 3. Add Docker's official repository
# 4. Install the latest Docker Engine
# 5. Start and enable Docker service
# 6. Add current user to docker group
# 7. Test installation with hello-world container
# 8. Generate detailed logsAll installation activities are logged to /dockerinstalllog.text with timestamps:
# View installation log
cat /dockerinstalllog.text
# Monitor installation in real-time
tail -f /dockerinstalllog.textAfter successful installation:
- Log out and back in to apply docker group membership
- Verify installation:
docker --version docker info
- Test with a container:
docker run hello-world
- Docker Engine (latest stable version)
- Docker CLI (command-line interface)
- containerd (container runtime)
- Docker Buildx (extended build capabilities)
- Docker Compose (multi-container applications)
Permission denied when running docker commands:
# Log out and back in, or run:
newgrp dockerScript must be run as root:
# Always run with sudo
sudo ./install_docker.shUnsupported OS error:
# Check if your distribution is supported
cat /etc/os-release- Check the installation log:
/dockerinstalllog.text - Review Docker's official documentation
- Open an issue on GitHub
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Add support for additional Linux distributions
- Implement
--helpand--versionflags - Add
--dry-runoption for testing - Create automated tests
- Improve error handling
This project is licensed under the MIT License - see the LICENSE file for details.
If this script helped you, please consider:
- Giving it a ⭐ star on GitHub
- Sharing it with others
- Contributing improvements
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ for the DevOps community