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

LayerComponentRole
OSAlmaLinux 9Enterprise-grade RHEL-compatible base with SELinux
Web ServerApache HTTPDServes the PHP-based BoxBilling application
DatabaseMariaDB/MySQLStores clients, invoices, orders, and financial data
RuntimePHP 8.x + ExtensionsExecutes BoxBilling application logic
Reverse ProxyNginx (optional)TLS termination, load balancing, caching
TLSLet’s Encrypt / PKIProvides 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/CapabilityBoxBilling (Free)WHMCS (Paid)Blesta (Paid)ClientExec (Paid)
License costFree, open-sourceCommercial licenseCommercial licenseCommercial license
Core featuresBilling, support, hostingFull suite + marketplaceBilling + supportBilling + support
ExtensibilityPlugins + themesLarge ecosystemLimitedLimited
Target usersFreelancers, SMBsHosting providersSMBsSMBs

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.

Shape.host Resources dashboard with Create > Instance highlighted.

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

Shape.host instance form with the data center location selector highlighted.

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).

Shape.host instance form with the operating system image selector highlighted.

Click Create Instance to finalize the setup.

Shape.host instance form with the Create Instance button highlighted.

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

Shape.host Resources dashboard with the server IP address highlighted.

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):
    1. Download PuTTY.
    2. Enter your server’s IP address, select SSH, and click Open.
    3. 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.

Terminal showing DNF/YUM package management commands and output.

Install Apache Web Server

dnf install httpd

Installs the Apache web server (httpd) which will serve BoxBilling’s web pages.

Terminal showing DNF/YUM package management commands and output.
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.

Terminal showing systemd service management commands or output.
systemctl enable --now mariadb

Starts MariaDB now and enables it to start automatically after a reboot.

Terminal showing systemd service management commands or output.

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
Terminal showing DNF/YUM package management commands and output.

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.

Terminal showing DNF/YUM package management commands and output.
dnf module enable php:remi-8.2

Enables PHP 8.2 from Remi repository — BoxBilling requires newer PHP versions.

Terminal showing DNF/YUM package management commands and output.

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.

Terminal showing DNF/YUM package management commands and output.
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.

Terminal showing systemd service management commands or output.

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.

Terminal showing SQL database and user configuration commands.

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.

Terminal showing file download commands and transfer output.
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.

Terminal showing file ownership or permission commands.

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.

Terminal showing web server configuration text.
systemctl restart httpd

Restarts Apache to load the new virtual host.

Terminal showing BoxBilling Apache configuration and restart commands.

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.

Terminal showing systemd service management commands or output.

(Optional) Install SSL with Certbot

dnf install certbot python3-certbot-apache

Installs Certbot and the Apache plugin to enable free SSL certificates.

Terminal showing DNF/YUM package management commands and output.
certbot --apache -d almalinux-tutorials.shape.host

Generates and installs SSL certificates for your domain(s). Replace with your own domain names.

Terminal showing an Apache configuration test.

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.

BoxBilling setup interface.

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

BoxBilling account creation form.

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

BoxBilling account configuration form.

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.

BoxBilling setup interface.

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

BoxBilling administrator sign-in form.
BoxBilling dashboard with statistics and activity charts.

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.