Heman Jone
hemanjone162@gmail.com
From Zero to Docker: Install on Debian 12 Today (106 อ่าน)
22 ก.ค. 2568 20:09
If you're just stepping into the world of DevOps or cloud-native development, learning how to install Docker on Debian is a crucial milestone. Docker is a widely used containerization platform that allows you to package and run applications in isolated environments called containers. When paired with the stability of Debian 12, it creates a powerful environment for development, testing, and deployment.
This post provides a clear, no-fuss breakdown of how to get Docker running on Debian 12, with steps sourced from the official Vultr installation guide. Whether you're a hobbyist or a professional, you’ll find this process simple and efficient.
Why Docker on Debian 12?
Debian 12 (Bookworm) is a reliable and lightweight operating system, making it ideal for containerized workloads. Combining Docker and Debian ensures high performance, security, and compatibility across different environments.
Prerequisites
Before beginning the installation, make sure:
You have a Debian 12 machine (either physical or virtual).
Your user account has sudo privileges.
Your system is connected to the internet.
Step-by-Step: How to Install Docker on Debian
1. Update the System
Start by updating the existing system packages:
sudo apt update && sudo apt upgrade -y
2. Install Required Dependencies
Install packages needed to allow apt to use repositories over HTTPS:
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
3. Add Docker’s Official GPG Key
This step adds Docker's GPG key for secure package verification:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4. Set Up the Stable Docker Repository
Add Docker's stable repository to your APT sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
https://download.docker.com/linux/debian $(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5. Install Docker Engine
Update the package list and install Docker:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
6. Start and Enable Docker
Make sure Docker starts automatically on boot:
sudo systemctl start docker
sudo systemctl enable docker
Verify Docker is running:
sudo systemctl status docker
7. (Optional) Use Docker Without sudo
To run Docker commands without typing sudo each time:
sudo usermod -aG docker $USER
newgrp docker
8. Test Docker Installation
Test your setup by running:
docker run hello-world
You should see a confirmation message if Docker is installed correctly.
Conclusion
That’s it—you’ve gone from zero to Docker on Debian 12! Following the Vultr guide, you now have a reliable container environment ready for any project. This setup is ideal for developers, sysadmins, or students looking to master containerized workflows. Ready to deploy your first app in Docker? You’re already halfway there.
152.58.119.3
Heman Jone
ผู้เยี่ยมชม
hemanjone162@gmail.com