Some links in this post may be affiliate links. We may get paid if you buy something or take an action after clicking one of these, but without addictional costs for you compared to direct buying.

Self Hosted forum with phpBB and Raspberry PI

raspberry pi phpBB featured image
5
(1)

King of self hosted forum platforms, phpBB has a strong story and is spreadly used. As its name suggests, it is based on php and is so light that you can run your self-hosted forum with phpBB on Raspberry PI

In this tutorial I’m going to show you hot to install phpBB and configure your very first topic on a cheap Raspberry PI Zero W.

phpBB is an open source (Licensed under the GPLv2) forum software, built with a bulletin board logic, that can link a group of people or can power an entire website. Its features can be extended using extensions that can be installed and configured with few clicks.

PhpBB includes a customizable registration process for your users, allowing administrator to manage permissions up to a fine level.

The primary purpose of phpBB is to facilitate posts exchange between users. It uses a flat topic and post structure: this means that each new post reply is appended at the end and nidification is avoided. phpBB allows multiple attachments to share media/files with other users. Types and size of these files allowed can be configured in its administrative panel (ACP). It also supports emoticons, leavin the option customizing smiles.

phpBB also offers polling feature to let users call for vote for topics. Multiple polling options as well as time limits can be set. Users can be allowed or disallowed to change their vote at a later time.

Individual forum are organized inside categories, which are something like containers including a logical topics organization.

Please refer phpBB features page to get more info about.

As said, I’ll use a Raspberry PI Zero W, but this process applies to all Raspberry PI computer boards.

What We Need

As usual, I suggest adding from now to your favorite e-commerce shopping cart all needed hardware, so that at the end you will be able to evaluate overall costs and decide if continuing with the project or removing them from the shopping cart. So, hardware will be only:

Check hardware prices with following links:

Amazon raspberry pi boards box
Amazon raspberry pi Zero W box
Amazon Micro SD box
Amazon Raspberry PI Power Supply box

Step-by-Step Procedure

Before starting with installation steps, let’s check what are phpBB software requirements:

  • A webserver or web hosting account running on any major Operating System with support for PHP
  • A SQL database system, one of:
    • MySQL
    • MariaDB (we’ll use this option)
    • MS SQL Server
    • Oracle
    • PostgreSQL
    • SQLite
    • PHP with support for the database you intend to use.
  • getimagesize() function enabled (included in default php installation)
  • The following PHP modules are required:
    • json (included in default php installation)
    • mbstring
    • XML support
  • Corresponding PHP module for the database system you intend to use
  • The following PHP modules are optional, but will provide access to additional features.
    • zlib Compression support (included in default php installation)
    • Remote FTP support (included in default php installation)
    • GD support

Prepare Operating System

Start installing OS. You should opt for installing Raspberry PI OS Lite (for a fast, headless operating system) or you can also use Raspberry PI OS Desktop (in this case working from its internal terminal). If you opt for Desktop version, you could need a more performing computer board than Zero W.

Make your OS up to date:

sudo apt update -y && sudo apt upgrade -y

Install Required Packages

Install Apache, php and MariaDB database with LAMP setup tutorial (phpmyadmin is optional). After this step, install addictional required packages to run phpBB on Raspberry PI:

sudo apt install php7.3-mbstring php7.3-xml php7.3-gd -y

Restart Apache service to get new packages active:

sudo systemctl restart apache2.service

Create your database space and credential to let phpBB connect your DB. If you still don’t changed root password, after first command it will be empty. I anyway strongly suggest to change root password. Also use your favourite database name, user and password instead of tutorial “phpBBDB”, “phpBBUser” and “phpBBPassword”. From terminal:

sudo mysql -uroot -p
create database phpBBDB;
create user phpBBUser@'%' identified by 'phpBBPassword';
grant all privileges on phpBBDB.* to phpBBUser@'%';
flush privileges;
quit

Get phpBB installation package. You should get latest version link from phpBB download page and use that link with wget terminal command. At the time of this article, latest version is 3.3.3:

wget https://download.phpbb.com/pub/release/3.3/3.3.3/phpBB-3.3.3.zip

Unzip downloaded package directy in Apache web root:

sudo unzip phpBB-3.3.3.zip -d /var/www/html/

You also need to change web permissions, so that Apache user (“www-data”) can manage files:

cd /var/www/html/
sudo chown -R www-data:www-data ./ 

Exctracted data will be uncompressed with their main folder. We probably want to execute phpBB at root path in our Apache server. Following commands will move all phpBB files to Apache root directory:

sudo rm index.html # remove old index.html apache template
sudo mv phpBB3/* ./
sudo mv phpBB3/.[!.]* ./ # required to move also hidden files
sudo rmdir phpBB3/

Install phpBB

From here, next tasks will use your favourite browser. In this paragraph I will use my Raspberry PI local IP address (192.168.1.78), please use your IP instead. If you want to use a free domain, you could be interested in my No-IP setup tutorial.

Browse http://192.168.1.78/ url:

phpBB install introduction

Move to install tab as in following picture:

phpBB install welcome tab

Scroll down this page and click Install button at the bottom.

All requirements check should be ok, so next screen should directly redirect to Administration configuration. Fill next form with your favourite credentials, which you will use to login in phpBB administration dashboard:

phpBB install admin config

Click submit. Next screen will require info to connect MariaDB internal database. Fill similarly to following picture, using your database credential set before, instead of tutorial ones:

phpBB install database config

Click Submit button. Next screen will allow, if needed, for addictional server configurations:

phpBB install server config

You can edit according to your needs or leave default ones and click Submit button.

Next screen will allow you to configure email settings to get your server able to send emails. You can use your favourite email provider or leave empty and configure later:

phpBB install email config

Then, click Submit. Final installation screen will allow you to configure your forum appearance, by changing title and description according to your preferences:

phpBB install title config

Click submit and wait for installation to be completed:

phpBB install finished successfully

Before moving to admin dashboard, we need to remove install folder from apache server. You can both remove this folder or rename it. Last case will be done with following terminal command from our Raspberry PI:

sudo mv install/ install_old/

Finally, back to browser go to home page http://192.168.1.78:

phpBB home

Your phpBB forum on Raspberry PI is ready and live!

Create Your Very First Category

A small note useful for people approacing for first time to phpBB forums. From logical point of view, you can imagine your site organized in Categories, which cointain Forums, which contain Topics.

To create and view categories, you will need to create at least one forum inside the new category and set correct permissions. Deeper info are available from official phpBB user guide (you can download it from phpBB documentation page). In this paragraph I will shortly show you how to create a generic category.

Identify in your home ACP link to go on administrative dashboard:

phpBB home ACP link

Use that link to reach administartive panel:

phpBB ACP General tab

Move to “FORUMS” tab:

phpBB ACP Forums tab

Click “Create new forum” button at bottom right. In next screen I changed “Forum type” option from default “Forum” to “Category”. I also added example values in Forum name and Description. “Copy permission from” field also allows to copy permissions from an existing forum. I left to default (“Do not copy permissions”) to set my very first category permissions manually:

phpBB ACP new category

Click submit. Next screen will redirect to permission settings. For the moment I will manage permissions for aministrators, registered users and newly registered users. You can select multiple groups in right bottom area with CTRL keyboard key:

phpBB ACP Forums permissions

Then click “Add permissions” button under the selected area. In next window you can set what each goup can do or not in this category. For tutorial purposes, I’m going to give full access to selected groups:

phpBB ACP Forums permissions details

Click “Apply all permissions” button. Grants will be updated and you will be redirected to previous permissions page.

At this point, phpBB has created our category, but it is still not visible because it is empty. We need to create at least one forum inside this category to get it available on main board. Identify from left bar the Manage forums link to go back in Forums administration board:

phpBB ACP manage Forums link

and repeat same steps, caring to create a forum instead of a category and placing it inside the category created before. This time, I will reuse parent category permissions. Please remember also to set forum name:

phpBB ACP new child forum_3

Scroll down and click “Submit” button.

In top part of Administration panel you will ever have a link to go back in phpBB home page:

phpBB ACP board index link

Use this link to go back in your forum home page. The new category is now live, including our new forum:

phpBB home with new category

Entering the forum, it will be ready to get your new topics, as “new topic” button is enabled:

phpBB home with new topic enabled

Enjoy your phpBB forum on Raspberry PI!

How useful was this post?

Click on a star to rate it anonymously!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept the Privacy Policy