Skip to content

Instantly share code, notes, and snippets.

@nhridoy
Last active December 12, 2025 14:39
Show Gist options
  • Select an option

  • Save nhridoy/df3f005b79e6a9cf11c50bd3bf9711c2 to your computer and use it in GitHub Desktop.

Select an option

Save nhridoy/df3f005b79e6a9cf11c50bd3bf9711c2 to your computer and use it in GitHub Desktop.
#!/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
@nhridoy
Copy link
Author

nhridoy commented Dec 12, 2025

Run using

curl -sSL https://gist.githubusercontent.com/nhridoy/df3f005b79e6a9cf11c50bd3bf9711c2/raw/644a59fe5b44ba9ec3abd488bd5980976f62c7bc/docker_install.sh | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment