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.


  • 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:

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

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 (

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

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

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.


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



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:

$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
  • Support
  • Features
  • Reliability
  • Pricing
$1.00 /mo
Starting price
Rating based on expert review
  • User Friendly
  • Support
  • Features
  • Reliability
  • Pricing
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
  • Support
  • Features
  • Reliability
  • Pricing

How to Install Own Cloud On an an Ubuntu 18.04 Dedicated Server or VPS

You can create your own self-hosted cloud storage services by installing the ope
3 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to install OpenLiteSpeed on an Ubuntu 18.04 VPS or Dedicated Server

OpenLiteSpeed is an open source web server characterized by high-performance, li
3 min read
Kennedy Mbuvi
Kennedy Mbuvi

How to Install a Let’s Encrypt Certificate on your Ubuntu 18.04 Dedicated Server or VPS

If you are hosting your website on a VPS server running Ubuntu 18.04, we will sh
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Enable Two-Factor Authentication on an Ubuntu 18.04 VPS or Dedicated Server

This guide will show you how you enable two-factor authentication to improve the
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top