Installing magic mirror on a raspberry pi

Documenting some instructions for myself.

Docker-based installation

I used a Docker-based installation to test-drive the server. It was a seamless installation.

  1. Install Docker on a raspberry pi
  2. Install raspberry pi magic mirror via Docker

Manual installation

Install Docker on a raspberry pi

Taken from pimylifeup

Install Docker

To install Docker on a raspberry pi, we need the following commands:

Firstly, keep system up-to-date:

sudo apt update
sudo apt upgrade

Then execute the Docker installation script:

curl -sSL https://get.docker.com | sh

Then, allow pi (OR WHATEVER YOUR DEFAULT USER IS) to the docker group:

sudo usermod -aG docker pi

Finally, logout and log back in to allow changes to take place.

Test-drive installation

Check that docker shows up amongst the user groups:

groups | grep docker

Try out the hello world of Docker apps:

docker run hello-world

Install raspberry pi magic mirror manually

Taken from official docs

Install raspberry pi magic mirror via Docker

Installation instructions taken from bastilimbach/docker-MagicMirror.

docker run  -d \
    --publish 80:8080 \   # NOTE: see below
    --restart always \
    --volume ~/magic_mirror/config:/opt/magic_mirror/config \
    --volume ~/magic_mirror/modules:/opt/magic_mirror/modules \
    --volume /etc/localtime:/etc/localtime:ro \
    --name magic_mirror \
    bastilimbach/docker-magicmirror

Regarding the publish kwarg:

  • I was already running another web server, so I changed the publish port to 8080:8080, so that I could run it on a port independent of that other web server.