This guide provides a comprehensive walkthrough for installing and configuring essential tools like Chocolatey, WSL (Windows Subsystem for Linux), Docker Desktop, and ESPHome. Follow these steps carefully to ensure a smooth setup.
Chocolatey is a Package Manager that makes it easy to install applications. We will use Chocolatey to install Docker Desktop. Docker Desktop is used to run containers, which is what the ESPHome dashboard and EMQX (the MQTT Broker) run in. It saves you from having to install applications directly on your PC.
-
Open PowerShell as an administrator:
- Press
Win + S
, type "PowerShell," right-click, and select Run as administrator.
- Press
-
Run the following command to install Chocolatey:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
-
After installation, close PowerShell and reopen it as an administrator.
-
Use Chocolatey to install Docker Desktop:
choco install docker-desktop
-
Once installed:
- Open Docker Desktop.
- Sign in with your Docker account.
- Enable Auto Start in the settings.
-
Navigate to Resources > Network in Docker Desktop and enable Host Networking.
-
Ensure at the bottom left, the Docker engine is running.
-
Run the following command in PowerShell to deploy the EMQX broker:
docker run -d --restart always --name emqx -p 1883:1883 -p 8083:8083 -p 8084:8084 -p 8883:8883 -p 18083:18083 emqx/emqx:latest
-
Once running, access the EMQX dashboard by navigating to http://localhost:18083/ using the following credentials:
- Username:
admin
- Password:
public
- Username:
-
Deploy ESPHome using the following command:
docker run -d --restart always --net=host --name esphome -e ESPHOME_DASHBOARD_USE_PING=true -v esphome-config:/config -it ghcr.io/esphome/esphome
-
Once Running, browse to http://localhost:6052 to access the ESPHome Dashboard. From here you can start creating a new device in the right hand corner by clicking 'new device'
-
Open the ESPHome Dashboard. Select 'New Device'
-
Give your device a name, and enter in your Wifi details.
-
Under the 'Installation' Step - click skip. We will configure the device further before deploying.
-
Choose your device type. Generally ESP32 works best unless you have one with strange hardware. Click Next.
-
On the success page, hit Skip instead of Install.
-
Click 'Edit' on the newly created file. Add any additional config such as MQTT brokers, etc.
-
Once ready, hit install. Generally on first provision of a device, you want to use your web browser (Chrome or Edge only). Afterwards you can deploy wirelessly.
- Ensure you have administrator privileges for every step requiring elevated access.
- Restart PowerShell or your machine if you encounter any installation issues.
- Verify Docker Desktop and its settings if services fail to start.