Install Magic Mirror on Raspberry Pi Zero W
This article provides a comprehensive guide to installing MagicMirror² on a Raspberry Pi Zero W. MagicMirror² is an open-source modular smart mirror platform. The Raspberry Pi Zero W, with its compact size and built-in Wi-Fi, is a suitable platform for powering a smart mirror. This guide focuses on a streamlined installation process, utilizing a lightweight operating system to maximize performance on the resource-constrained Pi Zero W.
Preparing the Raspberry Pi Zero W
Before beginning the MagicMirror² installation, the Raspberry Pi Zero W needs to be set up. This involves installing the operating system and configuring essential settings.
- Download a lightweight Raspberry Pi OS image. Raspberry Pi OS Lite is recommended for this project due to limited resources on the Pi Zero W.
- Use a suitable SD card writing tool (e.g., Raspberry Pi Imager, Etcher) to flash the downloaded image onto a microSD card.
- Enable SSH. Create an empty file named "ssh" (without any extension) in the "boot" partition of the freshly flashed SD card. This enables SSH access upon first boot.
- Configure Wi-Fi. Create a file named "wpa_supplicant.conf" in the "boot" partition. Add the following lines, replacing "YOUR_SSID" and "YOUR_PASSWORD" with your network credentials:
country=GB ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="YOUR_SSID" psk="YOUR_PASSWORD" }
- Insert the microSD card into the Raspberry Pi Zero W and connect the power supply.
Connecting to the Raspberry Pi Zero W
After the initial boot, the Raspberry Pi Zero W will connect to your Wi-Fi network. It is necessary to establish an SSH connection to configure the device further.
- Determine the IP address of your Raspberry Pi Zero W. This can be done by checking your router's DHCP client list or using a network scanning tool.
- Use an SSH client (e.g., PuTTY, Terminal) to connect to the Raspberry Pi. The command format is
ssh pi@YOUR_PI_IP_ADDRESS
. The default password is "raspberry".
Updating and Installing Dependencies
Once connected via SSH, it is crucial to update the system and install necessary packages for MagicMirror².
- Update the package list with the command:
sudo apt update
. - Upgrade installed packages with the command:
sudo apt upgrade -y
. - Install essential build tools and dependencies:
sudo apt install build-essential npm git -y
.
Installing MagicMirror²
With the prerequisites in place, the MagicMirror² installation can proceed.
- Clone the MagicMirror² repository:
git clone https://github.com/MichMich/MagicMirror.git
. - Navigate into the MagicMirror² directory:
cd MagicMirror/
. - Install dependencies and start the installation script:
npm install && npm run install-mm
. This process may take some time.
Configuring MagicMirror²
After installation, the configuration file allows customization of the modules and appearance of MagicMirror².
- Open the configuration file:
nano config/config.js
. - Modify the configuration as needed. The configuration file offers extensive customization options, allowing users to add, remove, and configure modules.
- Save and close the configuration file.
Running MagicMirror²
Following configuration, MagicMirror² can be started to verify the setup.
- Start MagicMirror² in server mode:
npm start
. - MagicMirror² should now be running on your Raspberry Pi Zero W. Access it by navigating to the Raspberry Pi's IP address in a web browser on another device connected to the same network. For example:
http://YOUR_PI_IP_ADDRESS:8080
Autostarting MagicMirror²
To ensure MagicMirror² starts automatically on boot, configure a systemd service.
- Create a systemd service file:
sudo nano /etc/systemd/system/mm.service
. - Add the following content, modifying the user and group if necessary:
[Unit] Description=MagicMirror After=network.target [Service] Type=simple User=pi Group=pi WorkingDirectory=/home/pi/MagicMirror ExecStart=/usr/bin/npm start Restart=on-failure [Install] WantedBy=multi-user.target
- Enable and start the service:
sudo systemctl enable mm && sudo systemctl start mm
.
This comprehensive guide describes the steps required to install and configure MagicMirror² on a Raspberry Pi Zero W. Further customization and module installation are possible by referring to the extensive documentation available on the official MagicMirror² website.

Installing Magic Mirror² On A Raspberry Pi Zero Mirror Central

My First Smart Mirror In A Frame Of 40 X 30 Cm With Raspberry Pi Zero W Magicmirror Forum

Building A Smart Mirror Magicmirror² On Raspberry Pi Zero W The Smarthome Journey

Do It Yourself Easiest Smart Mirror Build On Raspberry Pi Zero W And Quick

My First Smart Mirror In A Frame Of 40 X 30 Cm With Raspberry Pi Zero W Magicmirror Forum

How To Make A Magic Mirror With Raspberry Pi Sparkfun Learn

How To Build A Smart Magic Mirror

Magicmirror 7 5 Eink Epaper Bilderrahmen Mit Einem Raspberry Pi Zero W 1 Maker Tutorials

How To Build A Smart Magic Mirror Using Raspberry Pi Zero Tutorial

How To Setup Build A Magic Mirror With Raspberry Pi Beginners Guide Okdo