Installing Docker and Docker Compose on Debian 12
Before installing Docker, ensure your Debian system is up-to-date with the following command:
sudo apt update && sudo apt upgrade -yShell
Once your system is updated, install the necessary packages to allow apt to use a repository over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2 -yShell
Next, add the official GPG key of Docker:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -Shell
Add the Docker repository to APT sources:
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.listShell
Update your package index and install Docker CE (Community Edition):
sudo apt update && sudo apt install docker-ce -yShell
To ensure Docker starts on boot, use the following command:
sudo systemctl enable dockerShell
Verify the Docker installation by running the hello-world image:
sudo docker run hello-worldShell
Installing Docker Compose on Debian 12
Docker Compose is a tool for defining and running multi-container Docker applications. To install Docker Compose, first, download the latest version from the official GitHub repository:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composeShell
Next, set the appropriate permissions to make the binary executable:
sudo chmod +x /usr/local/bin/docker-composeShell
Verify the installation by checking the version of Docker Compose:
docker-compose --versionShell
At this point, Docker and Docker Compose are installed and ready for use on your Debian 12 system.
No comments to display
No comments to display