Building a docker enviroment for smart house. I use a Raspberry Pi 4, but anything that runs docker-compose can be used.
- home-assistant
- timescaledb
- pgadmin4
- grafana
- mosquitto
To get the project up and running on a Raspberry Pi 4 follow these simple steps.
- Raspberry Pie OS
- SSH connection enabled
-
Make shure the package manager has the latest version.
sudo apt update && sudo apt upgrade && sudo apt autoremove && sudo apt autoclean
-
Docker provides a handy script for installing.
curl -sSL https://get.docker.com | sh
-
Docker by default only root users can run containers. To avoid having to use
sudo
with every docker command, add the current user to the docker group.sudo usermod -aG docker ${USER}
-
Installing docker-compose will can be done using pip3. To do that some packages needs to be installed.
sudo apt-get install libffi-dev libssl-dev sudo apt install python3-dev sudo apt-get install -y python3 python3-pip
After that pip3 can be used to install docker-compose.
sudo pip3 install docker-compose
-
This step is usefull when containers have a restart policy set to
always
orunless-stopped
. To make docker automatically start on boot run the following command.sudo systemctl enable docker