In today’s tutorial, we are looking at how to install Invoice Ninja on Debian 10 with Nginx as a web server. Invoice Ninja is an open source self-hosted software for billing and invoicing customers, an alternative to commercial online invoice platforms.

Some interesting features of Invoice Ninja include:

  • Ability to send invoices to clients with own domain name and brand
  • Easy to create and send beautiful proposals to clients
  • Creates projects, tasks and track time
  • Automatically bills long-term clients with recurring invoices thus saving time
  • Attach third party files and invoices
  • Notifies when clients view invoices and make payments
  • Ability to manage various businesses invoicing all under one account
  • Clients see all their transactions with you
  • Remind clients of pending invoices
  • With Zapier automation, you can transfer data the invoicing account and apps such as MailChimp, Google Sheets, QuickBooks etc

Step 1: Update System

Update your Debian to packages first with the below commands

sudo apt-get update
sudo apt-get upgrade
sudo reboot

Step 2: Install Required Dependencies

Invoice Ninja requires a webserver, a database server and PHP. In my guide, I am going to be installing Nginx, MariaDB and PHP. Run the below command to install the required packages and php modules

sudo apt-get install nginx php-fpm php-cli php-common php-curl php-gd php-mysql php-xml php-mbstring mariadb-server mariadb-client

Confirm nginx and php-fpm status with the below commands:

$ sudo systemctl status nginx.
● nginx.service - A high performance web server and a reverse proxy server 
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) 
Active: active (running) since Tue 2021-01-12 18:00:52 EAT; 27s ago 
Docs: man:nginx(8) 
Main PID: 12225 (nginx) 
Tasks: 3 (limit: 2320) 
Memory: 4.9M

$ sudo systemctl status php7.3-fpm.service  
[sudo] password for lorna:  
● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager 
Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled) 
Active: active (running) since Tue 2021-01-12 21:11:35 EAT; 1h 29min ago 
Docs: man:php-fpm7.3(8) 
Main PID: 516 (php-fpm7.3) 
Status: "Processes active: 0, idle: 2, Requests: 18, slow: 0, Traffic: 0req/sec" 
Tasks: 3 (limit: 2320) 
Memory: 76.1M

Enable nginx and php-fpm to automatically start at system boot

sudo systemctl enable nginx
sudo systemctl enable php7.3-fpm.service

Start and enable mariadb

sudo systemctl start mariadb
sudo systemctl enable mariadb

Now run mariaDB post installation

$ sudo mysql_secure_installation
Enter current password for root (enter for none):  PRESS ENTER
Set root password? [Y/n] Y 
New password:  
Re-enter new password:  
Remove anonymous users? [Y/n] Y 
Disallow root login remotely? [Y/n] Y 

Remove test database and access to it? [Y/n] Y 
Reload privilege tables now? [Y/n] Y 
... Success! 

Cleaning up... 

Thanks for using MariaDB!

Create Ninja Database. Launch mysql cli and create a database to be used by Ninja invoice.

mysql -u root -p

Provide the password you created earlier to login. Once in Mysql cli, run the following commands to create a database.

GRANT ALL PRIVILEGES ON ninja.* TO 'ninja'@'localhost' IDENTIFIED BY 'strongpassword';

Step 3: Install Invoice Ninja on Debian 10

We are going to download Invoice Ninja zip archive as below.

wget -O

Extract the downloaded content to /var/www/html and set the right ownership

sudo unzip -d /var/www/html
sudo chown -R www-data: /var/www/html

Step 4: Configure Nginx to serve Invoice Ninja

Create Nginx server block for Ninja as below using your preferred editor

sudo vim /etc/nginx/sites-available/

Add the following content and edit to suit your server name

server {
    listen 80;
    listen [::]:80;

    root /var/www/html/ninja/public/;
    index index.php index.html index.htm;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log  /var/log/nginx/invoiceninja.access.log;
    error_log   /var/log/nginx/invoiceninja.error.log;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;

    location ~ /\.ht {
        deny all;

Create a symbolic link to activate the server block

sudo ln -s /etc/nginx/sites-available/  /etc/nginx/sites-enabled/

Test Nginx configuration

sudo nginx -t

If successful, restart nginx service

sudo systemctl restart nginx

Step 5: Configure Invoice Ninja on Debian 10

Now access Invoice Ninja from the browser. Once done with installation, key in your server hostname ( on your browser to access Invoice Ninja and finish up the set up. You should see a page as below:

Test database connectivity and provide every other details required such as SMTP settings and user details. Agree to terms of service and privacy policy and click ‘submit’ at the bottom of the page. You should then be presented with a login page as below:

Provide email address and password previously set to login. You should get a page as below:

That’s it. You have successfully installed Invoice Ninja on Debian 10. I hope the guide has been useful. Enjoy using your self-hosted customer billing and invoicing software, having quite a number of important features and a good alternative to expensive online invoicing platforms.

More articles:

5 Best Adobe Illustrator Mastery books

Best Photoshop Design Mastery Books

Best Books To Learn Kotlin Programming

Best Books To Learn Git Version Control


Please enter your comment!
Please enter your name here