How to Install Invoice Ninja on Kali Linux

Invoice Ninja is a popular open-source invoicing and billing software that helps businesses manage their finances effectively. Here's a step-by-step guide on how to install Invoice Ninja on Kali Linux.

Step 1: Install the Required Dependencies

Before installing Invoice Ninja, we need to make sure that all the required dependencies are installed on our Kali Linux system. Open the terminal and run the following command to update the package list:

sudo apt update

Once the update is completed, run the following command to install the required dependencies:

sudo apt install -y git curl zip unzip libmcrypt-dev libpng-dev libzip-dev libonig-dev openssl

Step 2: Download and Extract Invoice Ninja

Next, we need to download and extract the Invoice Ninja source code. Run the following commands to download the latest version of Invoice Ninja and extract it to the /var/www/html directory:

cd /var/www/html
sudo git clone https://github.com/invoiceninja/invoiceninja.git .
sudo chown -R www-data:www-data /var/www/html/

Step 3: Install and Configure PHP

Invoice Ninja requires PHP 7.2 or higher. To install PHP 7.2, run the following command:

sudo apt install php7.2 php7.2-cli php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-xml php7.2-zip

Once the installation is completed, we need to configure the PHP settings. Open the /etc/php/7.2/apache2/php.ini file using your preferred text editor and make the following changes:

max_execution_time = 300
memory_limit = 512M
upload_max_filesize = 100M
post_max_size = 100M

Save the file and exit the editor.

Step 4: Create a MySQL Database

Invoice Ninja uses a MySQL or MariaDB database to store data. Run the following command to install MySQL database server:

sudo apt install mysql-server

Once the installation is done, log in to the MySQL server:

sudo mysql -u root -p

Create a new database and user for Invoice Ninja:

CREATE DATABASE invoiceninja;
CREATE USER 'ninjauser'@'localhost' IDENTIFIED BY 'ninjauserpassword';
GRANT ALL PRIVILEGES ON invoiceninja.* TO 'ninjauser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Exit the MySQL shell:

exit

Step 5: Configure Invoice Ninja

Copy the .env.example file to .env and update the contents as per your preferences:

cd /var/www/html
cp .env.example .env
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/

Enter the following commands to migrate the database and generate encryption keys:

php artisan key:generate
php artisan migrate --seed

Step 6: Configure Apache Web Server

Invoice Ninja runs on the Apache web server. We need to configure Apache to serve the Invoice Ninja application. Create a new Apache configuration file named invoiceninja.conf in the /etc/apache2/sites-available directory:

sudo nano /etc/apache2/sites-available/invoiceninja.conf

Add the following content to the file:

<VirtualHost *:80>
    ServerName your-domain.com
    ServerAlias www.your-domain.com
    ServerAdmin webmaster@your-domain.com
    DocumentRoot /var/www/html/public

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/public>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
        RewriteEngine On
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    </Directory>
</VirtualHost>

Save the file and exit the editor.

Enable the invoiceninja.conf configuration:

sudo a2ensite invoiceninja.conf

Finally, restart the Apache web server:

sudo systemctl restart apache2

Step 7: Access/Login to Invoice Ninja

Open your web browser and navigate to your Invoice Ninja URL to complete the installation process:

http://your-domain.com

You will be redirected to the Invoice Ninja setup page where you can create your first account and customize your preferences.

Congratulations! You have successfully installed and configured Invoice Ninja on Kali Linux.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!