How to install Docker on Debian

Post Reply
User avatar
isscbta
Team Member
Posts: 132
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 16 times
Been thanked: 3 times

Docker is a popular containerization technology that simplifies the process of packaging, distributing, and running software applications in a portable and efficient manner. Containerization is the practice of bundling an application and its dependencies into a single package, which can be easily moved between different computing environments.

At its core, Docker provides a way to isolate an application and its dependencies into a lightweight, standalone container that can run on any system with Docker installed, regardless of the underlying hardware or software. This means that developers can build applications in a consistent and predictable environment, and deploy them with confidence that they will work as expected.

Follow those steps in order to install Docker on myVesta Hosting Panel:

In your SSH, as root, run:

Code: Select all

apt update
apt-get install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

curl -s https://api.github.com/repos/docker/compose/releases/latest   | grep browser_download_url   | grep docker-compose-linux-x86_64   | cut -d '"' -f 4   | wget -qi -
chmod +x docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
docker-compose version

useradd dev            # if you need to run docker as 'dev' user
usermod -aG docker dev # or any other username you want to be able to run docker commands
newgrp docker
systemctl restart docker
After you finish the installation, you will likely need to open some ports that Docker expects to be open but are not opened by default on myVesta Hosting Panel. You can do this through the myVesta Hosting Panel or via SSH: viewtopic.php?f=26&t=653
User avatar
myVesta
Site Admin
Posts: 938
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

Tutorial for old Deban 10:

Code: Select all

sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
# apt-cache policy docker-ce
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

curl -s https://api.github.com/repos/docker/compose/releases/latest   | grep browser_download_url   | grep docker-compose-linux-x86_64   | cut -d '"' -f 4   | wget -qi -
chmod +x docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
docker-compose version
rlkollman
Posts: 3
Joined: Sun Nov 01, 2020 3:24 pm

Do you have insight into what firewall rules may need to be applied for Docker itself (not each docker container - this is obviously different for each container)? Or any DNS Service configuration that needs to be implemented for docker? I see the reference to the other post as it relates to firewall rules, but nothing specifically about the Docker service.

I have had Docker running for some time and find the DNS requests from docker containers seems to fail after a few days. I'm guessing this is not necessarily related to the firewall, but to DNS service configuration. I've only dabbled in Docker stuff here and there, so I'm not extremely proficient in it. I have also installed `ipset` to block certain IPs and IP blocks that continue to attempt brute force logins. This also stops working after a few days as well, then I just re-run a couple commands to re-establish the iptables rules to block IPs added to ipset. Since both of these services seem to suffer from the same 'stop functioning after a few days' issue, I would tend to believe there's some relationship, but I'm not sure.

Thanks :)
Post Reply