Project

General

Profile

Support #980

Install MagicMirror on Debian

Added by Daniel Curtis 27 days ago. Updated 25 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Node.js
Target version:
Start date:
06/21/2025
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

This is a guide for installing MagicMirror with Debian Bookworm on a Raspberry Pi 2

Prepare the Environment

  • Make sure everything is up to date:
    sudo apt update && sudo apt upgrade
    
  • Install nodejs repo:
    curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
    sudo bash nodesource_setup.sh
    
  • Install required dependencies:
    sudo apt install wayfire seatd xdg-user-dirs git nano openssl ca-certificates wget gnupg libgtk-3-0 libx11-xcb-dev libnss3-dev libxss1 libxtst6 libasound2 libdrm2 libgbm1 fonts-arphic-uming procps arp-scan libatk1.0-0 libraspberrypi-bin libllvm14 libgl1-mesa-dri libglapi-mesa libsensors5 libdrm-radeon1 libelf1 libdrm-amdgpu1 libdrm-nouveau2 libgpiod-dev nodejs
    
  • Edit cmdline.txt :
    sudo nano /boot/firmware/cmdline.txt
    
  • Add wayland=on to the command line options:
    console=serial0,115200 console=tty1 root=PARTUUID=ef31a647-01 rootfstype=ext4 fsck.repair=yes wayland=on rootwait cfg80211.ieee80211_regdom=US
    
  • Create the magicmirror user and add it to the video group:
    sudo adduser --uid 1001 -ingroup users --shell /bin/bash --comment "magicmirror" mm
    sudo usermod -aG video mm
    
  • Create a oneshot service to create the XDG_RUNTIME_DIR path:
    sudo nano /etc/systemd/system/create-xdg-runtime-dir.service
    
    • And add the following:
      [Unit]
      Description=Create XDG_RUNTIME_DIR for magicmirror
      After=local-fs.target
      
      [Service]
      Type=oneshot
      ExecStart=/bin/mkdir -p /run/user/1001
      ExecStart=/bin/chown 1001:1001 /run/user/1001
      ExecStart=/bin/chmod 700 /run/user/1001
      
      [Install]
      WantedBy=multi-user.target
      
  • Create a wayfire service file:
    sudo nano /etc/systemd/system/wayfire.service
    
    • And add the following:
      [Unit]
      Description=Wayfire Wayland Compositor
      After=rc-local.service
      
      [Service]
      User=mm
      Type=simple
      ExecStart=/usr/bin/wayfire
      Restart=on-failure
      Environment=XDG_RUNTIME_DIR=/var/run/user/1001
      
      [Install]
      WantedBy=multi-user.target
      
  • Reload systemd and enable the two services at boot:
    sudo systemctl daemon-reload
    sudo systemctl enable wayfire
    sudo systemctl enable create-xdg-runtime-dir
    

Install MagicMirror

  • Switch to the magicmirror user:
    sudo su - mm
    
  • Add XDG_RUNTIME_DIR to .bashrc:
    echo "export XDG_RUNTIME_DIR=/run/user/1001" >> ~/.bashrc
    
  • Clone the MagicMirror repository:
    git clone https://github.com/MagicMirrorOrg/MagicMirror
    
  • Install the application:
    cd MagicMirror
    npm run install-mm
    
  • Create the config file:
    cp config/config.js.sample config/config.js
    

Autostart MagicMirror

  • Create a launch script:
    nano /home/mm/launch-mm.sh
    
    • And add the following:
      #!/bin/bash
      cd /home/mm/MagicMirror
      npm run start:wayland
      
    • Don't forget to make it executable:
      chmod +x /home/mm/launch-mm.sh
      
  • Create a wayfire config
    nano /home/mm/.config/wayfire.ini
    
    • And add the following:
      [core]
      plugins = autostart
      
      [autostart]
      boot = /home/mm/launch-mm.sh
      

Run MagicMirror

  • Exit out of the magicmirror user:
    exit
    
  • Start the create-xdg-runtime-dir and wayfire services:
    sudo systemctl start create-xdg-runtime-dir
    sudo systemctl start wayfire
    

Resources

#1

Updated by Daniel Curtis 26 days ago

  • Estimated time set to 1.00 h
  • % Done changed from 0 to 90
  • Status changed from New to In Progress
  • Description updated (diff)
#2

Updated by Daniel Curtis 26 days ago

  • Description updated (diff)
#3

Updated by Daniel Curtis 26 days ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Resolved
  • Description updated (diff)
#4

Updated by Daniel Curtis 25 days ago

  • Description updated (diff)

Also available in: Atom PDF