How to Install BoxBilling with Apache on Ubuntu Linux
BoxBilling is a free tool you install on an Ubuntu server running Apache to manage clients, send invoices, and handle payments. This self-hosted setup works well for freelancers and small businesses that want full control over their billing system.
You can set up BoxBilling version 4.x on your Ubuntu machine by following a few clear steps to install Apache and configure the software. This gives you a reliable platform to run your business without paying monthly fees to third-party services.
Install BoxBilling by downloading and extracting the files to /var/www/boxbilling. Create a database named boxbilling with a dedicated user. Configure Apache with a virtual host for your domain and enable the necessary PHP modules. Finally, clean up the installer directory and set up a cron job for daily tasks.
How to install Apache on Ubuntu Linux
Installing Apache on Ubuntu remains a key milestone for bringing any BoxBilling site online. Apache acts as the underlying web server software responsible for rendering pages to visitors. Terminal commands handle the installation process.
sudo apt update
sudo apt install apache2Managing the Apache service happens through specific utility commands:
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2Verifying the installation requires loading the server IP address inside a web browser.

How to install MariaDB on Ubuntu Linux
BoxBilling relies on a relational database to store critical data records, making MariaDB on Ubuntu an ideal choice. Required steps include installing the MariaDB server and client packages before running the security script.
sudo apt install mariadb-server mariadb-clientSecuring the database deployment utilizes a dedicated utility command:
sudo mysql_secure_installationPrompts require specific responses during execution. Pressing Enter bypasses the current password prompt. Selecting the default secure option handles authentication settings. Entering "y" removes anonymous users, blocks remote root logins, and deletes the test database.

How to install PHP on Ubuntu Linux
Ensuring operational compatibility with BoxBilling requires PHP 8.3 on Ubuntu. Adding a specialized software repository guarantees access to the current release branch. Subsequent actions install PHP 8.3 along with mandatory module extensions.
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt updateInstalling PHP 8.3 and the required extensions executes next:
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-zipGeneral Configuration
Configuring Apache to work with PHP-FPM helps BoxBilling run smoothly and quickly. PHP-FPM (FastCGI Process Manager, a tool that handles PHP requests separately from the web server) helps Apache process dynamic code more efficiently. Required actions include enabling necessary Apache modules, configuring PHP-FPM, and establishing a dedicated site configuration file for BoxBilling.
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.3-fpmCreating a configuration file for the new site uses this command:
sudo nano /etc/apache2/sites-available/boxbilling.confPasting specific parameters populates the configuration file:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/boxbilling
<Directory /var/www/boxbilling/>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>Enabling the virtual host and restarting Apache completes the web server integration:
sudo a2ensite boxbilling.conf
sudo systemctl restart apache2Assigning correct file permissions secures directory ownership:
sudo chown -R www-data:www-data /var/www/boxbillingHow to create a BoxBilling database
Accessing the database console requires administrator login credentials:
sudo mysql -u root -pExecuting these database queries provisions the required schema and user account:
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
Downloading and extracting application sources utilizes terminal utilities:
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/boxbillingHow to setup Let's Encrypt
Securing the web deployment with SSL requires following an external guide: How to Setup Let's Encrypt on Ubuntu Linux with Apache - Website for Students.
Finalizing the setup
Finalizing the BoxBilling setup on Ubuntu involves clearing out installer files for security. Making the configuration file read-only protects sensitive environment variables from unauthorized tampering. Automating background operations requires setting up a scheduled cron task.
sudo rm -rf /var/www/boxbilling/installRestricting file permissions on the configuration file involves running this command:
sudo chmod 644 /var/www/boxbilling/bb-config.phpRegistering a background cron job keeps automated system tasks running:
sudo crontab -eInserting the scheduled task string into the crontab table completes the procedure:
*/5 * * * * php /var/www/boxbilling/bb-cron.php




BoxBilling deployment procedures are now complete and fully operational.
[Y/n] [Y/n] [Y/n] [Y/n] [Y/n] [Y/n]
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips 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.
Thanks a lot Sir for your assistance.