Install FluxBB on a CentOS 7 VPS with Nginx and PHP-FPM

install-fluxbb-on-a-centos-7-vps-with-nginx-and-php-fpmIn this tutorial, we will show you how to install FluxBB on a CentOS 7 VPS with Nginx, MariaDB and PHP-FPM. FluxBB is blazing fast and open source forum application written in PHP. Some of the main features of FluxBB are: clean admin interface, flexible permission system, easy to use, blazing fast speed and powerful moderator tools. This guide should work on other Linux VPS systems as well but was tested and written for a CentOS 7 VPS.

Update the system and install the necessary packages.

[email protected]:~# yum -y update
[email protected]:~# yum install unzip wget

Install MariaDB and create a database.

To install a MariaDB server run the following command:

[email protected]:~# yum install mariadb-server mariadb

start the service and enable it at boot time:

[email protected]:~# systemctl start mariadb.service
[email protected]:~# systemctl enable mariadb.service

It is very important to secure your MariaDB server, run the following script before creating and populating the databases.


Once you are finished with the step above, login as the MariaDB root user and create a new database and user:

[email protected]:~# mysql -uroot -p
MariaDB [(none)]>> create database fluxbb;
MariaDB [(none)]>> GRANT ALL PRIVILEGES ON fluxbb.* TO 'fluxbb'@'localhost' IDENTIFIED BY 'fluxbbPassword';
MariaDB [(none)]>> flush privileges;
MariaDB [(none)]>> \q;

Download and unzip FluxBB

At the time of this writing the latest stable version of FluxBB is version 1.5.7. The following commands will create a root directory for your forum and download and extract the FluxBB zip file.

[email protected]:~# mkdir -p /var/www/html/
[email protected]:~# cd /var/www/html/
[email protected]:~# wget
[email protected]:~# unzip
[email protected]:~# mv fluxbb-1.5.7/* .
[email protected]:~# rm -rf fluxbb-1.5.7*

Install and configure PHP and Nginx

Installing PHP and Nginx is pretty easy, just run the following command:

[email protected]:~# yum install nginx php-fpm php-cli php-mysqlnd php-mbstring php-gd php-curl php-pdo
[email protected]:~# systemctl start php-fpm.service
[email protected]:~# systemctl enable php-fpm.service
[email protected]:~# systemctl start nginx.service 
[email protected]:~# systemctl enable nginx.service

To change PHP-FPM to listen on a unix socket, open the default www pool

[email protected]:~# vim /etc/php-fpm.d/www.conf

and change from

listen =


listen = /var/run/php-fpm/php-fpm.socket

and restart the service for changes to take effect

[email protected]:~# systemctl restart php-fpm

Create a php session directory and change the ownership to apache (the user under which PHP runs).

[email protected]:~# mkdir /var/lib/php/session
[email protected]:~# chown apache:apache /var/lib/php/session

Create a new Nginx server block with the following content:

[email protected]:~# cat <<'EOF' >> /etc/nginx/conf.d/
server {
    listen 80;
    root /var/www/html/;
    access_log /var/log/nginx/;
    error_log /var/log/nginx/;
    index index.php;
    location / {
        try_files $uri $uri/ /rewrite.php?$args;

    location ~ /(cache|include|lang|plugins) {
       deny all;
       return 403;

    location ~ \.php$ {
        fastcgi_index index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_keep_conn on;
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.socket;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    location ~ /\.ht {
        deny all;


Test the Nginx configuration and restart the server by running the following commands:

[email protected]:~# nginx -t

[email protected]:~#  systemctl restart nginx

Set the correct permissions

[email protected]:~# chown -R apache:apache /var/www/html/

That’s it. Now open your browser, go to and follow the FluxBB installation wizard.

For more information, please check out the official FluxBB website.


Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to set this up 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.

Leave a Comment

To prove you are human please solve the following *