Skip to content
Follow
Ubuntu Linux

How to Install BoxBilling with Apache on Ubuntu Linux

Richard
Written by
Richard
Apr 23, 2022 Updated Jul 14, 2026 3 min read
Enable Automatic Suspension in Ubuntu Linux Easily
Enable Automatic Suspension in Ubuntu Linux Easily

Installing BoxBilling on Ubuntu Linux with the Apache web server lets you manage clients and automate billing for your business. BoxBilling is free, open-source software that helps you create invoices, track clients, and handle payments right from your own server.

This setup is perfect for freelancers or small businesses wanting a flexible, self-hosted billing system. You’ll learn how to set up Apache and install BoxBilling, specifically version 4.x, on your Ubuntu machine.

⚡ 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 is a key step for getting your BoxBilling site online. Apache is the web server software that will display your website to visitors. You can install it using commands in your terminal.

🐧Bash / Shell
sudo apt update
sudo apt install apache2

Next, you can manage the Apache service with these commands:

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

Finally, test your installation by visiting your server’s IP address in a web browser.

Apache2 test page displayed on Ubuntu Linux
apache2 test page

How to install MariaDB on Ubuntu Linux

BoxBilling needs a database to store all its important information, and installing MariaDB on Ubuntu is a great way to set this up. You’ll need to install the MariaDB server and client packages, and then secure your installation.

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

Secure your database with this command:

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

How to install PHP on Ubuntu Linux

To make BoxBilling work correctly, you need to install PHP 8.3 on Ubuntu. This involves adding a special software source to ensure you get the latest version. Then, you install PHP 8.3 along with the specific extensions BoxBilling requires.

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

Install PHP 8.3 and the required extensions:

🐧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) is a process manager for PHP that helps Apache process PHP code more efficiently. We will enable necessary Apache modules, configure PHP-FPM, and create a specific site file for BoxBilling.

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

Create a configuration file for your site:

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

Paste this content into the file:

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

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

Set the correct ownership for your files:

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

How to create a BoxBilling database

Log into your database console:

🐧Bash / Shell
sudo mysql -u root -p

Run these commands to create your database and user:

💻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

Download and extract the files:

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

To secure your site with SSL, follow this 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 cleaning out installer files for security. For added security, you should also make the configuration file read-only to protect sensitive settings. Finally, adding a cron job ensures background billing tasks run automatically.

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

Set the configuration file to be read-only:

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

Add a cron job to keep your billing tasks running:

🐧Bash / Shell
sudo crontab -e

Add this line to the file:

🐘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

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?

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 *