Skip to content

Home Assistant

The container feature in RouterOS enables running Home Assistant directly on your MikroTik router, eliminating the need for a separate dedicated server. Home Assistant is a popular open-source platform for smart home automation, supporting hundreds of integrations with IoT devices, sensors, and services.

Home Assistant images are available for ARM32, ARM64, and AMD64 architectures. The recommended minimum requirements are 2 GB RAM and 32 GB storage. However, testing is possible on devices with 512+ MB RAM for basic operations.

Ensure the following before starting:

  • RouterOS device with Container package installed
  • External USB storage (minimum 32 GB recommended) for container data
  • At least 512 MB free RAM (2 GB recommended)
  • Network connectivity for pulling the Docker image

Enable container mode on your device:

Terminal window
/system/device-mode/update container=yes

Confirm by pressing the reset button (x86 devices require cold reboot).

Create a virtual Ethernet interface for the container:

Terminal window
/interface/veth/add name=veth2 address=172.19.0.2/24 gateway=172.19.0.1

Create a bridge for container networking:

Terminal window
/interface/bridge/add name=ha
/ip/address/add address=172.19.0.1/24 interface=ha
/interface/bridge/port/add bridge=ha interface=veth2

Forward TCP port 8123 for external access to Home Assistant:

Terminal window
/ip firewall nat add action=dstnat chain=dstnat dst-address=192.168.88.1 dst-port=8123 protocol=tcp to-addresses=172.19.0.2 to-ports=8123

Adjust dst-address to match your router’s LAN IP.

Create a mount for Home Assistant configuration files:

Terminal window
/container mounts add dst=/config name=ha_config src=/usb1/ha_config

Set the timezone environment variable:

Terminal window
/container/envs/add list=ha_env key=TZ value=America/Los_Angeles

Adjust the timezone value to match your location.

Configure the Docker registry and pull the Home Assistant image:

Terminal window
/container/config/set registry-url=https://registry-1.docker.io tmpdir=/usb1/pull
/container/add remote-image=homeassistant/home-assistant:latest interface=veth2 root-dir=/usb1/ha mounts=ha_config envlist=ha_env logging=yes

Monitor the extraction process:

Terminal window
/container/print

Wait until the status changes to status=stopped before proceeding.

Start the container once image extraction is complete:

Terminal window
/container/start 0

Verify container status:

Terminal window
/container/print

Access the Home Assistant web interface at http://<router-ip>:8123. The setup wizard guides you through creating an administrator account and configuring initial integrations.

Follow the Home Assistant onboarding guide for detailed instructions.

Home Assistant typically uses 300-500 MB of RAM at idle on ARM devices. Monitor resource usage:

Terminal window
/system resource print

Consider these resource requirements when running additional services alongside Home Assistant.