phpBB is an open source bulletin board forum software that provides a virtual space for discussion among the members of your website. It has a huge variety of features like flat topic structure, sub-forums, forum-specific styles, user groups, group-based permissions, database query and template caching, support for PHP 7, multiple database engines and much more. With phpBB’s extensive features you can create your own forum in a matter of minutes and what’s most important, it’s completely free.
In this tutorial, we will show you how to install phpBB on an Ubuntu 16.04 VPS.
Installing the LAMP stack
First login as root so we don’t have to type sudo in front of every command:
# sudo su
Make sure your packages are up to date:
# apt-get update
Now run this command to install the LAMP stack with PHP7:
# apt-get -y install apache2 mysql-server mysql-client libapache2-mod-php7.0 php7.0-mysql php7.0-gd imagemagick unzip
Creating a database for phpBB
Log in to the MySQL server:
Create a blank database for phpBB to use:
mysql> create database phpBB;
Create the database user, make sure to change the password randomgeneratedpassword with your own password.
mysql> create user 'phpBB_dbuser'@'localhost' identified by 'randomgeneratedpassword';
Grant all privileges to the user on the phpBB database:
mysql> grant all privileges on phpBB.* to 'phpBB_dbuser'@'localhost';
Apply the privileges we just gave to the user to the server:
mysql> flush privileges;
Change to Apache’s document root directory:
# cd /var/www/html
Delete Apache default files(You should skip this step if you have another site’s contents in this directory and install phpBB in a separate directory instead):
# rm -rf ./*
Download the latest phpBB version to your server(At the time of writing 3.2.0 is the latest version of phpBB):
# wget https://www.phpbb.com/files/release/phpBB-3.2.0.zip
Extract phpBB to the current directory:
# unzip phpBB-3.2.0.zip
Delete the archive file as we no longer need it:
# rm phpBB-3.2.0.zip
Move all the contents from the extracted directory to the current directory(Skip this step and the next step if you have another site’s contents in the /var/www/html directory):
# mv ./phpBB3/* .
Delete the empty phpBB3 directory:
# rm -rf ./phpBB3
Note: If you installed phpBB in a separate directory you can type in the following command if you want to rename the phpBB3 directory to something else like forum so phpBB would be accessible at http://yourdomain.com/forum:
# mv ./phpBB3 ./forum
Change the owner to the www-data user for all the files and sub-directories in /var/www/html:
# chown -R www-data:www-data /var/www/html/
If you installed phpBB in a separate directory make sure to change your working directory to that directory:
Note: Replace your_phpBB_directory with the directory you installed phpBB in.
Give appropriate permissions to the config file and the following directories:
# chmod 660 images/avatars/upload/ config.php # chmod 770 store/ cache/ files/
Completing the installation
Using your browser, go to http://yourdomain.com/install or if you installed phpBB in a separate directory http://yourdomain.com/your_phpBB_directory/install.
Click the INSTALL tab and then click the Install button.phpBB will ask you for credentials, be sure to substitute these credentials for your own:
Administrator username: admin Contact email address: [email protected] Administrator password: admin_test1234- Confirm administrator password: same as above
Click Submit when you are done.
Note: Make sure to use a secure password with at least 8 characters, 1 uppercase letter, 1 special character, and alphanumeric characters.
Now phpBB will ask you for details regarding your database, here’s our example:
Database Type: MySQL with MySQLi Extension Database server hostname or DSN: localhost Database server port: leave blank Database username: phpBB_dbuser Database password: randomgeneratedpassword Database name: phpBB Prefix for tables in database: phpbb_
Click Submit again.
In the next step, you should set up options according to your preference like providing your domain name or whether you would like to force SSL.After this step, you will be taken to the SMTP configuration page, if you don’t have an SMTP server you can leave this page as it is and click Submit to continue. Click Install again and wait for the installer to finish.When the installer finishes installing phpBB you can click the take me to the ACP link and set up your new phpBB installation.
That’s it, now you should have phpBB installed on your server.
Of course, you don’t have to do any of this if you use one of our Software Installation services, in which case you can simply ask our expert Linux admins to install phpBB for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.