- Log into the Debian device
- Run the following commands in a terminal:
# update repositories and install any available software updates
sudo apt update
sudo apt upgrade -y
# install Apache HTTPD and MySQL
sudo apt-get install apache2 mariadb-server mariadb-client curl
# install PHP components
sudo apt install php php-mysql php-cli php-json php-opcache php-gd php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the phpbb database and database user
CREATE DATABASE phpbb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON phpbb.* TO 'phpbb_rw'@'localhost' IDENTIFIED BY '!!phpBB##';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands to download and extract phpBB in the Apache webroot
# download latest phpbb version
sudo wget -O phpbb.tar.gz https://download.phpbb.com/pub/release/3.3/3.3.2/phpBB-3.3.2.tar.bz2
# extract phpbb.tar.gz
sudo tar xvf phpbb.tar.gz --directory /var/www
# rename phpbb folder
sudo mv /var/www/phpBB* /var/www/phpbb
# create a new phpbb.conf file to configure the site
sudo nano /etc/apache2/sites-available/phpbb.conf - Paste the following configuration into phpbb.conf
Alias /phpbb "/var/www/phpbb/"
<Directory /var/www/phpbb/>
AllowOverride All
</Directory> - Press CTRL+O, Enter, CTRL+X to write the changes to phpbb.conf
- Continue with the following commands to enable the site and restart Apache:
# enable the phpbb site and required PHP modules
sudo a2ensite phpbb
sudo a2enmod rewrite
# set the owner of the new phpbb directory to www-data
sudo chown -R www-data:www-data /var/www/phpbb
# restart apache2 service
sudo systemctl restart apache2 - Open a web browser and navigate to http://DNSorIP/phpbb
- Input an administrator username, email address and password > Click Submit
- Enter the database hostname, username, password and database name > Click Submit
- Click the Submit button on the Server configuration page
- Click the Submit button on the E-mail configuration page
- Enter a title and short description on the Bulletin board configuration page > Click Submit
- When the installation completes run the following command in terminal to delete the /install directory
sudo rm /var/www/phpbb/install -r - In a web browser, navigate to http://DNSorIP/phpbb
- Welcome to your very own, self-hosted forum with phpBB