Your system requires a password for shutdown/reboot commands. To fix this:
-
Open the sudoers file (safely):
sudo visudo
-
Add this line at the end (replace
piwith your username):pi ALL=(ALL) NOPASSWD: /sbin/shutdown
-
Save and exit (Ctrl+X, then Y, then Enter)
Now shutdown and reboot should work without password prompts.
See also: Ubuntu guide on passwordless shutdown
The restart function depends on your process manager setup.
- In Desktop mode (with Electron), restart uses
app.relaunch()andapp.quit() - In Server mode, the process exits cleanly and your process manager (systemd, PM2, Docker, etc.) should restart it
- Make sure your process manager is configured to restart on clean exit (exit code 0)
For example, with systemd set Restart=on-success, or with PM2 use the default auto-restart behavior.
See MagicMirror Docs for setup instructions.
- Check your display server:
echo $XDG_SESSION_TYPE - Configure the correct commands for your system. See Monitor Control.
- Test commands manually in the terminal before adding to config.
Important: If monitorStatusCommand doesn't work correctly, the toggle function won't work!
This is likely because:
- No API key set and
secureEndpoints: true(default) is blocking dangerous actions - Solution: Either set an
apiKeyin your config, or setsecureEndpoints: false(not recommended)
config: {
apiKey: 'your-secret-key',
// or
secureEndpoints: false, // Not recommended!
}Usually a syntax error in your config file or custom menu JSON.
- Validate your
config.js: Copy contents to JSONLint (remove thevar config =and trailing;) - Validate your custom menu JSON at JSON Formatter
- Check the terminal for error messages
Make sure you're using the standard MagicMirror installation.
Non-standard installations may have different paths or configurations. If you're having issues, open an issue with details about your setup.
If running manually:
cd ~/MagicMirror
npm startLogs appear in the terminal.
If using PM2:
pm2 logs mm # or your process name
pm2 logs mm --lines 100 # last 100 linesBrowser console: Press F12 in the MagicMirror window to open DevTools.
- Search existing issues
- Check the MagicMirror Forum
- Open a new issue with:
- Your
config.js(remove sensitive data) - Error messages from logs
- Steps to reproduce the problem
- Your