Skip to content

Beginner's Guides (2 articles: ESPHome on Docker Desktop & Adding Devices) #4411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: current
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
71d4fd6
Beginner's Guides (1) Install Docker Desktop & ESPHome (2) Adding Dev…
trip5 Nov 4, 2024
78a10e5
Link on front page to device guide (replaces command line)
trip5 Nov 4, 2024
1f8cd8c
Proofread and typos fixed
trip5 Nov 4, 2024
d8e3d48
Fixed relative links and placeholders
trip5 Nov 4, 2024
d2983ac
Fixed broken link
trip5 Nov 4, 2024
33f813d
SEO improvement
trip5 Nov 4, 2024
21d9622
Merge branch 'current' into guide_for_noobs
trip5 Nov 9, 2024
26cbf27
Nitpick had some good suggestions.
trip5 Nov 9, 2024
74a69de
Merge branch 'guide_for_noobs' of https://github.com/trip5/esphome-do…
trip5 Nov 9, 2024
76931a9
Merge branch 'current' into guide_for_noobs
trip5 Nov 9, 2024
fcbcb7f
Merge branch 'current' into guide_for_noobs
trip5 Nov 9, 2024
4ca17ce
Merge branch 'current' into guide_for_noobs
trip5 Nov 11, 2024
288932b
Merge branch 'current' into guide_for_noobs
trip5 Nov 13, 2024
c651ffe
Merge branch 'current' into guide_for_noobs
trip5 Nov 18, 2024
493d5c6
Merge branch 'current' into guide_for_noobs
trip5 Nov 23, 2024
4c7d8dd
Merge branch 'current' into guide_for_noobs
trip5 Dec 6, 2024
a1744e3
Merge branch 'current' into guide_for_noobs
trip5 Dec 16, 2024
c61de6f
Merge branch 'current' into guide_for_noobs
trip5 Dec 27, 2024
2018aa5
Merge branch 'current' into guide_for_noobs
trip5 Jan 1, 2025
42b5b79
Merge branch 'current' into guide_for_noobs
trip5 Jan 1, 2025
6eaf4dc
2025.02.17 Update (kbx suggestions, Syntax for 2025.02)
trip5 Feb 16, 2025
ebbc661
Merge branch 'guide_for_noobs' of https://github.com/trip5/esphome-do…
trip5 Feb 16, 2025
b426a64
Links fixed
trip5 Feb 16, 2025
f696a32
Update guides/beginners_guide_docker_desktop.rst
trip5 Feb 16, 2025
917831b
Update guides/beginners_guide_docker_desktop.rst
trip5 Feb 16, 2025
755c6ee
Merge branch 'current' into guide_for_noobs
trip5 Feb 16, 2025
a321e4c
My own nit-picking
trip5 Feb 16, 2025
131ce55
2.4/5Ghz warning
trip5 Feb 17, 2025
e21a1f3
Merge branch 'current' into guide_for_noobs
trip5 Feb 17, 2025
7552183
Followed nitpicker's suggestions
trip5 Feb 17, 2025
4d2878d
Update guides/beginners_guide_adding_devices.rst
trip5 Feb 17, 2025
501e509
Update guides/beginners_guide_adding_devices.rst
trip5 Feb 17, 2025
82952ca
Added FAQ link at bottom
trip5 Feb 17, 2025
12be63b
Whoops, FAQ link fixed (beginner's guide)
trip5 Feb 17, 2025
72b6db4
FAQ was still wrong (oops)
trip5 Feb 17, 2025
b9a35da
Merge branch 'current' into guide_for_noobs
trip5 Feb 17, 2025
bf63aea
Merge branch 'esphome:current' into guide_for_noobs
trip5 Feb 23, 2025
36badc2
Merge branch 'current' into guide_for_noobs
trip5 Apr 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
620 changes: 620 additions & 0 deletions guides/beginners_guide_adding_devices.rst

Large diffs are not rendered by default.

201 changes: 201 additions & 0 deletions guides/beginners_guide_docker_desktop.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Beginner's Guide to Installing ESPHome on Docker Desktop
========================================================

.. seo::
:description: Installing ESPHome On Docker Desktop (For Beginners)
:image: docker-mark-blue.svg

This guide is for people who are not so tech-orientated but wish to get their feet wet with ESPHome.

Docker Desktop
--------------

Probably the easiest way to start with ESPHome, especially when you're not familiar with Home Assistant, is to start with Docker Desktop.

Docker Desktop can run Linux containers like ESPHome very well, although it may be slow on under-powered machines like "just for work" notebooks.

Running the command-line version of ESPHome might be enjoyable for the Linux-savvy but can be a headache, especially when it comes to Python and its dependencies.
The Docker version of ESPHome will take care of all the dependencies and make it a lot easier to at least get started with ESPHome.

Prepare Location for Docker and ESPHome Files
---------------------------------------------

You will need to make folders where Docker can use config files for ESPHome (and other containers). This makes it painless to update the ESPHome container.

I recommend something easy to find. The example below uses ``D:\Docker\esphome`` but anything easy to find will be good.

Install Docker Desktop
----------------------

Download and install the appropriate version of Docker Desktop from `the official site <https://www.docker.com/products/docker-desktop/>`__.
On Windows, this will also install any needed dependencies like WSL (Windows Subsystem for Linux). On Mac, it will make sure you have
Apple Virtualization Framework. You should accept any required other installs.

If you have installation issues, please refer to the docker documentation for
`Windows <https://docs.docker.com/desktop/install/windows-install/>`__,
`Linux <https://docs.docker.com/desktop/install/linux/>`__, or
`Mac <https://docs.docker.com/desktop/install/mac-install/>`__.

Please note that although Docker Desktop is not particularly large, containers like ESPHome can be. And the compilation of ESPHome binaries
can take up a lot of space, too. You might be okay with 5GB free space but 10GB or more is highly recommended as a minimum since building
binaries can also take up space.

If Docker asks you to login, you can skip this.

Docker may also require a reboot to finalize the installation.

Add the ESPHome container
-------------------------

In Docker Desktop, you first to need to download the ESPHome image. Click ``Images`` and then ``Search images to run``.

.. figure:: images/noob_docker_1.png
:align: center
:width: 95.0%
:alt: Docker Desktop window with circle around "Images" and "Search images to run"

Type ``esphome`` in the search box. The official ESPHome image belongs to the DockerHub member ``esphome`` so it should appear at the top as ``esphome/esphome``.

Next to that image, you can select the version but unless you have a specific problem, the ``latest`` is the best to use. Click ``Pull`` to download the image.

It will take a few moments to download the image.

.. figure:: images/noob_docker_2.png
:align: center
:width: 95.0%
:alt: Docker Desktop search window with circle around "esphome" in the search box, a circle around "esphome/esphome", and a circle around "Pull"

Click on ``Images`` again and it should now show that you have the image ``esphome/esphome`` ready to use. Click the ``Run`` button.

.. figure:: images/noob_docker_3.png
:align: center
:width: 95.0%
:alt: Docker Desktop window with circle around "Images" and "Run" button

Before actually running, expand the optional settings. Give the container a name like ``esphome`` (you can use capital letters here if you like).
Also, set the port to use to access the GUI. The default is ``6052``.
In the ``Volumes`` options, enter the locations ``Host path`` (set to the location created earlier) and ``Container path`` (Set to ``/config`` - it **MUST** be exactly like this).
Also, add an environment variable called ``TZ`` and set to your local timezone. If you're not sure what yours is called, check
`Wikipedia <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_ under ``TZ identifier``. Canonical-types are best.

After all that is done, click ``Run`` and the container will start.

.. figure:: images/noob_docker_4.png
:align: center
:width: 95.0%
:alt: Docker Desktop run window with Optional Settings expanded and a circles around "Container Name" set to "esphome" and "Host port" set to 6052 and "Host path" set to "D:\Docker\esphome" and "Container path" set to "/config" and Variable set to "TZ" and "Value" set to "Asia/Seoul"

Windows may ask if Docker can access the network. Click ``Allow``.

.. figure:: images/noob_docker_4b.png
:align: center
:width: 50.0%
:alt: Windows Security warning asking if Docker Desktop Backend should have network access

If your window looks like something like this, congratulations! You are now running ESPHome on your computer!

.. figure:: images/noob_docker_5.png
:align: center
:width: 95.0%
:alt: Docker Desktop showing the container running

Go back to the Containers tab to manage the ESPHome container and ``Open with browser`` anytime the container is running.

.. figure:: images/noob_docker_6.png
:align: center
:width: 95.0%
:alt: Docker Desktop showing running containers with a circle around "Containers" and another circle around ⋮ and an arrow pointing to "Open with browser"

The gear in the top right corner allows you to manage Docker Desktop settings. Docker usually is not set to start with Windows but you can change that if you like.

You can also update Docker Desktop itself by clicking on the gear and then clicking on ``Software updates``.

.. figure:: images/noob_docker_7.png
:align: center
:width: 95.0%
:alt: Docker Desktop showing running containers with circles around the Settings gear icon and the Run icon and the delete icon

Also when starting Docker Desktop again, you may also need to run the container again using this screen. When it is running the run ``▶`` icon will change to a stop ``⯀`` icon.

.. note::

Also in this screen are options to stop and delete the container. You **MUST** stop the container AND delete the container before updating the ESPHome image.

To update the ESPHome container (so you can run the latest version of ESPHome), click ``Settings`` then three dots ``⋮``,
and select ``Pull``. Docker Desktop will check if there is a new ``latest`` image to pull. If there is, it will download it.
If not, it will tell you ``Image is up to date``.

.. figure:: images/noob_docker_8.png
:align: center
:width: 95.0%
:alt: Docker Desktop showing Images with a circle around "Images" and another circle around ⋮ and an arrow pointing to "Pull"

You will have to recreate the container as illustrated above. As long as you you point to the correct folder with your ESPHome ``config`` files,
your configuration and all your device files will remain unchanged.

Automatically Update the ESPHome Container
******************************************

If you wish to automate the process (without deleting your esphome container or even stopping it), there's an easier way.

Search for images to add, enter ``adamus1red/ouroboros`` (the original is ``pyouroboros/ouroboros`` but it hasn't been updated in years),
``Pull`` the image, then ``Run`` with these options:


.. figure:: images/noob_docker_9.png
:align: center
:width: 95.0%
:alt: Docker Desktop showing Images with arrow pointing to the "search bar"

As before, we need to specify some optional settings.

.. figure:: images/noob_docker_9b.png
:align: center
:width: 95.0%
:alt: Docker Desktop showing Run a New Container named "ouroboros" with "Host Path" and "Container Path" set and 4 environment variables

Because Ouroboros needs access to Docker's core, we should enter ``/var/run/docker.sock`` as the Container Path but where docker.sock resides
on your computer depends on the operating system you are using.

.. tabs::

.. tab:: Windows

Enter ``//var/run/docker.sock`` as the Host Path.

*Note the double //.*

.. tab:: Linux

Enter ``/var/run/docker.sock`` as the Host Path.

*This should work for most cases.*

.. tab:: MacOS

Enter ``/var/run/docker.sock`` as the Host Path.

*The author does not have a Mac so this is untested.*

Also, set 4 environment variables (use the ``+`` to add more) ``SELF_UPDATE`` : ``true`` and ``CLEANUP`` : ``true`` and ``RUN_ONCE`` : ``true`` and ``LATEST`` : ``true``.

Now, to automatically update all containers, just run the ``ouroboros`` container. It will automatically stop a container, pull the ``latest`` image,
and restart the container with your previous settings. It will do this to all existing containers. Then, it will stop.

.. note::

It is not actually best practice to perform updates automatically like this but it is a good way to automate the process if you are only running one container.

You should probably check ESPHome's :doc:`Release Notes </changelog/index>` before, during, or after an update to see if there are any changes that affect your devices.

What's Next?
------------

Now you can add your :doc:`first ESPHome device <beginners_guide_adding_devices>`!

See Also
--------

- :doc:`ESPHome index </index>`
- :doc:`getting_started_hassio`
- :ghedit:`Edit`
Binary file added guides/images/noob_dashboard_1a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_1b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_1c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_2a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_2b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_2c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_2e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_2f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_2g.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3d.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_3g.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_4a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_4b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_4c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_4d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_dashboard_4e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_docker_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_docker_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/noob_docker_3.png
Binary file added guides/images/noob_docker_4.png
Binary file added guides/images/noob_docker_4b.png
Binary file added guides/images/noob_docker_5.png
Binary file added guides/images/noob_docker_6.png
Binary file added guides/images/noob_docker_7.png
Binary file added guides/images/noob_docker_8.png
Binary file added guides/images/noob_docker_9.png
Binary file added guides/images/noob_docker_9b.png
12 changes: 12 additions & 0 deletions images/docker-mark-blue.svg
4 changes: 2 additions & 2 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ESPHome is a system to control your microcontrollers by simple yet powerful conf
</a>
</li>
<li>
<a class="reference" href="/guides/getting_started_command_line.html">
using the command line
<a class="reference" href="/guides/beginners_guide_adding_devices.html">
adding devices (for beginners)
</a>
</li>
<li>
Expand Down
Binary file added svg2png/docker-mark-blue.png