Log inSign up

A phpBB forum on a small Linux server

phpBB 3.3 runs on Nginx, PHP-FPM and MariaDB with a handful of PHP extensions. Download the release zip, give the web server write access to config.php and four data folders, run the web installer at /install, then delete the install folder, add HTTPS and point board email at an SMTP relay on port 587.

Topic: Websites, CMS and shops · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What do you need for phpBB?

phpBB is light: a forum with a few hundred active members runs comfortably on 1 to 2 GB of RAM. The stack is the classic one:

  • Ubuntu 24.04 or 22.04, Debian 12 or 13.
  • Nginx and PHP-FPM with the mysql, xml, mbstring, gd, zip and intl extensions.
  • MariaDB (MySQL and PostgreSQL also work).
  • A domain such as forum.example.net pointing at the server.

phpBB 3.3 supports PHP from 7.2 through the 8.x series; read the notes of the release you download to confirm it covers the PHP version your distribution ships, which is 8.4 on Debian 13.

How do you install the server packages?

Install everything from the distribution repositories and open the web ports.

sudo apt update
sudo apt install -y nginx mariadb-server php-fpm php-mysql php-xml php-mbstring \
  php-gd php-zip php-intl php-curl unzip
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
php -v
ls /run/php/

Note the FPM socket name from the last command, such as php8.3-fpm.sock on Ubuntu 24.04 or php8.2-fpm.sock on Debian 12. The LEMP stack guide explains each component if you are new to this setup.

How do you create the forum database?

Run the MariaDB hardening script, then make a database and a local-only user for the board.

sudo mariadb-secure-installation
sudo mariadb -e "CREATE DATABASE phpbb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mariadb -e "CREATE USER 'phpbbuser'@'localhost' IDENTIFIED BY 'forum-db-password';"
sudo mariadb -e "GRANT ALL PRIVILEGES ON phpbb.* TO 'phpbbuser'@'localhost'; FLUSH PRIVILEGES;"
mariadb -u phpbbuser -p -e "SHOW DATABASES;"

The last command should list phpbb after you type the password, which proves the credentials work before the installer asks for them.

How do you download phpBB and set permissions?

Get the full package from the official phpBB downloads page; the version below is an example, so substitute the latest 3.3 release number.

PHPBB_VER=3.3.15
cd /tmp
wget https://download.phpbb.com/pub/release/3.3/$PHPBB_VER/phpBB-$PHPBB_VER.zip
unzip -q phpBB-$PHPBB_VER.zip
sudo mv phpBB3 /var/www/forum.example.net
cd /var/www/forum.example.net
sudo chown -R root:www-data .
sudo find . -type d -exec chmod 750 {} +
sudo find . -type f -exec chmod 640 {} +
sudo chown www-data config.php
sudo chown -R www-data cache store files images/avatars/upload

Only config.php and the four data folders need to be writable by PHP; everything else stays read-only to the web server, which limits the damage a vulnerable extension could do.

What Nginx configuration does phpBB need?

phpBB routes friendly URLs through app.php and keeps several folders that must never be fetched directly. Save this as /etc/nginx/sites-available/forum.example.net:

server {
    listen 80;
    listen [::]:80;
    server_name forum.example.net;
    root /var/www/forum.example.net;
    index index.php;
    client_max_body_size 16m;

    location / {
        try_files $uri $uri/ @rewriteapp;
    }

    location @rewriteapp {
        rewrite ^(.*)$ /app.php/$1 last;
    }

    location ~ ^/(config\.php|common\.php|cache|files|images/avatars/upload|includes|phpbb|store|vendor) {
        deny all;
        return 404;
    }

    location ~ \.php(/|$) {
        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        try_files $fastcgi_script_name =404;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }

    location ~ /\.(ht|git|svn) { deny all; }
}
sudo ln -s /etc/nginx/sites-available/forum.example.net /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d forum.example.net

The phpBB package also ships a sample Nginx file under docs/, which is worth comparing with when you upgrade.

How do you run the installer and lock it down?

Visit https://forum.example.net/install/, choose Install, and enter the admin account, the database details (host localhost, user phpbbuser, database phpbb), and the server settings. Keep the table prefix phpbb_ unless you share the database. For email, choose SMTP and enter your relay details on port 587; you can also set this later.

When the installer reports success, remove the install folder and lock config.php:

cd /var/www/forum.example.net
sudo rm -rf install
sudo chown root:www-data config.php
sudo chmod 640 config.php
curl -I https://forum.example.net

The board refuses to leave maintenance until the install folder is gone, so this step is required, not optional.

How do you keep spam and abuse under control?

Public forums attract automated sign-ups within days. Combine several of phpBB's built-in tools in the Administration Control Panel:

  • Enable a CAPTCHA plugin or the Q&A plugin with questions only real visitors can answer.
  • Require email activation of new accounts, which needs working outgoing mail.
  • Put new members in the Newly registered users group so their first posts are moderated.
  • Ban repeat offenders by email domain or IP under Users and Groups.

At the server level, fail2ban and Nginx rate limiting slow down scripted login attempts. Board email depends on an SMTP relay; outgoing port 25 should not be assumed open, and support can answer questions about it by ticket.

How do you update and back up the forum?

Back up first, then use the official update package or full package following the update instructions bundled with the release.

sudo mariadb-dump --single-transaction phpbb | gzip > ~/phpbb-$(date +%F).sql.gz
sudo tar -czf ~/phpbb-files-$(date +%F).tar.gz -C /var/www forum.example.net

For a minor 3.3 update, disable extensions you are unsure about, replace the code files except config.php, files, store, images and ext, run the database updater at /install/app.php/update, and delete install again. Purge the cache from the ACP afterwards. Copy the backups off the server with the methods in the daily backups tutorial.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-1a small hobby board1 vCPU, 1 GB RAM, 25 GB NVMe$3.60/mo$43.20 for 12 months
A1-2a growing community1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4larger boards with heavy search2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about phpBB forum

How much RAM does a phpBB forum need?

A small or medium board runs well on 1 to 2 GB, since phpBB is lightweight. Add memory when MariaDB starts swapping or search indexing grows large.

Why do I get a 404 on pages like /viewforum.php/something?

PHP is not receiving path info. Check that the fastcgi_split_path_info and PATH_INFO lines are in the PHP location block.

Can I move an existing phpBB board to this server?

Yes. Copy the files and a database dump, import the dump, adjust config.php with the new database details, and purge the cache folder.

Do I have to delete the install folder?

Yes. phpBB keeps the board disabled until it is removed, and leaving it would let anyone rerun parts of the installer.

Which database should I choose in the installer?

MySQL with MySQLi covers MariaDB. Pick it, enter localhost as the host and the credentials you created earlier.