{"id":831,"date":"2025-06-02T20:20:45","date_gmt":"2025-06-02T18:20:45","guid":{"rendered":"https:\/\/www.yelloworb.com\/orbblog\/?p=831"},"modified":"2025-06-14T10:38:29","modified_gmt":"2025-06-14T08:38:29","slug":"running-temporary-home-assistant-on-my-laptop","status":"publish","type":"post","link":"https:\/\/www.yelloworb.com\/orbblog\/running-temporary-home-assistant-on-my-laptop\/","title":{"rendered":"Running temporary Home-Assistant on my laptop"},"content":{"rendered":"\n<p>Wanted to experiment a bit with Home-Assistant while travelling. And wanted to be able to run as much as possibly locally on the laptop instead of connecting to my home setup since network connectivity is not always reliable.<br \/><br \/>So here is a short summary how I set it up.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Docker Desktop<\/h2>\n\n\n\n<p>I already had <a href=\"https:\/\/www.docker.com\/products\/docker-desktop\/\">Docker Desktop<\/a> setup with a free <a href=\"https:\/\/www.docker.com\/products\/personal\/\">Docker Personal <\/a>account. If you do not have it setup already, download and install it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">HomeAssistant and MQTT<\/h2>\n\n\n\n<p>I found these two articles; <a href=\"https:\/\/fiddle-ranunculus-9bcx.squarespace.com\/blog\/home-assistant-tips\/installing-docker-home-assistant-and-portainer-on-ubuntu-linux\">Installing Docker, Home Assistant and Portainer on Ubuntu Linux<\/a> and <a href=\"https:\/\/www.homeautomationguy.io\/blog\/docker-tips\/configuring-the-mosquitto-mqtt-docker-container-for-use-with-home-assistant\">Configuring the Mosquitto MQTT Docker container for use with Home Assistant<\/a> but they are dedicated to run Docker on Linux and since my laptop is a Mac I had to do some modifications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Home Assistant<\/h3>\n\n\n\n<p>Create a folder on your laptop. I called mine home-assistant and then a number of subfolders in it:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">mkdir home-assistant\ncd home-assistant\nmkdir homeassistant\nmkdir homeassistant\/config<\/code><\/pre>\n\n\n\n<p>Then run <code class=\"\" data-line=\"\">code docker-compose.yml<\/code> and add<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-yaml\" data-line=\"\">version: &#039;3.0&#039;\nservices:\n  homeassistant:\n    container_name: homeassistant\n    image: &quot;ghcr.io\/home-assistant\/home-assistant:stable&quot;\n    volumes:\n      - .\/homeassistant\/config:\/config\n      - \/etc\/localtime:\/etc\/localtime:ro\n      - \/run\/dbus:\/run\/dbus:ro\n    restart: unless-stopped\n    privileged: true\n    ports:\n      - 8123:8123<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Mosquitto<\/h3>\n\n\n\n<p>Optionally if you want to run Mosquitto for MQTT<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">mkdir mosquitto\nmkdir mosquitto\/data \u00a0\nmkdir mosquitto\/logmkdir mosquitto\/config<\/code><\/pre>\n\n\n\n<p>Then run <code class=\"\" data-line=\"\">code mosquitto\/config\/mosquitto.conf<\/code> and add<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">persistence true\npersistence_location \/mosquitto\/data\/\nlog_dest file \/mosquitto\/log\/mosquitto.log\nlistener 1883\n\n## Authentication ##\nallow_anonymous true<\/code><\/pre>\n\n\n\n<p>And add to docker-compose.yml<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-yaml\" data-line=\"\">  mosquitto:\n    image: eclipse-mosquitto\n    container_name: mosquitto\n    volumes:\n      - .\/mosquitto:\/mosquitto\n      - .\/mosquitto\/data:\/mosquitto\/data\n      - .\/mosquitto\/log:\/mosquitto\/log\n    ports:\n      - 1883:1883\n      - 9001:9001    <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Start container\/s<\/h3>\n\n\n\n<p>Then start the the container or containers with docker compose like<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">docker-compose up -d<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure login to mosquitto<\/h2>\n\n\n\n<p>You now have both Home Assistant and Mosquitto running but before connecting the two you want to setup authentication in Mosquitto. This is just a simple setup with only one account.<\/p>\n\n\n\n<p>In Docker Desktop, view your containers by clicking Containers in the left menu. Find the mosquitto one and click on its name. Then select the Exec tab and execute the following command<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">mosquitto_passwd -c \/mosquitto\/config\/password_file hass<\/code><\/pre>\n\n\n\n<p>Enter the password you want twice. <\/p>\n\n\n\n<p>Then edit the \/mosquitto\/config\/mosquitto.config in VSCode and change the following section<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">## Authentication ##\nallow_anonymous true<\/code><\/pre>\n\n\n\n<p>to<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">## Authentication ##\nallow_anonymous false\npassword_file \/mosquitto\/config\/password_file<\/code><\/pre>\n\n\n\n<p>Then restart the mosquitto docker to reload this config.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Connect Home Assistant to Mosquitto<\/h2>\n\n\n\n<p>Then visit <a href=\"http:\/\/localhost:8123\/\" target=\"_blank\" rel=\"noreferrer noopener\">localhost:8123<\/a> to create account and start using Home-Assistant.<\/p>\n\n\n\n<p>Click Setting in the left menu once you have logged in. Then click Devices &amp; services.<\/p>\n\n\n\n<p>Click &#8220;Add Integration&#8221; and type MQTT. Select MQTT and then click MQTT(the top alternative). You should see something like<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"871\" height=\"1024\" src=\"https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-2-871x1024.png\" alt=\"\" class=\"wp-image-902\" style=\"width:381px;height:auto\" srcset=\"https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-2-871x1024.png 871w, https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-2-480x565.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 871px, 100vw\" \/><\/a><\/figure>\n\n\n\n<p>Fill in all fields like in this example<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"1024\" src=\"https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-3-862x1024.png\" alt=\"\" class=\"wp-image-903\" style=\"width:381px;height:auto\" srcset=\"https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-3-862x1024.png 862w, https:\/\/www.yelloworb.com\/orbblog\/wp-content\/uploads\/2025\/06\/image-3-480x570.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 862px, 100vw\" \/><\/a><\/figure>\n\n\n\n<p>And click Submit. Now you have added your Mosquitto instance to Home Assistant!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wanted to experiment a bit with Home-Assistant while travelling. And wanted to be able to run as much as possibly locally on the laptop instead of connecting to my home setup since network connectivity is not always reliable. So here is a short summary how I set it up. Docker Desktop I already had Docker [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"<!-- wp:paragraph -->\n<p>Wanted to experiment a bit with Home-Assistant while travelling. And wanted to be able to run as much as possibly locally on the laptop instead of connecting to my home setup since network connectivity is not always reliable.<br><br>So here is a short summary how I set it up.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">Docker Desktop<\/h2>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>I already had <a href=\"https:\/\/www.docker.com\/products\/docker-desktop\/\">Docker Desktop<\/a> setup with a free <a href=\"https:\/\/www.docker.com\/products\/personal\/\">Docker Personal <\/a>account. If you do not have it setup already, download and install it.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">HomeAssistant and MQTT<\/h2>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>I found these two articles; <a href=\"https:\/\/fiddle-ranunculus-9bcx.squarespace.com\/blog\/home-assistant-tips\/installing-docker-home-assistant-and-portainer-on-ubuntu-linux\">Installing Docker, Home Assistant and Portainer on Ubuntu Linux<\/a> and <a href=\"https:\/\/www.homeautomationguy.io\/blog\/docker-tips\/configuring-the-mosquitto-mqtt-docker-container-for-use-with-home-assistant\">Configuring the Mosquitto MQTT Docker container for use with Home Assistant<\/a> but they are dedicated to run Docker on Linux and since my laptop is a Mac I had to do some modifications.<br><br>Create a folder on your laptop. I called mine Home-Assistant.<br><code>mkdir home-assistant<br>cd home-assistant<br>mkdir homeassistant<br>mkdir homeassistant\/config<\/code><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>Then run code docker-compose.yml and add<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><code>version: '3.0'<br>services:<br>  homeassistant:<br>    container_name: homeassistant<br>    image: \"ghcr.io\/home-assistant\/home-assistant:stable\"<br>    volumes:<br>      - .\/homeassistant\/config:\/config<br>      - \/etc\/localtime:\/etc\/localtime:ro<br>      - \/run\/dbus:\/run\/dbus:ro<br>    restart: unless-stopped<br>    privileged: true<br>    ports:<br>      - 8123:8123<\/code><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>Optionally if you want to run Mosquitto for MQTT<br>mkdir mosquitto<br>mkdir mosquitto\/data \u00a0<br>mkdir mosquitto\/log<\/p>\n<!-- \/wp:paragraph -->","_et_gb_content_width":"","footnotes":""},"categories":[32,86],"tags":[],"class_list":["post-831","post","type-post","status-publish","format-standard","hentry","category-hacking","category-home-assistant"],"_links":{"self":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/comments?post=831"}],"version-history":[{"count":16,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/831\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/831\/revisions\/904"}],"wp:attachment":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/media?parent=831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/categories?post=831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/tags?post=831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}