The Complete Magic Mirror Setup Walkthrough

Build your DIY smart mirror with this complete magic mirror setup guide: Raspberry Pi, MagicMirror² install, modules, optimization & troubleshooting.

Written by: Beatriz Nunes

Published on: March 31, 2026

What Is a Magic Mirror Setup (And How to Get One Running)

A magic mirror setup is the process of building a smart display that looks like a regular mirror but shows live information — time, weather, calendar events, and more — using a Raspberry Pi and free open-source software called MagicMirror².

Here is the fastest path to get it running:

  1. Flash Raspberry Pi OS onto a microSD card using Raspberry Pi Imager
  2. Connect via SSH (headless setup) or plug in a keyboard and monitor
  3. Install Node.js using the NodeSource setup script
  4. Clone the MagicMirror² repo with git clone https://github.com/MagicMirrorOrg/MagicMirror
  5. Run node --run install-mm inside the MagicMirror folder (takes ~10 minutes on a Pi 4)
  6. Copy the sample config with cp config/config.js.sample config/config.js
  7. Start it with node --run start

The whole project was created by developer Michael Teeuw, and MagicMirror² is now maintained by a large open-source community. It has been voted #1 in the MagPi Top 50 by the Raspberry Pi community — which says a lot about how popular and well-supported it is.

The core idea is simple: a monitor sits behind a piece of two-way mirror glass. The dark parts of the screen let the mirror reflect your face. The bright parts — widgets showing your calendar or the weather — shine through. It looks like the information is floating inside the mirror.

One DIY builder described their motivation perfectly: too many apps to check every morning, too much time lost in bed scrolling before getting up. A magic mirror puts everything in one glance, on the wall, hands-free.

This guide walks you through every step — hardware, software, configuration, and troubleshooting — so you end up with something that actually works reliably, not just a science project that breaks every week.

Layers of a magic mirror build: monitor, two-way glass, Raspberry Pi, MagicMirror² software, modules - magic mirror setup

Essential Hardware for Your Magic Mirror Setup

Building a magic mirror is a hardware project as much as a software one. While it looks like high-tech wizardry, the components are actually quite accessible. We have found that the secret to a stable magic mirror setup lies in choosing the right power and storage components.

Essential hardware: Raspberry Pi 4, monitor, and frame components - magic mirror setup

The Brain: Raspberry Pi 4

While we can use older models (more on that later), the Raspberry Pi 4 Model B with at least 2GB of RAM is our top recommendation. It handles the Chromium-based rendering much more smoothly than its predecessors. Ensure you have a high-quality 5V 3A USB-C power supply. Many “mystery failures” and random reboots in these projects are actually caused by cheap power adapters that can’t provide steady current.

The Display: Monitor Selection

You need a monitor with a slim profile. A 16 to 24-inch screen is generally considered the “sweet spot.” Look for a monitor where the ports face downward or sideways rather than straight out the back, as this makes the mirror much thinner when wall-mounted. If your ports face back, you will likely need right-angle HDMI adapters to keep the build flush.

The Mirror: Glass vs. Acrylic

This is the most critical aesthetic choice. You need a two-way mirror, which allows light from the monitor to pass through while reflecting the environment.

Feature Two-Way Glass Mirror Two-Way Acrylic/Film
Reflection Quality High (No “funhouse” effect) Moderate (Can warp slightly)
Durability Scratch-resistant Easily scratched
Weight Heavy Lightweight
Cost Expensive Affordable
Best For Permanent living room builds First-time projects / Kids’ rooms

Storage and Framing

We recommend a 16GB or 32GB Class 10 microSD card. Speed matters here because the OS needs to pull data quickly to keep the UI snappy. For the frame, many makers use a “shadow box” from craft stores or build a custom wooden frame. Just make sure there is enough ventilation; even a small Pi can get warm if it’s sealed in an airtight box for 24 hours a day.

Preparing the OS and Installing MagicMirror²

Before we touch the mirror glass, we need to get the software environment ready. We start by using the Raspberry Pi Imager. We suggest installing the Raspberry Pi OS (32-bit) desktop version. Even though we will run it in a “kiosk” style, the desktop environment makes initial troubleshooting much easier.

During the flashing process, click the “Settings” (gear icon) in the Imager. This allows us to perform a headless configuration. We can pre-set the hostname (maybe change it from “raspberrypi” to “magicmirror” to be unique!), enable SSH, and pre-fill our Wi-Fi credentials. This means the Pi will connect to our network the moment it boots, allowing us to finish the setup from our main computer.

Once the Pi is booted and you have connected via SSH, the first thing we always do is update the system: sudo apt update && sudo apt upgrade -y

Executing the Magic Mirror Setup Script

In the past, there was a single “automatic” script, but today the community prefers a more controlled manual installation to ensure long-term stability.

  1. Install Node.js: MagicMirror² runs on Node.js. Use the following command to get the latest version: curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs
  2. Clone the Repository: Navigate to your home folder and pull the code from GitHub: git clone https://github.com/MagicMirrorOrg/MagicMirror
  3. Install Dependencies: Enter the folder and run the installer: cd MagicMirror node --run install-mm

This installation step typically takes about 10 minutes on a Raspberry Pi 3 and significantly less on a Pi 4. If you are using a Pi 2, grab a cup of coffee — it can take up to 25 minutes.

For the most up-to-date details on specific environment requirements, we always recommend checking the Installation & Usage | MagicMirror² Docs. It is also worth noting that the MagicMirror² core team follows a quarterly release schedule, pushing updates on January 1, April 1, July 1, and October 1. Keeping your system updated ensures you have the latest security patches and module compatibility.

Configuring Modules and Customizing the UI

Once the software is installed, the real magic happens in the config/config.js file. This file acts as the master control for your mirror. If you are just starting, copy the sample file to get a working base: cp config/config.js.sample config/config.js

The structure of the config file is a Javascript object. Each module is an entry in a list. You can define where a module appears using positions like top_left, top_right, bottom_bar, or upper_third.

Default Modules and Their Uses

The core software comes with several excellent default modules:

  • Clock: Displays time and date (supports 12h and 24h formats).
  • Calendar: Connects to any iCal link. We often use this to sync Google Calendars so the family schedule is always visible.
  • Weather: Uses the OpenWeatherMap API to show current conditions and forecasts. You will need to sign up for a free API key to make this work.
  • Newsfeed: Scrolls through headlines from any RSS source (the default is the New York Times).
  • Compliments: Displays fun, randomized messages like “Looking sharp today!”

If you want to dive deeper into the visual aspects, we have a detailed guide on how to customize-magicmirror-ui/ to make the interface match your home’s aesthetic.

Advanced Magic Mirror Setup Customization

The true power of a magic mirror setup is the community-made third-party modules. There are hundreds available, ranging from Spotify “Now Playing” displays and traffic maps to facial recognition and voice control.

To install a third-party module:

  1. Navigate to ~/MagicMirror/modules.
  2. Use git clone [URL of the module].
  3. Enter the new module’s folder and run npm install if required.
  4. Add the configuration block to your main config.js file.

For those who want to build their own custom logic, checking out a smart-mirror-javascript-setup/ or our magic-mirror-coding-guide/ will give you the tools to create something truly unique.

To change the look and feel (fonts, colors, borders), we don’t edit the module files directly. Instead, we use the css/custom.css file. This allows us to override any default style without breaking the core software. For a full list of configuration options, the Introduction | MagicMirror² Docs is an invaluable resource.

Pro Tip: Remote Access If you want to view your mirror from a laptop browser to test changes, you must edit the address and ipWhitelist settings in config.js. Set the address to "0.0.0.0" and add your laptop’s IP address to the whitelist. This allows you to “preview” the mirror without standing in front of the physical glass.

Optimization, Auto-Start, and Troubleshooting

A mirror that you have to manually start every time the power flickers isn’t very “magical.” We want our magic mirror setup to be resilient and self-starting.

Using PM2 for Auto-Start

PM2 is a production process manager that will automatically restart MagicMirror² if it crashes or if the Pi reboots.

To set it up:

  1. Install PM2 globally: sudo npm install -g pm2
  2. Create a startup script (usually called mm.sh) that contains the command to start the mirror.
  3. Tell PM2 to run that script: pm2 start mm.sh
  4. Freeze the list so it survives reboots: pm2 save and pm2 startup

For a deeper dive into making your mirror “production-ready,” see our setting-up-your-smart-mirror-a-complete-guide/.

System Optimizations

To keep the mirror running 24/7 without issues, we need to perform a few “lean” optimizations:

  • Disable Screen Blanking: By default, Raspberry Pi OS turns off the screen after 10 minutes of inactivity. You can disable this in raspi-config under Display Options.
  • Wi-Fi Power Saving: The Pi sometimes puts the Wi-Fi chip to sleep to save power, which can break your weather and calendar updates. Turn this off by adding wireless-power off to your network interfaces configuration.
  • Reclaim Storage Space: We can reclaim about 1.1GB (1,112MB) of space by removing unnecessary software packages like LibreOffice and the Wolfram Engine. This reduces storage usage from roughly 48% down to 30% on a standard 8GB card.

Can I use a Raspberry Pi 3 for this project?

Yes, absolutely! While we recommend the Pi 4 for the smoothest experience, a Raspberry Pi 3 is more than capable of running a standard magic mirror setup. Just be mindful of how many “heavy” modules (like live video streams) you add, as the 1GB of RAM can fill up quickly.

How do I fix the “Please create a config file” error?

This is the most common error for beginners. It almost always means one of two things:

  1. You forgot to copy the sample file: cp config/config.js.sample config/config.js.
  2. There is a syntax error in your config.js (like a missing comma or bracket). You can check your config for errors by running node --run config:check inside the MagicMirror folder.

How do I exit the Magic Mirror full-screen mode?

If you are working directly on the Pi with a keyboard and need to get back to the desktop, press the ALT key to bring up the top menu, then select File > Quit. Alternatively, CTRL+Q usually does the trick.

Conclusion

Building a smart mirror is a rewarding journey that combines woodworking, electronics, and coding. By following this magic mirror setup guide, you have moved from a pile of parts to a functional, personalized information hub. Whether it’s helping your family stay on schedule or just giving you a “looking sharp” compliment in the morning, your new mirror is a testament to what a little DIY spirit can achieve.

We hope this guide has been helpful in getting your project off the ground. If you’re ready to take your hobby to the next level, explore more hardware projects on our site. Happy building!

Previous

Mirror Mirror on the Wall Who is the Smartest of Them All

Next

The Best Touch Screen Mirrors to Brighten Your Morning Routine