InvoiceNinja is free, open-source, low-cost invoicing software that allows you to create and send invoices to your client with your own branding. It is written in PHP and JavaScript and designed for invoicing and billing customers. InvoiceNinja offers a lot of useful features such as recurring invoices, creating tasks, proposals, and projects, invoice designs, multiple payment options and more.
In this post, we will show you how to install InvoiceNinja on Oracle Linux 8.
Prerequisites
- A server running Oracle Linux 8 on the Atlantic.Net Cloud Platform
- A root password is configured on your server
Step 1 – Create Atlantic.Net Cloud Server
First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Oracle Linux 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.
Once you are logged in to your server, run the following command to update your base system with the latest available packages.
dnf update -y
Step 2 – Install Apache, MariaDB, and PHP
First, you will need to install the Apache and MariaDB service on your system. You can install both packages using the following command:
dnf install httpd mariadb-server -y
Next, you will need to install the latest version of PHP on your server.
First, reset the default PHP module with the following command:
dnf module reset php
Next, install the EPEL and PHP Remi repositories with the following command:
dnf install epel-release -y dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
Next, enable the PHP 8.1 repository with the following command:
dnf module enable php:remi-8.1
Next, install PHP with other required extensions using the following command:
dnf install php php-{cli,fpm,gd,mbstring,curl,zip,xml,pdo,mysqlnd,pear,bcmath,gmp,json} --nogpgcheck
Next, start and enable the Apache, MariaDB, and PHP-FPM services with the following command:
systemctl start httpd mariadb php-fpm systemctl enable httpd mariadb php-fpm
Step 3 – Create a Database for InvoiceNinja
InvoiceNinja uses MariaDB/MySQL as a database backend, so you will need to create a database and user for InvoiceNinja.
First, log in to the MariaDB shell with the following command:
mysql
Next, create a database and user with the following command:
CREATE DATABASE invoiceninja; GRANT ALL ON invoiceninja.* TO [email protected] IDENTIFIED BY "password";
Next, flush the privileges and exit from the MariaDB shell with the following command:
FLUSH PRIVILEGES; EXIT;
Step 4 – Install InvoiceNinja
First, you will need to install Composer on your server. You can install it with the following command:
curl -sS https://getcomposer.org/installer -o composer-setup.php php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Once Composer is installed, verify the Composer version using the following command:
composer -V
You will get the following output:
Composer version 2.4.2 2022-09-14 16:11:15
Next, download the latest version of InvoiceNinja with the following command:
git clone -b v5-stable --single-branch https://github.com/invoiceninja/invoiceninja.git
Once the download is completed, move the downloaded file to the Apache web root:
mv invoiceninja /var/www/html/ninja
Next, change the directory to the InvoiceNinja and install all required dependencies:
cd /var/www/html/ninja composer create-project --no-dev
Next, edit the .env file and define your database settings:
nano .env
Change the following lines:
DB_HOST=localhost DB_DATABASE=invoiceninja DB_USERNAME=invoiceninja DB_PASSWORD=password DB_PORT=3306
Save and close the file, then set proper permissions and ownership to the InvoiceNinja directory:
chown -R apache:apache /var/www/html/ninja chmod -R 755 /var/www/html/ninja/storage/
Step 5 – Configure Apache for InvoiceNinja
Next, you will need to create an Apache virtual host configuration file for InvoiceNinja. You can create it with the following command:
nano /etc/httpd/conf.d/invoice-ninja.conf
Add the following lines:
<VirtualHost *:80> ServerName ninja.example.com DocumentRoot /var/www/html/ninja/public <Directory /var/www/html/ninja/public> DirectoryIndex index.php Options +FollowSymLinks AllowOverride All Require all granted </Directory> CustomLog /var/log/httpd/invoice_ninja_access.log combined ErrorLog /var/log/httpd/invoice_ninja_error.log </VirtualHost>
Save and close the file, then restart the Apache service to apply the changes:
systemctl restart httpd
Step 6 – Access InvoiceNinja Web UI
Now, open your web browser and access the InvoiceNinja web interface using the URL http://ninja.example.com/setup. You should see the following page:
Provide your website URL and click on Test PDF. You should see the following page:
Define your database settings and click on Test connection. You should see the following page:
Define your email settings and click on Send test email. You should see the following page:
Provide your admin username, email, and password, and click the Submit button. You should see the following page:
Provide your email and password and click on the Login with email button. You should see the InvoiceNinja welcome page:
Provide your company name and click on the SAVE button. You should see the InvoiceNinja dashboard on the following page:
Conclusion
In this post, we explained how to install InvoiceNinja on Oracle Linux 8. You can now implement InvoiceNinja in your organization and start managing all invoicing from the central location. Try it on dedicated hosting from Atlantic.Net!