
Invoice Ninja is an open-source invoicing application built on top of Laravel for sending invoices and tracking payments. It's a free and open-source alternative to accounting applications like Freshbooks and QuickBooks. You can use Invoice Ninja to perform financial management tasks, including income, expenses, payments, and time tracking.
In this article, you will deploy Invoice Ninja on an Ubuntu 24.04 based server. You will install Invoice Ninja and use the application to perform financial management tasks on the server.
Before you begin:
invoiceninja.example.comInvoice Ninja is based on Laravel, and you can install it using the latest release file or with Docker. Installing Invoice Ninja with a release file enables you to access the latest application features, while Docker allows you to run Invoice Ninja without any manual package installations. Use the following steps to install Invoice Ninja on your server.
Update your package repository.
Allow HTTP and HTTPS traffic through your firewall.
Installing Invoice Ninja using the latest release file enables access to the latest application features and compatibility with other applications, such as web servers. Invoice Ninja requires PHP 8.3 with an active LAMP or LEMP stack to run with all required PHP extensions on your server. Use the following steps to install the LEMP stack and all the necessary dependencies to install Invoice Ninja.
Install Nginx, MySQL, and PHP.
Verify the installed PHP version and confirm it's PHP 8.3 or higher.
Install PHP-FPM and all required PHP extensions for Invoice Ninja.
Enable Nginx to start at boot.
Start the Nginx system service.
Check the Nginx service status and verify that it's running.
Output:
Invoice Ninja requires a MySQL database to run correctly on your server. Use the following steps to create a new MySQL database for Invoice Ninja.
Log in to MySQL as the root database user.
Create a new invoiceninjadb database.
Create a new invoiceninja-admin user with a strong password. Replace secure-password with your actual password.
Grant the invoiceninja-admin user full privileges to the invoiceninjadb database.
Flush the MySQL privileges table to apply the user permission changes.
Exit the MySQL database console.
Use the following steps to download the latest Invoice Ninja release file and install it on your server.
Create a new invoiceninja directory in /var/www/.
Switch to the invoiceninja directory.
Visit the Invoice Ninja releases page and verify the latest version to download. For example, run the following command to download version 5.11.72 using Wget.
Extract all files from the downloaded invoiceninja.tar.gz archive.
Remove the archive to save your disk space.
Copy the .env.example file to create a new .env file.
Grant the www-data Nginx user and group full permissions to the invoiceninja directory.
Open the system crontab as the www-data user.
Add the following Laravel schedule command to run regular maintenance tasks for Invoice Ninja.
Save and close the Crontab file.
Test the system's Crontab to verify that the Invoice Ninja task is active.
Output:
Invoice Ninja requires a virtual host configuration to run all files in the /var/www/invoiceninja directory. Use the following steps to create a new Nginx virtual host configuration to serve InvoiceNinja.
Create a new invoiceninja.conf virtual host configuration in the /etc/nginx/sites-available directory.
Add the following Nginx server block configurations to the invoiceninja.conf file. Replace invoiceninja.example.com with your domain.
Save and close the invoiceninja.conf file.
The above Nginx virtual host configuration serves Invoice Ninja files from the /var/www/invoiceninja/public directory using the invoiceninja.example.com domain. All PHP requests are forwarded to the installed PHP 8.3 FPM service to process and serve the Invoice Ninja dashboard.
Remove the default Nginx virtual host configuration.
To enable this virtual host, link the invoiceninja.conf file to the /etc/nginx/sites-enabled directory.
Test the Nginx configuration for syntax errors.
Output:
Restart Nginx to apply the Invoice Ninja virtual host configurations.
Use the following steps to generate trusted Let's Encrypt SSL certificates to secure all connections to Invoice Ninja.
Install the Certbot Let's Encrypt plugin for Nginx.
Request a new TLS certificate using your virtual host domain. Replace invoiceninja.example.com with your active domain and admin@example.com with your email address.
Restart Nginx to apply the Invoice Ninja configuration changes.
Access the /setup path using your invoiceninja.example.com domain in a web browser.
Verify that the Invoice Ninja configuration page displays correctly.
Enter your domain in the URL field and keep the HTTPS Require option enabled.
Navigate to Database Connection.
Verify that MySQL is the selected driver.
Keep localhost as the MySQL host or specify your MySQL database server address.
Keep 3306 as the MySQL port or set it depending on your server port.
Enter the Invoice Ninja database, username, and password information you created earlier.
Click Test connection to validate the MySQL connection information and verify that a success prompt displays.
Enter your Invoice Ninja administrator details in the User Details form.
Check the Invoice Ninja terms of service and privacy policy options.
Click Submit to apply the Invoice Ninja configuration.
Use the following steps to access and use Invoice Ninja on your server.
Open the Invoice Ninja login page using your domain in a new web browser tab..
In the respective fields, enter your administrator email address and password and click Login to access the Invoice Ninja dashboard.
In the open Welcome to Invoice Ninja prompt, enter your company name, such as example-company, and select the default currency to use in your invoices.
Navigate to Settings to fill-in your additional company information.
Click Invoices on the main navigation menu.
Click New Invoice to create a new invoice.
Click New Client, enter the client's details, and click Save.
In the respective fields, set the Invoice date, due date, invoice number, PO, and discount information.
Click Add Item within the Products category to add new items to the invoice.
Click New Product, specify the Item details, and click Save.
Specify the unit cost and quantity details.
Enter additional information by navigating between the Public Notes, Terms and Footer options.
Scroll and verify the Invoice information on the preview page.
Download or print the Invoice.
Click Save to export and save the Invoice in your collection.
In this article, you have deployed Invoice Ninja on an Ubuntu 24.04 server using the official package and using Docker. You can create invoices, manage records, and create financial records within the Invoice Ninja dashboard. For more information about Invoice Ninja, visit its documentation page.
0 Comments
Be the first to comment and share your perspective with the community.