Last active
December 12, 2025 14:39
-
-
Save nhridoy/df3f005b79e6a9cf11c50bd3bf9711c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Update and upgrade | |
| sudo apt update && sudo apt upgrade -y | |
| # Install prerequisites | |
| sudo apt install apt-transport-https ca-certificates curl software-properties-common -y | |
| # Add Docker's official GPG key | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| # Add Docker repository | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" | |
| # Check available Docker versions | |
| apt-cache policy docker-ce | |
| # Install Docker | |
| sudo apt install docker-ce -y | |
| # Check Docker status | |
| # sudo systemctl status docker | |
| # Add current user to Docker group | |
| sudo usermod -aG docker ${USER} | |
| # Switch to the current user to apply group changes | |
| su - ${USER} << EOF | |
| # Display groups | |
| groups | |
| EOF | |
| # Reboot the system | |
| sudo reboot |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run using
curl -sSL https://gist.githubusercontent.com/nhridoy/df3f005b79e6a9cf11c50bd3bf9711c2/raw/644a59fe5b44ba9ec3abd488bd5980976f62c7bc/docker_install.sh | sh