How to Install and Configure miniBB Forum on Ubuntu 26.04 LTS
Install the lightweight miniBB forum on Ubuntu 26.04 LTS with Apache, PHP and MariaDB, then secure the admin panel and remove the installer.
miniBB (Mini Bulletin Board) is a small PHP forum script that stores everything in MySQL or MariaDB and suits communities that do not need the weight of a full forum suite. This guide installs the current miniBB 3.8 package on Ubuntu 26.04 LTS with Apache, PHP and MariaDB. The same commands work on Ubuntu 24.04 LTS; only the PHP version the distribution ships differs, and miniBB runs on any current PHP 8 release.
At the end you will have a working forum on its own virtual host, an administrator account, and the installer files removed.
Requirements
- An Ubuntu 26.04 or 24.04 server and a user with
sudorights (the examples usedeploy). - A DNS record such as
forum.example.compointing to the server. One copy of miniBB serves one domain. - Ports 80 and 443 open in your firewall.
miniBB itself needs PHP with the mysqli extension, GD (for the CAPTCHA) and, for UTF-8 forums, the multibyte string extension. It officially supports MySQL and compatible forks such as MariaDB; Apache is the preferred web server.
Step 1: Install Apache, PHP and MariaDB
Update the package index and install the stack with the extensions miniBB uses:
sudo apt update
sudo apt install apache2 libapache2-mod-php php-mysql php-gd php-mbstring mariadb-server unzip
Both services start automatically. Confirm that they are running:
systemctl is-active apache2 mariadb
Step 2: Create the database
On Ubuntu the MariaDB root account authenticates through the system socket, so open the client with sudo:
sudo mariadb
Create a UTF-8 database and a dedicated account. Replace the password with your own:
CREATE DATABASE minibb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'minibbuser'@'localhost' IDENTIFIED BY 'choose-a-strong-password';
GRANT ALL PRIVILEGES ON minibb.* TO 'minibbuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 3: Download and unpack miniBB
The current package is published on the miniBB download page. Fetch it and unpack it into a temporary directory first, so you can see how the archive is laid out:
cd /tmp
wget -O minibb.zip "https://www.minibb.com/download.php?file=minibb"
unzip -q minibb.zip -d /tmp/minibb-src
ls /tmp/minibb-src
You are looking for the directory that contains index.php, setup_options.php and _install.php. If ls shows those files directly, copy the directory as it is; if it shows a single sub-folder, copy the contents of that sub-folder instead. Keep the folder structure (img, lang, templates) intact.
sudo mkdir -p /var/www/minibb
sudo cp -a /tmp/minibb-src/. /var/www/minibb/ # or /tmp/minibb-src/SUBFOLDER/.
sudo chown -R www-data:www-data /var/www/minibb
The archive also contains README.txt with the project's own installation notes; read it once, because it describes changes specific to the release you downloaded.
Step 4: Edit setup_options.php
All miniBB settings live in one file. Open it:
sudo nano /var/www/minibb/setup_options.php
Set at least the following variables, which already exist in the file:
$DBhost='localhost';
$DBname='minibb';
$DBusr='minibbuser';
$DBpwd='choose-a-strong-password';
$admin_usr='forumadmin';
$admin_pwd='another-strong-password';
$admin_email='admin@example.com';
$main_url='https://forum.example.com';
$cookiesecure=TRUE;
$main_urlhas no trailing slash and must use exactly the host name visitors use, because the login cookie depends on it.- Set
$cookiesecuretoTRUEonly when the forum is served over HTTPS (Step 6). Leave itFALSEwhile you test over plain HTTP. - Do not reuse a well-known administrator name such as
admin.
The administrator panel is reached through bb_admin.php. miniBB recommends giving that file a name nobody can guess and recording the new name in $bb_admin, which must end with a question mark:
sudo mv /var/www/minibb/bb_admin.php /var/www/minibb/panel_k7x2q.php
$bb_admin='panel_k7x2q.php?';
Step 5: Configure the Apache virtual host
Create a site file:
sudo nano /etc/apache2/sites-available/minibb.conf
<VirtualHost *:80>
ServerName forum.example.com
DocumentRoot /var/www/minibb
<Directory /var/www/minibb>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/minibb_error.log
CustomLog ${APACHE_LOG_DIR}/minibb_access.log combined
</VirtualHost>
Enable the site and the rewrite module (needed only if you later switch on miniBB's friendly URLs), test the configuration and reload Apache:
sudo a2ensite minibb.conf
sudo a2enmod rewrite
sudo apache2ctl configtest
sudo systemctl reload apache2
Step 6: Add HTTPS
A forum handles logins, so serve it over TLS. With Let's Encrypt:
sudo apt install certbot python3-certbot-apache
sudo certbot --apache -d forum.example.com
Certbot creates the HTTPS virtual host and a renewal timer. Afterwards make sure $main_url starts with https:// and $cookiesecure is TRUE.
Step 7: Run the installer
Open https://forum.example.com/_install.php in a browser. The script checks the server, creates the tables in the minibb database and creates the administrator account from the values in setup_options.php.
When it reports success, remove the installer and the SQL schema files so nobody can run them again:
cd /var/www/minibb
sudo rm -f _install.php _install_mysql.sql _install_mysql_utf8mb4.sql
Verify the forum
- Open
https://forum.example.com/. You should see an empty forum index. - Log in with the administrator name and password from
setup_options.php. - Open
https://forum.example.com/panel_k7x2q.php(your own file name) and create the first forum section.
If the page stays blank, look at the Apache error log:
sudo tail -n 30 /var/log/apache2/minibb_error.log
A database error on the first page nearly always means that $DBname, $DBusr or $DBpwd does not match what you created in Step 2.
Maintenance
- Backups: the forum is the
minibbdatabase plus the files in/var/www/minibb. Dump the database regularly withsudo mariadb-dump minibb > minibb.sqland keep a copy ofsetup_options.php. - Upgrades: new miniBB releases are installed by replacing the script files while keeping your
setup_options.php, templates and language edits. Follow the upgrade section of the official manual for the version you are moving from. - Tightening permissions: in its basic mode miniBB does not need to write to its own directory, so you can return ownership of the files to
rootand leave them readable bywww-data. Add-ons that store uploads document which folders they need writable.
The complete option reference is in the miniBB manual, and the system requirements are listed on the requirements page.
Frequently asked questions
Can I run miniBB with Nginx instead of Apache?
Yes. The project lists Nginx and Lighttpd as suitable servers. The forum itself only needs PHP; the one feature tied to Apache is the friendly-URL mode, which relies on .htaccess rewrite rules that you would have to translate into Nginx configuration yourself.
Is it safe to leave the administrator password in setup_options.php?
The file is PHP, so the web server never sends its contents to a browser, but anyone who can read the directory on the server can read the password. Keep the file readable only by root and the web server user, use a password you use nowhere else, and rename the admin panel file as shown above.
Which character set should the database use?
Use utf8mb4. miniBB supports it on MySQL 5.5.3 and later and on MariaDB, and it is the only MySQL character set that stores every Unicode character, including emoji, without errors.
Can several forums share one miniBB installation?
No. Each forum is a separate copy of the script with its own setup_options.php. Copies can share one database if you give each copy different table names in that file.