How to Install webtrees on OpenBSD

webtrees is an open-source web-based genealogy software that helps you create family trees and share them with others. In this tutorial, we will guide you through the process of installing webtrees on OpenBSD.

Prerequisites

Installing Dependencies

Before we can install webtrees, we need to make sure that all the required dependencies are installed. OpenBSD uses the package manager pkg_add to install packages.

  1. Update the package list:
# pkg_add -u
  1. Install the required dependencies:
# pkg_add php postgresql-server ap-php

Setting up PostgreSQL

webtrees requires a PostgreSQL database to store its data. Let's set up PostgreSQL and create a database for webtrees.

  1. Initialize the PostgreSQL database:
# rcctl start postgresql
# su - _postgresql
$ initdb -D/var/postgresql/data/
  1. Start PostgreSQL:
$ exit
# rcctl enable postgresql
# rcctl start postgresql
  1. Create a new database and user for webtrees:
# su - postgres
$ createdb webtrees
$ createuser --pwprompt webtrees

Installing webtrees

Now that we have all the dependencies installed, let's proceed with the installation of webtrees.

  1. Download and extract the latest version of webtrees:
# cd /var/www/htdocs
# ftp https://github.com/fisharebest/webtrees/releases/latest/download/webtrees-2.0.16.zip
# unzip webtrees-2.0.16.zip
# cd webtrees
  1. Copy the sample configuration file and edit it to reflect your PostgreSQL database settings:
# cp data/config.ini.sample data/config.ini
# nano data/config.ini

Update the following lines with your PostgreSQL settings:

database_type = postgresql
database_host = localhost
database_port = 5432
database_name = webtrees
database_user = webtrees
database_password = your_database_password_here
  1. Run the webtrees installer:
# chmod -R u+w data
# chmod u+x index.php
# ./index.php

Follow the on-screen instructions to complete the installation.

  1. Once the installation is complete, remove the install directory for security purposes:
# rm -r install
  1. Finally, set the correct permissions for webtrees directories:
# chown -R www:www /var/www/htdocs/webtrees
# chmod 755 /var/www/htdocs/webtrees

Accessing webtrees

With the installation complete, you can now access webtrees by opening a web browser and navigating to the following URL:

http://<server-ip>/webtrees

You will be prompted to log in with the credentials you specified during the installation.

Congratulations, you have successfully installed webtrees on OpenBSD!

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!