This script automates the installation of Docker and Docker Compose on an Ubuntu system. It ensures a hassle-free setup by following the best practices for installing Docker from its official repository.
- Installs the latest Docker Engine & Docker Compose
- Configures Docker to start on boot
- Adds your user to the Docker group (optional)
- Ensures a secure installation using official GPG keys
- Fully automated script with minimal user intervention
git clone https://github.com/Lalatenduswain/install-docker.git
cd install-docker
chmod +x install_docker.sh
./install_docker.sh
- The script will automatically install Docker & Docker Compose
- Log out and log back in to apply group membership changes
Updates the system's package list to ensure the latest versions of software are installed.
Installs essential packages:
ca-certificates
curl
gnupg
Adds Docker’s GPG key and repository to ensure a trusted installation.
Installs the latest versions of:
docker-ce
(Docker Community Edition)docker-ce-cli
(Docker Command Line Interface)containerd.io
docker-buildx-plugin
docker-compose-plugin
Starts Docker immediately and enables it to launch on boot.
Checks that Docker and Docker Compose are installed correctly by displaying their versions.
Allows running Docker without sudo
by adding your user to the docker group.
- Compatible OS: This script is designed for Ubuntu-based systems only.
- Use at Your Own Risk: Always review the script before running it.
- Backup Recommended: Before making system-wide changes, ensure you have backups.
If you found this useful, you can support me by buying me a coffee ☕
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as needed.
🐦 Twitter: @lalatendu_swain 💼 LinkedIn: Lalatendu Swain
🚀 Enjoy Dockerizing your applications!