I'm a freelancer and a semi-professional VALORANT Player from Pakistan, Expert in Network & System Administration & WordPress Developing.

How to install FOSSBilling on Ubuntu 22.04

FOSSBilling is a cost-free and open-source system for managing clients and billing. It can be utilized as a free substitute for various other systems like WHMCS, Blesta, and ClientExec. FOSSBilling provides several useful features such as automated invoicing, support for multiple payment gateways, and modules that can automate services like DirectAdmin and cPanel. If you are planning to establish a hosting business on a budget and require a billing option, FOSSBilling could be a suitable option for you. Additionally, it also offers regular updates.

Requirements :

  • 2GB or more RAM (Depending upon the traffic, Increase recommended if already have good traffic)
  • 1vCore or more CPU (The more the better performance)
  • 5GB or more Disk Space
  • Ubuntu 22.04

Step 1: Update your server

First step is to update your server and look for newer packages and security releases for you distribution :

apt-get update -y
apt-get upgrade -y

Step 2: Install LEMP Stack

Since FOSSBilling uses MySQL/MariaDB as it’s database back-end and is actively developed on PHP8+ we will be needing to install a LEMP Stack :

apt-get install nginx mariadb-server

apt install php libapache2-mod-php php-mysql php-curl


Copy the steps as shown in the text or picture :

Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

mysql -u root -p

CREATE USER fossuser@localhost IDENTIFIED BY ‘fosspassword’;
GRANT ALL ON fossdb.* TO fossuser@localhost WITH GRANT OPTION;

systemctl restart apache2

Step 3: Install FOSSBilling

We have everything installed in order to continue with the installation of our billing tool. Run the following steps to install :

apt install unzip

mkdir -p /var/www/fossbilling
cd /var/www/fossbilling
curl -L –output


chown -R www-data:www-data /var/www/fossbilling/
mv config-sample.php config.php

nano /etc/nginx/sites-available/fossbilling

Paste the following code :

server {
listen 80;

set $root_path ‘/var/www/fossbilling’;

index index.html index.htm index.php;
root $root_path;
try_files $uri $uri/ @rewrite;
sendfile off;

include /etc/nginx/mime.types;

location ~* .(ini|sh|inc|bak|twig|sql)$ {
return 404;

location ~ /\.(?!well-known\/) {
return 404;

location ~* /uploads/.*\.php$ {
return 404;

location ~* /data/ {
return 404;

location @rewrite {
rewrite ^/page/(.*)$ /index.php?_url=/custompages/$1;
rewrite ^/(.*)$ /index.php?_url=/$1;

location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_pass unix:/run/php/php-fpm.sock;

fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;

include fastcgi_params;

location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
expires off;

ln -s /etc/nginx/sites-available/fossbilling /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx

Open your browser and open : http://yourserverip/install




Conclusion :

You have installed this app on your Ubuntu 22.04 Machine! This tutorial assumes you are root!


Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook