How to Install phpBB with Apache on an Ubuntu 18.04 VPS or Dedicated Server

PhpBB is an acronym for PHP Bulletin Board. It is a cloud-based software application that powers most popular discussion forums on the internet.

The open-source application is highly customizable with thousands of styles and image packages. PhpBB is widely supported by developers who maintain an extensive database of different extensions to offer great functionality.

If you want to stay in touch with a group of people, phpBB is the best bulletin board software because its easy to use and maintain.

In this guide, we will show you how to setup phpBB with Apache on your Ubuntu 18.04 VPS.

Prerequisites

  • A VPS plan running Ubuntu 16.04 VPS server
  • A non-root user with sudo privileges

Step 1: Installing Apache Web Server

phpBB requires a web server to run. We are going to install Apache web server because it is fast, secure and reliable. Before you do this, first update the Ubuntu package repositories:

$ sudo apt-get update

Then install Apache web server by running the command below:

$ sudo apt-get install apache2

Press Y and hit Enter when prompted to confirm the installation

Step 2: Installing MySQL Server

phpBB  relies on MySQL/MariaDb server for data storage. In this guide, we are going to install MySQL server using the command below:

$ sudo apt-get install mysql-server

The MySQL secure installation utility is going to take you through a series of questions. Enter the response as shown below:

Setup VALIDATE PASSWORD plugin? [Y/N] Y
Password Validation Policy Level: 2
Root Password: Enter password here
Re-enter password: Repeat password here
Continue with the Password provided? Y
Remove anonymous users? [Y/N] Y
Disallow root login remotely? [Y/N] Y
Remove test database and access to it? [Y/N] Y
Reload privilege tables now? [Y/N] Y

You should get a success message at the end.

Step 3: Creating phpBB Database and User

Your MySQL installation is now set up and secure. Log in to the server and create a database and a user for the phpBB software.

To log in, run the command below:

$ sudo mysql -uroot -p

You will be prompted to key in the root password of the MySQL server. Then, hit Enter to continue

Once the MySQL command line prompt appears, run the SQL command below to create phpBB database:

mysql> Create database phpbb CHARACTER SET utf8 COLLATE utf8_general_ci;

The database will be accessed via a privileged user. To create one, run the command below:

mysql>  Create user  'phpbb_user'@'localhost' IDENTIFIED BY 'PASSWORD';

Replace ‘PASSWORD’ with a strong value.

Then, grant all privileges on the ‘phpbb’ database to ‘phbb_user’ using the command below:

mysql> Grant all privileges on phpbb.* to  'phpbb_user'@'localhost';

Then, reload MySQL privileges for the changes to take effect

mysql> flush privileges;

Exit from MySQL command line tool:

mysql> exit;

Step 4: Installing PHP

phpBB is written in PHP and we need to install this general purpose programming language on our server in order for the source files to be executed correctly.

Run the command below to install PHP:

$ sudo apt-get install php

Press Y and hit Enter when prompted to confirm the installation

We also need to run the command below to install all PHP module that phpBB requires to run in our server environment:

$ sudo apt-get install libapache2-mod-php php-curl php-json php-cgi php-xml php-mysql

Press Y and hit Enter to continue.

Restart Apache web server

$ sudo service apache2 restart

Step 5: Installing phpBB software

Our server environment is ready to run phpBB. We can now go ahead and download the bulletin board software using Linux wget command.

First, navigate to the /tmp folder directory using the CD command:

$ cd /tmp

Then, use wget to download the latest versions as shown below:

$ wget https://www.phpbb.com/files/release/phpBB-3.2.2.zip

The latest version by the time of writing this guide was phpBB 3.2.2. You can always check if there is a newer version on the official download page (https://www.phpbb.com/downloads/)

Once the download is completed, you will have an archive file on the tmp directory named ‘phpBB-3.2.2.zip’.

We will unzip this file and send the contents to the root of the web server. First, we need to install the unzip utility:

$ sudo apt-get install unzip

Then, use the unzip command to unpack the archive file

$ sudo unzip phpBB-3.2.2.zip

The files will be unzipped to a directory named phpBB3. We can now copy those files to the root of our website:

$ sudo cp -R phpBB3/* /var/www/html

We also need to remove the default Apache file so that it does not interfere with our files;

$ sudo rm /var/www/html/index.html

Step 6: Setting phpBB File Permissions

Since Apache web server runs under the username and group www-data, we need to give it the appropriate file permissions using the commands below:

$ sudo chown -R www-data:www-data /var/www/html/
$ sudo chmod 660 /var/www/html/images/avatars/upload
$ sudo chmod 660 /var/www/html/config.php
$ sudo chmod 770 /var/www/html/store/
$ sudo chmod 770 /var/www/html/cache
$ sudo chmod 770 /var/www/html/files

Step 7: Running phpBB Setup Wizard

On a web browser, enter the domain name or public IP address followed by /install to finalize the setup.

http://ip_address/install

On the screen that appears, click Install

Then, hit Install at the bottom of the  next screen:

Enter the administrator details and hit Submit on the next screen.

On the next screen, you will be prompted to enter the database details that you created above as shown on the below image. Use localhost for the server name and leave the port field intact. Hit Submit when you are done.

The next step will allow you to setup SSL features and domain name. Then, click Submit.

An SMTP server can be setup in the next screen. You can leave the details intact if you don’t want to setup email functionalities on your installation.

Select your language on the next screen, enter the title of your Bulletin Board and write a brief description to continue.

Remove the installation files:

$ sudo rm -r /var/www/html/install

Step 8: Checking the Installation

In a web browser, enter the IP address or domain name associated with your VPS. You should see a web page similar to the one shown below

http://ip_address_or_domain_name

Conclusion

In this guide, we covered the steps for installing phpBB on Ubuntu 18.04 server. We have set up a web server, MySQL and PHP. We have also covered the steps of downloading phpBB from the official website. Once you have finalized the installation by following the steps above, you can start promoting your bulletin board and invite members to start discussions.

 

Check out these top 3 Dedicated server hosting services:

Was this article helpful?