Open Source Detective

Webtrees on Raspberry Pi with Docker

Cover Image for Webtrees on Raspberry Pi with Docker
Open Source Detective

Introduction

Webtrees is an opensource genealogy application which runs on PHP and MySQL. It's a great option for anyone trying to build their family tree and document their genealogy. I recently came across it and wanted to run it on one of my unused Raspberry Pi's. After a little research I discovered that the community had created an open source docker image which made the whole process simple and straight forward.

Prerequisites

  1. Raspberry Pi - I used a Raspberry Pi 3 but there's no reason that you couldn't use a 4 if that's what you have laying around
  2. Fresh install of the Raspberry Pi OS

Docker Installation

First up is installing Docker. Raspberry Pi OS doesn't come with this pre installed so I will outline that process below:

Open up a command prompt and run the following commands:

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/raspbian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

If all of this works you should be able to run the following command successfully:

sudo docker run hello-world

If you run into any issues with installation you can visit the official docker documentation here

MySQL Installation

In order to run webtrees you'll need MySQL installed. The easiest way to do this is to use a docker image and expose the port locally for webtrees to connect. The docker image I used can be found here. It's a version of MySQL that can be run on Raspberry PI's Architecture.

Run the following command to create the MySQL instance. Create your own safe password for root and a username/password for your webtrees app to use.

docker run -it -e 'MYSQL_ROOT_PASSWORD=safe-root-password' -e 'MYSQL_DATABASE=webtrees' -e 'MYSQL_USER=webtrees-user' -e 'MYSQL_PASSWORD=safe-webtrees-password' -p '3306:3306' --name webtrees-mysql beercan1989/arm-mysql:latest

The -p option indicates which port you want exposed to your local network for the MySQL instance. This is typically 3306 for MySQL.

If you run into any issues with the installation visit the documentation here.

Webtrees Installation

To install and run webtrees you can use the following docker image. Run the following command to initiate and expose your webtrees docker image to port 80 on your local network. When this is complete you should be able to open webtrees on your local network in your browser by going to the IP address that your Raspberry PI is attached to on your local network.

docker run -d -p 80:80 --name webtrees --link webtrees-mysql:db -v /webtrees/data:/var/www/html/data -e DISABLE_SSL=TRUE -e PORT=80 --restart always dtjs48jkt/webtrees

The last thing to do is follow the prompts in the browser to hookup MySQL to your app and create the admin user and password for the site.

Hopefully this helps you get Webtrees up and running on your own Raspberry Pi.


More Stories

Cover Image for Tutorial: Pentesting Device with Raspberry Pi Zero

Tutorial: Pentesting Device with Raspberry Pi Zero

Lately I’ve been more and more interested in pentesting and cyber security. To continue my deep dive into the topic I’m going to create a pentesting device out of a Raspberry Pi Zero. A few requirements I want to fulfill. First, I’d like to be able to run many of the commands that you can run in Linux. Second, I’d like it to be battery powered and attach my iPhone to it to run commands. Essentially I’d like to be able to carry the device in my pocket and operate it with my iPhone.

Open Source Detective
Cover Image for Local DNS Server with Pi-Hole

Local DNS Server with Pi-Hole

Recently, I’ve been developing some websites to run on my local network and wanted to create my own DNS server. After some research I realized that building my own custom server would be a lot more work than I wanted to undertake. After a little more searching I came across Pi-Hole which offered a much quicker solution.

Open Source Detective