BoxBilling on AlmaLinux 9 (Apache + MariaDB + PHP + SSL)
BoxBilling is a free, open-source billing and client management system designed for web hosting providers, freelancers, and digital businesses. It brings together invoicing, client management, product automation, domain registration, and support ticketing into one platform. Thanks to its plugin architecture and theme customization, BoxBilling can be extended and adapted to a wide range of business models.
Running BoxBilling on AlmaLinux 9 — a RHEL-compatible enterprise Linux distribution — ensures a secure, stable, and long-term supported environment. With SELinux enforcement, hardened libraries, systemd 252, and OpenSSL 3, AlmaLinux provides enterprise-grade reliability, making it an ideal operating system for financial applications and customer platforms.
Architecture Overview
Layer | Component | Role |
---|---|---|
OS | AlmaLinux 9 | Enterprise-grade RHEL-compatible base with SELinux |
Web Server | Apache HTTPD | Serves the PHP-based BoxBilling application |
Database | MariaDB/MySQL | Stores clients, invoices, orders, and financial data |
Runtime | PHP 8.x + Extensions | Executes BoxBilling application logic |
Reverse Proxy | Nginx (optional) | TLS termination, load balancing, caching |
TLS | Let’s Encrypt / PKI | Provides HTTPS encryption for admin and client areas |
Why Use BoxBilling?
- Complete automation – billing, product provisioning, invoicing, and notifications.
- Client and order management – centralized portal for customers, orders, and support tickets.
- Hosting integrations – domain registrars, hosting panels, and provisioning tools.
- Free & open-source – unlike WHMCS or Blesta, no recurring license fees.
- Multi-language & multi-currency – ready for global businesses.
BoxBilling vs Other Billing Platforms
Feature/Capability | BoxBilling (Free) | WHMCS (Paid) | Blesta (Paid) | ClientExec (Paid) |
---|---|---|---|---|
License cost | Free, open-source | Commercial license | Commercial license | Commercial license |
Core features | Billing, support, hosting | Full suite + marketplace | Billing + support | Billing + support |
Extensibility | Plugins + themes | Large ecosystem | Limited | Limited |
Target users | Freelancers, SMBs | Hosting providers | SMBs | SMBs |
BoxBilling is best for freelancers, startups, and small hosting companies who need billing automation without expensive licenses.
Security & Best Practices
- Deploy with HTTPS enabled using Let’s Encrypt or PKI certificates.
- Configure MariaDB securely with strong credentials and backups.
- Harden PHP configuration (disable insecure functions, set proper limits).
- Restrict admin access with firewall rules and SELinux policies.
- Keep BoxBilling, PHP, Apache, and AlmaLinux updated with security patches.
- Enable Fail2Ban or rate limiting to protect against brute-force attacks.
Typical Use Cases
- Hosting providers – manage domains, hosting packages, and client billing.
- Freelancers and agencies – automate invoicing and customer support.
- SaaS businesses – manage subscriptions and recurring billing.
- Educational/testing environments – explore billing automation without licensing costs.
Step 1: Set Up a Server Instance on Shape.Host
Before installing BoxBilling, you need a fresh AlmaLinux 9 server. Shape.Host makes this process quick and beginner-friendly:
Log in to your Shape.Host dashboard.
Click Create → Instance.

Choose a data center location close to your customers for better latency.

Select a hosting plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.
In the Operating System menu, select AlmaLinux 9 (64-bit).

Click Create Instance to finalize the setup.

Copy the server’s public IP from the Resources section to use in the next steps.

Step 2: Connect to Your Instance
- Linux/macOS:
ssh root@your_server_ip
This connects you securely to the server using SSH as the root user. - Windows (with PuTTY):
- Download PuTTY.
- Enter your server’s IP address, select SSH, and click Open.
- Log in with the root credentials from Shape.Host.
Step 3: Install and Configure BoxBilling on AlmaLinux 9
Below are the exact commands with explanations after each one.
Update the System
dnf update
Updates all system packages to their latest versions, ensuring security patches and bug fixes are applied before installing new software.

Install Apache Web Server
dnf install httpd
Installs the Apache web server (httpd) which will serve BoxBilling’s web pages.

systemctl enable --now httpd
Enables Apache to start at boot and starts it immediately.
Install MariaDB
dnf install mariadb-server mariadb
Installs MariaDB server and client packages, providing the database backend for BoxBilling.

systemctl enable --now mariadb
Starts MariaDB now and enables it to start automatically after a reboot.

Install EPEL Repository
dnf install epel-release
Adds the Extra Packages for Enterprise Linux (EPEL) repository, which provides additional software packages not in the default AlmaLinux repo.
Add Remi Repository for PHP 8.2
dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm

Installs the Remi repository, which contains updated PHP versions.
dnf module reset php
Resets any currently enabled PHP module so you can switch to a newer version.

dnf module enable php:remi-8.2
Enables PHP 8.2 from Remi repository — BoxBilling requires newer PHP versions.

Install PHP and Extensions
dnf install php php-cli php-mysqlnd php-curl php-mbstring php-xml php-gd php-zip php-imagick unzip wget
Installs PHP plus all the necessary extensions for BoxBilling. Also installs unzip
to extract files and wget
to download files from the web.

systemctl restart httpd
Restarts Apache to load the PHP module.
Secure MariaDB Installation
mysql_secure_installation
Guides you through securing MariaDB by setting a root password, removing test databases, and disallowing remote root logins.

Create Database and User
mysql -u root -p
Logs into MariaDB as the root user.
Inside the MySQL prompt, run:
CREATE DATABASE boxbilling_db;
Creates a database named boxbilling_db
for BoxBilling.
CREATE USER 'boxbilling_user'@'localhost' IDENTIFIED BY 'StrongPassword123!';
Creates a dedicated user for BoxBilling with a strong password.
GRANT ALL PRIVILEGES ON boxbilling_db.* TO 'boxbilling_user'@'localhost';
Gives the BoxBilling user full permissions on the BoxBilling database.
FLUSH PRIVILEGES;
EXIT;
Applies changes and exits MySQL.

Download and Extract BoxBilling
cd /var/www/html
Moves into Apache’s web root directory.
wget https://github.com/boxbilling/boxbilling/releases/latest/download/boxbilling.zip -O boxbilling.zip
Downloads the latest BoxBilling zip file from GitHub and saves it as boxbilling.zip
.

unzip boxbilling.zip -d boxbilling
Extracts the downloaded zip file into a new folder called boxbilling
.
chown -R apache:apache /var/www/html/boxbilling
Sets Apache as the owner of all BoxBilling files, ensuring the web server can access them.
chmod -R 755 /var/www/html/boxbilling
Sets proper permissions so files are readable and executable by the server.

Configure Apache Virtual Host
nano /etc/httpd/conf.d/boxbilling.conf
Opens a new Apache configuration file in the nano text editor.
Paste this:
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/boxbilling
<Directory /var/www/html/boxbilling>
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/boxbilling_error.log
CustomLog /var/log/httpd/boxbilling_access.log combined
</VirtualHost>
This tells Apache where BoxBilling is located and sets logs for debugging.

systemctl restart httpd
Restarts Apache to load the new virtual host.

Adjust PHP Settings
nano /etc/php.ini
Opens the PHP configuration file to adjust resource limits.
Change/add:
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Increases PHP memory and upload limits for smoother BoxBilling operation.
systemctl restart httpd
Restarts Apache to apply PHP changes.
Create Data Directories
mkdir -p /var/www/html/boxbilling/bb-data/cache
mkdir -p /var/www/html/boxbilling/bb-data/uploads
Creates cache and uploads directories required by BoxBilling.
chown -R apache:apache /var/www/html/boxbilling/bb-data
Makes Apache the owner of the new directories.
chmod -R 775 /var/www/html/boxbilling/bb-data
Sets permissions so Apache can write to these directories.

(Optional) Install SSL with Certbot
dnf install certbot python3-certbot-apache
Installs Certbot and the Apache plugin to enable free SSL certificates.

certbot --apache -d almalinux-tutorials.shape.host
Generates and installs SSL certificates for your domain(s). Replace with your own domain names.

Step 4: Verify Installation
Open your browser to:
http://yourdomain.com
or
https://yourdomain.com
After uploading the BoxBilling files to your AlmaLinux 9 server, open http://your-domain/install/install.php
in your browser. The installer will guide you through four quick steps:
Preparation – The wizard checks your AlmaLinux 9 PHP environment and required extensions. Tick the license agreement and click Next.

Database Configuration – Enter the database host, name, user and password you created earlier on AlmaLinux 9, then click Next to build the tables.

Administrator Account – Create your admin account by setting a username, email and strong password. Click Next to continue.

Finish – Once you see the success screen, remove the install
directory, set bb-config.php
to read-only (chmod 644), and configure the suggested cron job.

When you’re done, log in at http://your-domain/bb-admin
with your new administrator credentials.


You’ve installed BoxBilling on AlmaLinux 9 with all dependencies and configuration in place. This setup gives you a secure, scalable billing and client management platform.
For high-performance hosting with easy management, check out Shape.Host Cloud VPS — optimized for AlmaLinux and perfect for running BoxBilling.