How to Install BoxBilling with Apache on Ubuntu Linux
Installing BoxBilling version 4.x with Apache on an Ubuntu Linux server gives you a self-hosted platform to manage clients, send invoices, and process payments without monthly third-party fees. This setup runs the open-source billing software directly on your own hardware, so you keep full control over your financial data.
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
To install Apache on Ubuntu Linux for your BoxBilling site, use the terminal to update your package list and run the installation command. Apache acts as the web server software that renders your pages to visitors. Open your terminal and run sudo apt update followed by sudo apt install apache2 to get the web server running on your system.
sudo apt update
sudo apt install apache2
Manage the Apache service with these commands, then verify the installation by loading your server IP address in a web browser:
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2
Verify the installation by loading your server IP address inside a web browser.

How to install MariaDB on Ubuntu Linux
To install MariaDB on Ubuntu Linux for your BoxBilling database, you need to set up both the server and client packages using the command line. Run sudo apt install mariadb-server mariadb-client in your terminal. After the installation finishes, run the security script to lock down your database and protect your stored data records from unauthorized access.
sudo apt install mariadb-server mariadb-client
Secure the database with this command, and answer the prompts as shown below:
sudo mysql_secure_installation
Prompts 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
To install PHP on Ubuntu Linux for BoxBilling compatibility, you must add a specialized software repository to get version 8.3 and all required module extensions. Add the repository to your system, update your package lists, and run the install commands. This ensures your server has all the necessary components to run dynamic code smoothly.
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Installing 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-zip
General Configuration
General configuration for BoxBilling on Ubuntu involves setting up Apache to work with PHP-FPM (FastCGI Process Manager, a tool that handles PHP requests separately from the web server) so your site runs quickly. You need to enable the necessary Apache modules and configure PHP-FPM to process dynamic code efficiently before launching your online store.
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.3-fpm
Creating a configuration file for the new site uses this command:
sudo nano /etc/apache2/sites-available/boxbilling.conf
Pasting 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 apache2
Assigning correct file permissions secures directory ownership:
sudo chown -R www-data:www-data /var/www/boxbilling
How to create a BoxBilling database
Accessing the database console requires administrator login credentials:
sudo mysql -u root -p
Executing 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/boxbilling
How 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 setup for your BoxBilling installation requires removing sensitive installer files and securing your configuration files against unauthorized access. Run the provided terminal commands to delete the installation directory and adjust file permissions. Finally, register a background cron job to keep your automated system tasks running properly.
sudo rm -rf /var/www/boxbilling/install
Restricting file permissions on the configuration file involves running this command:
sudo chmod 644 /var/www/boxbilling/bb-config.php
Registering a background cron job keeps automated system tasks running:
sudo crontab -e
Inserting 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.