Ubuntu Linux

How to Install BoxBilling with Apache on Ubuntu Linux

Richard
Written by
Richard
Apr 23, 2022 Updated Apr 18, 2026 3 min read

This guide helps you install BoxBilling on Ubuntu Linux using the Apache web server. BoxBilling is a tool to manage client billing, invoices, and payments. You can also use free Let’s Encrypt SSL certificates to secure your site.

Why use BoxBilling? It automates your business tasks like sending invoices and collecting payments. What happens when done? You will have a fully functional billing portal running on your own server.

For more details, visit the homepage.

How to install Apache on Ubuntu Linux

Apache is the web server that displays your site to visitors. Run these commands to install it:

sudo apt update
sudo apt install apache2

Use these commands to manage the service:

sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2

Visit your server’s IP address in a browser to test it.

Apache2 test page displayed on Ubuntu Linux

How to install MariaDB on Ubuntu Linux

BoxBilling needs a database to store information. MariaDB is a fast and secure choice.

sudo apt install mariadb-server mariadb-client

Secure your database with this command:

sudo mysql_secure_installation

Follow the prompts. Press Enter for the current password. When asked about authentication, choose the default secure option. Answer “y” to remove anonymous users, disallow remote root login, and remove the test database.

mariadb welcome

How to install PHP on Ubuntu Linux

We use PHP 8.3 for this setup. We will use a repository to get the latest version.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Install PHP 8.3 and the required extensions:

sudo apt install php8.3 php8.3-mysql php8.3-xml php8.3-mbstring php8.3-fpm php8.3-curl php8.3-gd php8.3-zip

General Configuration

We will use PHP-FPM with Apache’s proxy module for better performance. Enable the necessary modules:

sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.3-fpm

Create a configuration file for your site:

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

Paste this content into the file:

<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/boxbilling
<Directory /var/www/boxbilling/>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Enable the site and restart Apache:

sudo a2ensite boxbilling.conf
sudo systemctl restart apache2

Set the correct ownership for your files:

sudo chown -R www-data:www-data /var/www/boxbilling

How to create a BoxBilling database

Log into your database console:

sudo mysql -u root -p

Run these commands to create your database and user:

CREATE DATABASE boxbilling;
CREATE USER ‘boxbillinguser’@’localhost’ IDENTIFIED BY ‘your_password’;
GRANT ALL ON boxbilling.* TO ‘boxbillinguser’@’localhost’;
FLUSH PRIVILEGES;
EXIT;

How to download BoxBilling

Download and extract the files:

cd /tmp
wget https://github.com/boxbilling/boxbilling/releases/download/4.22.1.3/BoxBilling.zip
sudo mkdir -p /var/www/boxbilling
sudo unzip BoxBilling.zip -d /var/www/boxbilling

How to setup Let’s Encrypt

To secure your site with SSL, follow the guide here: How to Setup Let’s Encrypt on Ubuntu Linux with Apache – Website for Students.

Finalizing the setup

Once installed, clean up the installer folder for security:

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

Set the configuration file to be read-only:

sudo chmod 644 /var/www/boxbilling/bb-config.php

Add a cron job to keep your billing tasks running:

sudo crontab -e

Add this line to the file:

*/5 * * * * php /var/www/boxbilling/bb-cron.php

BoxBilling setup screen on Ubuntu Linux
BoxBilling database setup wizard on Ubuntu
BoxBilling administrator account creation on Ubuntu
Successful installation confirmation of BoxBilling on Ubuntu
BoxBilling login screen on Ubuntu Linux

Your BoxBilling installation is now complete and ready for use.

[Y/n] [Y/n] [Y/n] [Y/n] [Y/n] [Y/n]

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, the owner and lead writer at Geek Rewind, is a tech enthusiast passionate about simplifying complex IT topics. His years of hands-on experience in system administration and enterprise IT operations have honed his ability to provide practical insights and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

0 responses to “How to Install BoxBilling with Apache on Ubuntu Linux”

Leave a Reply

Your email address will not be published. Required fields are marked *

Exit mobile version