How to Install MagicMirror on Raspberry Pi
This article provides a straightforward, step-by-step guide to installing and running the open-source MagicMirror² software on a Raspberry Pi. You will learn how to prepare your Raspberry Pi, run the automated installation script, and configure the software to start automatically, transforming your monitor into a smart information hub.
Prerequisites and Hardware Prep
Before diving into the software installation, ensure you have the necessary hardware ready and configured.
- Raspberry Pi: A Raspberry Pi 3, 4, or 5 is highly recommended for optimal performance.
- Operating System: Install Raspberry Pi OS (64-bit) using the Raspberry Pi Imager. It is best to use the standard desktop version.
- Network Connection: Ensure your Pi is connected to the internet via Wi-Fi or Ethernet.
- System Updates: Open a terminal on your Pi and run the following commands to ensure all system packages are up to date:
sudo apt update && sudo apt upgrade -yInstalling Node.js and Git
MagicMirror² is built on the Electron framework and requires Node.js and Git to clone the repository and run dependencies.
- Install the latest compatible version of Node.js and npm by running the official setup script in your terminal.
- Install Git if it is not already present on your system.
Fetching and Installing MagicMirror
Once the foundational software is ready, you can download the MagicMirror source code and install its required packages.
- Clone the official MagicMirror² repository from GitHub to your local directory:
git clone https://github.com/MagicMirrorOrg/MagicMirror- Navigate into the newly created MagicMirror directory:
cd MagicMirror- Install the application dependencies using npm:
npm install --only=prodConfiguring the Software
The application requires a configuration file to recognize what modules to display on the screen.
- Copy the default sample configuration file to create your active configuration:
cp config/config.js.sample config/config.js- You can optionally edit this file later using a text editor like
Nano (
nano config/config.js) to customize your weather location, time formats, and calendar feeds.
Running MagicMirror
With the configuration file in place, you are ready to launch the smart mirror interface.
- From inside the
~/MagicMirrordirectory, execute the start command:
npm start- The screen will turn black and load the default interface layout,
displaying a clock, calendar, default compliments, and news feeds. To
exit the application, you can press
Ctrl + Qor useCtrl + Cin the terminal window.