Invoice Ninja is a popular open-source invoicing and billing software that allows you to streamline your invoicing process. This tutorial will guide you through the process of installing Invoice Ninja on FreeBSD.
Before you can install Invoice Ninja, you need to make sure that your FreeBSD system has the required dependencies installed. Run the following command to install MySQL, PHP, and Apache:
pkg install mysql57-server php74 php74-mysqli apache24
Log in to your MySQL server and create a new database for Invoice Ninja. You can use the following commands:
mysql -u root -p
CREATE DATABASE invoiceninja;
GRANT ALL PRIVILEGES ON invoiceninja.* TO ‘ninjauser’@’localhost’ IDENTIFIED BY ‘password’;
FLUSH PRIVILEGES;
\q
Now that you have the required dependencies and a MySQL database set up, you can proceed with downloading and installing Invoice Ninja. Follow the steps below:
Download the latest version of Invoice Ninja by running the following command:
cd /usr/local/www/apache24/data
curl -s https://invoice-ninja.org/latest.tar.gz | tar xvzf -
Rename the directory that was extracted from the archive to invoice-ninja:
mv ninja invoice-ninja
Change the ownership of the files to the Apache user:
chown www:www /usr/local/www/apache24/data/invoice-ninja -R
Change the permissions of the storage directory:
chmod 775 /usr/local/www/apache24/data/invoice-ninja/storage -R
Open the configuration file /usr/local/www/apache24/data/invoice-ninja/.env
:
cp .env.example .env
nano .env
Set the database information:
DB_DATABASE=invoiceninja
DB_USERNAME=ninjauser
DB_PASSWORD=password
Save and close the file.
Open the Apache virtual hosts file:
nano /usr/local/etc/apache24/Includes/invoice-ninja.conf
Add the following configuration:
Alias /invoice-ninja "/usr/local/www/apache24/data/invoice-ninja/public"
<Directory "/usr/local/www/apache24/data/invoice-ninja/public">
AllowOverride All
Options FollowSymLinks
Require all granted
</Directory>
Save and close the file.
Start Apache:
service apache24 start
Start MySQL:
service mysql-server start
Invoice Ninja should now be accessible from your web browser at http://<your-server-ip>/invoice-ninja/public/
.
In this tutorial, you learned how to install Invoice Ninja on FreeBSD. Now that you have Invoice Ninja installed and configured, you can start using it to create and manage your invoices.
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!