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.

sudo apt update && sudo apt upgrade -y

Installing Node.js and Git

MagicMirror² is built on the Electron framework and requires Node.js and Git to clone the repository and run dependencies.

  1. Install the latest compatible version of Node.js and npm by running the official setup script in your terminal.
  2. 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.

  1. Clone the official MagicMirror² repository from GitHub to your local directory:
git clone https://github.com/MagicMirrorOrg/MagicMirror
  1. Navigate into the newly created MagicMirror directory:
cd MagicMirror
  1. Install the application dependencies using npm:
npm install --only=prod

Configuring the Software

The application requires a configuration file to recognize what modules to display on the screen.

  1. Copy the default sample configuration file to create your active configuration:
cp config/config.js.sample config/config.js
  1. 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.

  1. From inside the ~/MagicMirror directory, execute the start command:
npm start
  1. 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 + Q or use Ctrl + C in the terminal window.