Quick and Easy Docker Setup
As we know Docker is a great tool so we will look at a quick and easy docker setup instruction. Let’s not talk about it more about it as too many articles out there to explain so let’s set it up. This tutorial is tested to work on Ubuntu 16.04, Ubuntu 18.04 and Raspberry Pi 3 and 4 (2GB and 4GB).
First step lets update Ubuntu or Pi and install Docker with the commands below:
sudo apt update
curl -sSL https://get.docker.com | sh
Now let’s start Docker with the commands below and also make sure Docker starts back up after a system reboot.
sudo systemctl start docker
sudo systemctl enable docker
Next and final step is to add docker to the correct user group. Make sure to change <username>
with Ubuntu non root user or the same for Raspberry Pi. Once done let’s do a system reboot.
sudo usermod -aG docker <username>
sudo reboot now
That’s it Docker is installed and ready to go as promised quick and easy Docker setup. You can checkout some other projects with that can be setup with Docker here.
Now I would suggest to install Portainer along with Docker. It’s a very easy to use Docker management tool. This tool is an add on and not necessary for Docker to run.
Portainer: Quick Docker Manager
Portainer is a really great tool to manage Docker containers with a GUI, it runs as a web server so can be accessed through any device. It has a lot of pre build Docker setups that can be deployed with one click and there are a lot more community driven projects that can be added to have more one click deployment of different containers.
Its very easy to install Portainer and it also runs as a Docker container. Lets first make a Portainer data volume.
docker volume create portainer_data
Nest step we will pull the docker image and start Portainer with the command below. Once done Portainer UI can be accessed at http://<system-ip>:9000
docker run -d -p 9000:9000 --name=Portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
All done Good to go. Enjoy! 🙂