This repository contains a Makefile to manage the Home Assistant Docker container on a Raspberry Pi 4.
The Makefile includes the following commands:
make build
: Builds the Docker image.make run
: Runs a new Docker container from the image.make start
: Starts the existing Docker container.make stop
: Stops the running Docker container.make remove
: Removes the Docker container.make webinterface
: Outputs the URL for accessing the Home Assistant web interface.
-
Open a terminal and navigate to the directory containing the Makefile.
-
If this is your first time running Home Assistant, build the Docker image:
make build
- Start the Home Assistant Docker container:
make run
The output will include the URL for accessing the Home Assistant web interface. It will look something like this: http://192.168.1.10:8001
.
- If you need to stop the Home Assistant Docker container for any reason, use the following command:
make stop
- To start the container again, use the following command:
make start
This command will also output the URL for accessing the Home Assistant web interface.
- If you need to remove the Docker container, use the following command:
make remove
Note: This command will delete all data stored in the container.
- To display the URL for the Home Assistant web interface, use the following command:
make webinterface
You can customize the Docker image name, the Docker container name, the IP address of your Raspberry Pi, and the port mapped on your Raspberry Pi by editing the following variables at the top of the Makefile:
IMAGE_NAME
: The name of the Docker image. Default ishomeassistant
.CONTAINER_NAME
: The name of the Docker container. Default ishome-assistant
.PI_IP
: The IP address of your Raspberry Pi. Default is the output of thehostname -I | cut -d' ' -f1
command, which should be the IP address of your Raspberry Pi.PORT
: The port mapped on your Raspberry Pi. Default is8001
.