How to Install FossBilling on Debian 12 in 2025

If you’ve been looking around the internet for a good guide on how to install FOSSBilling on Debian 12 in 2025, chances are you’ve run into the same problem many others have: most guides out there just don’t work. They’re either outdated, confusing, skip important steps, or leave you stuck halfway through with no support.

That ends here!

This guide is written to be clear, reliable, and beginner-friendly, walking you through every step of getting FOSSBilling installed and running – whether you’re setting it up for a client, your own business, or just spinning it up in your Proxmox lab. You did finally toss that dusty old ESXi setup, right? No shame if it’s still humming in the corner – we all have our legacy skeletons. But come on, it’s 2025! VMware went full enterprise pricing, the new overlords aren’t doing us any favours, and Proxmox is the cool kid at the hypervisor party who doesn’t charge $500 just to say ‘hello’ to your NIC or treat your home lab like a licensing crime scene…but, we digress. 🤦‍♂️

No guessing, no shortcuts – just a real guide that gets the job done. Let’s make it work, the right way…

Before you begin, make sure you have:
  • A fresh Debian 12 server (minimal install recommended) – download here.
  • Root or sudo access to the server
    • Or a non-root user with sudo privileges (e.g., a user named test)
    • You can create one like this:
      • su -
        apt install sudo -y
        adduser test
        usermod -aG sudo test
        su - test

  • A domain or IP address pointed to your server (optional but helpful)
  • Basic familiarity with the Linux terminal
Install Nginx:
sudo apt install nginx -y


sudo systemctl status nginx

Install MariaDB:
sudo apt install mariadb-server -y

sudo systemctl status mariadb

sudo mariadb
Inside MariaDB shell:
CREATE DATABASE fossbillingdb;
CREATE USER fossbilling@localhost IDENTIFIED BY 'strongpassword';
GRANT ALL ON fossbillingdb.* TO fossbilling@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
SHOW GRANTS FOR fossbilling@localhost;
quit
Install PHP and necessary dependencies:
sudo apt install ca-certificates gnupg2 apt-transport-https software-properties-common -y

sudo wget -q -O /usr/share/keyrings/sury-php.gpg https://packages.sury.org/php/apt.gpg
sudo echo "deb [signed-by=/usr/share/keyrings/sury-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
sudo apt update -y

sudo apt install php php-fpm -y

sudo apt install libcurl4-openssl-dev php-mysql php-curl php-cli php-zip php-common php-mbstring php-xml -y
Configure PHP:
sudo apt install nano -y

sudo nano /etc/php/8.4/fpm/php.ini

sudo systemctl restart php8.4-fpm

sudo systemctl status php8.4-fpm
php --version
php -m


php.ini recommended settings

upload_max_filesize = 16M
post_max_size = 32M
memory_limit = 256M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 60

Download and set up FOSSBilling:
sudo apt install unzip curl -y

sudo mkdir -p /var/www/fossbilling
cd /var/www/fossbilling
sudo curl https://fossbilling.org/downloads/stable -L --output FOSSBilling.zip
sudo unzip FOSSBilling.zip

sudo chown -R www-data:www-data /var/www/fossbilling
Create Nginx configuration
sudo nano /etc/nginx/sites-available/fossbilling
Paste the following into the fossbilling Nginx config file:

server {
listen 80;

set $root_path '/var/www/fossbilling';
server_name ServerIPAddressHere;

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

include /etc/nginx/mime.types;

# block access to sensitive files
location ~* \.(ini|sh|inc|bak|twig|sql)$ {
return 404;
}

# block access to hidden files except .well-known
location ~ /\.(?!well-known\/) {
return 404;
}

# disable PHP execution in /uploads
location ~* /uploads/.*\.php$ {
return 404;
}

# deny access to /data
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)(/.+)$;

# adjust the PHP-FPM socket or host:port as needed
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;
}
}
Save the config file and exit.
Enable Nginx site and restart:
sudo ln -s /etc/nginx/sites-available/fossbilling /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Access FossBilling via the browser at http://ServerIPAddress/install/install.php.

ServerIPAddress must match the server_name attribute entered of the NGINX configuration file.

If you are presented with any missing system requirements, simply install them:
sudo apt install php-intl php-gd php-imagick php-bz2 -y
sudo systemctl restart php8.2-fpm
sudo systemctl restart nginx
php -m | grep -E 'intl|gd|imagick|bz2'
php -v

Once the missing system requirements are installed, refresh the page…

If you run into folder-related permissions issues, create the folder and ensure ownership is properly set, then refresh the page again.

mkdir -p /var/www/fossbilling/data/cache
chown -R www-data:www-data /var/www/fossbilling/data/cache

If all checks out, you will be presented with the following page. Click Next…


Enter the database details. Click Next…

Add Administrator account details. Click Next…

Select currency and then click Install…

If all goes well, installation will complete without issues.

 

Login to the Admin Dashboard by clicking Staff Dashboard or select the Customer Area to Register for a new customer account.

Staff Dashboard

Customer Area

Post-install cleanup:
sudo rm -rf /var/www/fossbilling/install
sudo chmod 0644 /var/www/fossbilling/config.php

 

And that is how to install FOSSBilling on Debian 12 in 2025.

Found this helpful? Ran into an issue? Comment below! ↓

Leave a Reply

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