Skip to content
Follow
Ubuntu Linux

How to Install BoxBilling with Apache on Ubuntu Linux

Richard
Written by
Richard
Apr 23, 2022 Updated Aug 13, 2026 4 min read
Enable Automatic Suspension in Ubuntu Linux Easily
Enable Automatic Suspension in Ubuntu Linux Easily

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.

⚡ Quick Answer

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.

🐧Bash / Shell
sudo apt update
sudo apt install apache2

Managing the Apache service happens through specific utility commands:

🐧Bash / Shell
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2

Verifying the installation requires loading the server IP address inside a web browser.

Apache2 test page displayed on Ubuntu Linux
apache2 test page

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.

🐧Bash / Shell
sudo apt install mariadb-server mariadb-client

Securing the database deployment utilizes a dedicated utility command:

🐧Bash / Shell
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.

mariadb welcome
mariadb ubuntu 1604

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.

🐧Bash / Shell
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:

🐧Bash / Shell
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

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.

🐧Bash / Shell
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.3-fpm

Creating a configuration file for the new site uses this command:

🐧Bash / Shell
sudo nano /etc/apache2/sites-available/boxbilling.conf

Pasting specific parameters populates the configuration file:

💻Code
<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:

🐧Bash / Shell
sudo a2ensite boxbilling.conf
sudo systemctl restart apache2

Assigning correct file permissions secures directory ownership:

🐧Bash / Shell
sudo chown -R www-data:www-data /var/www/boxbilling

How to create a BoxBilling database

Accessing the database console requires administrator login credentials:

🐧Bash / Shell
sudo mysql -u root -p

Executing these database queries provisions the required schema and user account:

💻Code
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:

Command Prompt
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 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.

🐧Bash / Shell
sudo rm -rf /var/www/boxbilling/install

Restricting file permissions on the configuration file involves running this command:

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

Registering a background cron job keeps automated system tasks running:

🐧Bash / Shell
sudo crontab -e

Inserting the scheduled task string into the crontab table completes the procedure:

🐘PHP
*/5 * * * * php /var/www/boxbilling/bb-cron.php
BoxBilling setup screen on Ubuntu Linux
boxbilling ubuntu set up
BoxBilling database setup wizard on Ubuntu
boxbilling database set up wizard
BoxBilling administrator account creation on Ubuntu
ubuntu boxbilling administrator account
Successful installation confirmation of BoxBilling on Ubuntu
ubuntu boxbilling success install
BoxBilling login screen on Ubuntu Linux
ubuntu boxbilling login

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?

Was this helpful?
Richard

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.

📚 Related Tutorials

How to Install PHP on Ubuntu Linux
Ubuntu Linux How to Install PHP on Ubuntu Linux
How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
Install MySQL and MariaDB on Ubuntu: A Step-by-Step Guide
Ubuntu Linux Install MySQL and MariaDB on Ubuntu: A Step-by-Step Guide
How to Install Let's Chat on Ubuntu Linux
Ubuntu Linux How to Install Let's Chat on Ubuntu Linux

0 Comments

Leave a Comment

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