phpBB is an open-source forum application for building discussion communities — user registration, moderation, permissions, and multiple boards in one interface. This guide deploys phpBB on Ubuntu 22.04 with an external MySQL database, an Apache virtual host, and Let's Encrypt TLS.
Prerequisites: an Ubuntu 22.04 server with the LAMP stack installed, non-root sudo user, an external MySQL database, a subdomain A record (e.g.
phpbb.example.com).
Create the Database
$ mysql -h your-db-host -P 3306 -u dbadmin -p
mysql> CREATE DATABASE phpbbdb;
mysql> USE phpbbdb;
mysql> CREATE USER 'phpbbuser'@'localhost' IDENTIFIED BY 'securepassword';
mysql> GRANT ALL ON phpbbdb.* to 'phpbbuser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
Install phpBB
1. Install PHP modules:
$ sudo apt install php-mysql php-xml php-mbstring -y
2. Download and extract — check the releases page for the current version:
$ wget -O phpbb.zip https://download.phpbb.com/pub/release/3.3/3.3.11/phpBB-3.3.11.zip
$ unzip phpbb.zip
$ sudo mv phpBB3 /var/www/html/phpbb
3. Set ownership and permissions:
$ sudo chown -R www-data:www-data /var/www/html/phpbb
$ sudo find /var/www/html/phpbb -type d -exec chmod 755 {} \;
$ sudo find /var/www/html/phpbb -type f -exec chmod 644 {} \;
Configure Apache
$ sudo nano /etc/apache2/sites-available/phpbb.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/phpbb
ServerName phpbb.example.com
<Directory /var/www/html/phpbb>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/phpbb_error.log
CustomLog ${APACHE_LOG_DIR}/phpbb_access.log combined
</VirtualHost>
$ sudo a2ensite phpbb
$ sudo a2enmod rewrite
$ sudo systemctl restart apache2
Secure phpBB
1. Firewall:
$ sudo ufw status
$ sudo ufw allow 22 && sudo ufw enable
$ sudo ufw allow 80/tcp
$ sudo ufw allow 443/tcp
$ sudo ufw reload
2. TLS via Let's Encrypt:
$ sudo apt install snapd -y
$ sudo snap install --classic certbot
$ sudo certbot --apache --redirect -d phpbb.example.com -m username@example.com --agree-tos
$ sudo certbot renew --dry-run
Run the Web Installer
Visit https://phpbb.example.com, click INSTALL:
- Verify system requirements, click Install.
- Enter admin username, email, password, click Submit.
- Keep MYSQL as the database type; enter your DB hostname, port, database, user, and password, click Submit.
- Enable Force server URL with
https, confirm your domain, click Submit. - Enable or skip SMTP settings.
- Set forum language, board title, and description, click Submit.
- Click Take me to the ACP to reach the control panel.
Create a Forum
- In the ACP, go to Forums → Create new forum.
- Set name, description, password, style, and posting rules.
- Adjust advanced options as needed, click Submit.
- Set user/group permissions, click Add Permissions.
- Check Manage forums to confirm it's live, then visit your domain to see the public board.
Next Steps
phpBB is running with TLS and at least one forum configured. From here:
- Install additional styles/extensions from the phpBB extension database
- Configure SMTP so registration and notification emails actually send
- Set up scheduled database backups given forum data lives in MySQL
For the full guide, visit the original article on Vultr Docs.
Top comments (0)