3.2 KiB
id | title | sidebar_label |
---|---|---|
debian-docker-installieren | Installing Docker | Install Docker |
Introduction
In this tutorial, you will learn how to install Docker on a VPS or Dedicated Server. The guide includes both a distribution-independent method and a specific one for Debian 10, 11, and 12. Root privileges are required.
First, log in as the root user using an SSH client of your choice, such as PuTTY or Terminus.
Installation
1. Install Docker (General Method)
Docker can be installed independently of the operating system using the following one-liner:
curl -sSL https://get.docker.com/ | CHANNEL=stable bash
This method automatically configures the repository and installs the latest stable version of Docker. It is suitable for various Linux distributions.
If you prefer manual installation for Debian, follow the steps below:
2. Update the System (Debian-specific)
Run the following commands to update your system to the latest version:
apt update && apt upgrade -y
3. Install Required Packages
Install the necessary packages for Docker installation:
apt install -y apt-transport-https ca-certificates curl gnupg
4. Add Docker's Official GPG Key
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
5. Add the Docker Repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
6. Install Docker
apt update
apt install -y docker-ce docker-ce-cli containerd.io
7. Verify Installation
Start a test container to check if Docker was installed successfully:
docker run hello-world
If the message Hello from Docker!
appears, the installation was successful.
Optional: Install Docker-Compose
Docker-Compose is integrated as docker compose
starting from Docker Version 20.10. If you are using an older version or need the standalone docker-compose
binary, follow these steps.
1. Download Docker-Compose
Replace 2.22.0
with the latest available version of Docker-Compose:
VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep "tag_name" | cut -d '"' -f 4)
curl -L "https://github.com/docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2. Set Permissions
chmod +x /usr/local/bin/docker-compose
3. If the Command is Not Found, Create a Symlink
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
4. Verify Installation
docker-compose --version
If the version number appears, the installation was successful.
Conclusion
Docker is now installed and ready to use. If you work with Docker-Compose, you have also successfully set it up. Use Docker for containerization and efficient deployment of your applications.
Rent a Suitable Server
If you do not yet have a suitable server, you can rent one via the following link: Rent a Root Server at DeinServerHost