BoxBilling on Ubuntu 24.04 (Apache + MariaDB + PHP + SSL)

BoxBilling is a free, open-source billing and client management platform tailored for web hosting companies, digital service providers, and freelancers. It provides an all-in-one solution for invoicing, order management, product provisioning, domain integration, ticketing, and client support. With its extensible plugin system and automation features, BoxBilling allows service providers to streamline operations and focus on customers.

Running BoxBilling on Ubuntu 24.04 LTS (Noble Numbat) ensures long-term stability, security, and up-to-date packages. Ubuntu 24.04 ships with systemd 255, OpenSSL 3, and modern PHP/MariaDB versions — providing a hardened, production-ready foundation for financial transactions and customer data management.


Architecture Overview

LayerComponentRole
OSUbuntu 24.04 LTSStable, secure base with long-term support
Web ServerApache HTTPDServes PHP-based BoxBilling frontend and backend
DatabaseMariaDB/MySQLStores client data, invoices, products, domains, and transactions
RuntimePHP 8.x + ExtensionsExecutes BoxBilling application logic
Reverse ProxyNginx (optional)TLS termination, caching, and load balancing
TLSLet’s Encrypt / PKIProvides secure HTTPS for client and admin access

Why Use BoxBilling?

  • Complete billing system – invoicing, taxes, multiple currencies, and automated reminders.
  • Client management – track customers, products, orders, and tickets in one place.
  • Hosting integration – supports domain registration, hosting control panels, and automation.
  • Open-source & extensible – build plugins, customize themes, or integrate with APIs.
  • Multi-language & multi-currency – serve global audiences.

BoxBilling vs Other Platforms

Feature/CapabilityBoxBillingWHMCS (Paid)Blesta (Paid)ClientExec (Paid)
License costFree, open-sourceCommercial licenseCommercial licenseCommercial license
Core featuresBilling, support, hostingFull suite + addonsBilling + supportBilling + support
ExtensibilityPlugins + themesWide marketplaceLimitedLimited
Target usersSmall/medium providersEnterprises & SMBsSMBsSMBs

BoxBilling is a cost-effective alternative to WHMCS or Blesta for small to mid-sized hosting businesses or freelancers who want full control without licensing fees.


Security & Best Practices

  • Always run BoxBilling over HTTPS with Let’s Encrypt or PKI certificates.
  • Harden PHP with recommended security extensions and configurations.
  • Use MariaDB with strong user permissions and enable regular backups.
  • Keep Ubuntu, Apache, PHP, and BoxBilling core patched and up to date.
  • Restrict access to the admin panel via firewall or IP whitelisting if possible.
  • Enable fail2ban or rate limiting for brute-force protection.

Typical Use Cases

  • Web hosting companies – manage clients, domains, and hosting plans.
  • Freelancers and digital service providers – automate invoicing and customer support.
  • Small SaaS platforms – offer subscriptions, products, and customer billing.
  • Educational/test environments – explore billing automation without licensing costs.

1. Create a Shape.Host VPS Instance

Go to https://shape.host and log in.

Click “Create” → “Instance”.

Shape.host Resources dashboard with Create > Instance highlighted.

Choose your preferred server location.

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

Select Ubuntu 24.04 (64-bit) as the OS.

Pick a VPS plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.

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

Click Create Instance.

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

Copy the IP address from the Resources section.

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

2. Connect to Your VPS

On Linux/macOS

ssh root@your-server-ip

On Windows

  • For Windows 10/11 PowerShell: ssh root@your-server-ip
  • For older versions, install PuTTY and connect with root credentials.

3. Update the System and Install Required Packages

Update and upgrade packages:

apt update
apt upgrade
Terminal showing APT package management commands and output.

Install Apache:

apt install apache2
Terminal showing APT package management commands and output.

Install MariaDB (server + client):

apt install mariadb-server mariadb-client
Terminal showing APT package management commands and output.

Install PHP with required extensions:

apt install php php-cli php-mysql php-curl php-mbstring php-xml php-gd php-zip php-imagick unzip wget
Terminal showing APT package management commands and output.

4. Configure MariaDB Database

Secure MariaDB:

mysql_secure_installation
Terminal showing mysql commands or output during Configure MariaDB Database.

Log into MariaDB:

mysql -u root -p

Create database and user:

CREATE DATABASE boxbilling_db;
CREATE USER 'boxbilling_user'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON boxbilling_db.* TO 'boxbilling_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Terminal showing SQL database and user configuration commands.

5. Install BoxBilling

Navigate to web root:

cd /var/www/html

Download latest BoxBilling:

wget https://github.com/boxbilling/boxbilling/releases/latest/download/boxbilling.zip -O boxbilling.zip
Terminal showing file download commands and transfer output.

Extract files:

unzip boxbilling.zip -d boxbilling

Set permissions:

chown -R www-data:www-data /var/www/html/boxbilling
chmod -R 755 /var/www/html/boxbilling
Terminal showing file ownership or permission commands.

6. Configure Apache Virtual Host

Create a config file:

nano /etc/apache2/sites-available/boxbilling.conf

Add:

<VirtualHost *:80>
    ServerName yourdomain.com
    DocumentRoot /var/www/html/boxbilling

    <Directory /var/www/html/boxbilling>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/boxbilling_error.log
    CustomLog ${APACHE_LOG_DIR}/boxbilling_access.log combined
</VirtualHost>
Terminal showing web server configuration text.

Enable the site and rewrite module:

a2ensite boxbilling.conf
a2enmod rewrite
systemctl restart apache2
Terminal showing systemd service management commands or output.

7. Configure PHP

Edit php.ini (adjusting for Apache’s PHP version, usually /etc/php/8.x/apache2/php.ini):

nano /etc/php/*/apache2/php.ini

Set:

memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

Restart Apache:

systemctl restart apache2

8. Secure with SSL

Install Certbot:

apt install certbot python3-certbot-apache
Terminal showing APT package management commands and output.

Generate SSL certificate:

certbot --apache -d ubuntu-tutorials.shape.host
Terminal showing Certbot certificate commands and messages.

9. Set Up BoxBilling Data Directories

Create required directories:

mkdir -p /var/www/html/boxbilling/bb-data/cache
mkdir -p /var/www/html/boxbilling/bb-data/uploads

Assign permissions:

chown -R www-data:www-data /var/www/html/boxbilling/bb-data
chmod -R 775 /var/www/html/boxbilling/bb-data
ls -ld /var/www/html/boxbilling/bb-data/*
Terminal showing file ownership or permission commands.

Remove the installer for security:

rm -rf /var/www/html/boxbilling/install

Secure the config file:

chmod 644 /var/www/html/boxbilling/bb-config.php
Terminal showing file ownership or permission commands.

10. Access BoxBilling

Now open your browser:

https://yourdomain.com

Complete the web-based installer, connecting it to the database you created.

Preparation – The installer checks your server environment for PHP version and required extensions. Accept the terms of service and click Next.

BoxBilling setup interface.

Database Configuration – Enter your database host, name, user, and password created earlier. Click Next to create tables.

BoxBilling account creation form.

Administrator Account – Set up the admin username, email, and password to manage BoxBilling. Click Next.

BoxBilling administrator account setup form.

Finish – You’ll see a confirmation that BoxBilling was successfully installed. Delete the install folder, set bb-config.php to read-only (chmod 644), and configure the cron job as instructed.

BoxBilling setup interface.

After completing these steps, log in to the admin area at http://your-domain/bb-admin using your new credentials.

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

This tutorial was created and tested on a Shape.Host Cloud VPS.

With Shape.Host, you get:

  • High-performance VPS with global datacenters
  • Support for Ubuntu, Debian, Rocky Linux, AlmaLinux
  • One-click scalability for CPU, RAM, and storage
  • Tools like snapshots, backups, and monitoring

Start today at https://shape.host and deploy BoxBilling in minutes.