Install Docker
The connection is set up, it’s time to install Docker. Fortunately, Docker provides a handy install script for that.
curl -sSL https://get.docker.com | sh
After the script has finished, add the permissions to the current user to run Docker commands.
sudo usermod -aG docker ${USER}
Reboot the Raspberry Pi to let the changes take effect.
3. Install Docker-Compose
Docker-Compose usually gets installed using pip3. For that, we need to have python3 and pip3 installed. If you don’t have it installed, you can run the following commands.
sudo apt-get install libffi-dev libssl-dev
sudo apt install python3-dev
sudo apt-get install -y python3 python3-pip
Once python3 and pip3 are installed, we can install Docker-Compose using the following command.
sudo pip3 install docker-compose
4. Enable the Docker system service to start your containers on boot
This is a very nice and important addition. With the following command you can configure your Raspberry Pi to automatically run the Docker system service, whenever it boots up.
sudo systemctl enable docker