How to Install Invoice Ninja on Debian 9 with Virtualmin
This tutorial will show you how to install Invoice Ninja on a Debian 9 VPS which is configured with Virtualmin and LAMP stack. Phrase LAMP stands for Linux, Apache, MySQL and PHP. If you know me, you should know that I don't work on Apache. But a visitor today wanted my help installing Invoice Ninja on Debian 9 with Apache. Instead of hiring me to install Invoice Ninja for them, they opted for a tutorial.
Debian 9 is missing few dependencies. Log in to VPS root account over SSH and execute following command to install them,
apt install php7.0-gmp curl git
While still in the root account, execute following commands to install Composer.
curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Now switch to domain admin account.
This is the account you get when adding your domain to Virtualmin. Then navigate to home directory.
Download Invoice Ninja,
git clone https://github.com/invoiceninja/invoiceninja.git
Navigate to downloaded folder,
Virtualmin uses public_html as document root. But Invoice Ninja is configured to use it's own public directory as document root. We'll solve this conflict by removing public_html directory and then symlinking Invoice Ninja's public directory to public_html.
So remove public_html directory,
rm -rf $HOME/public_html
Create the symlink,
ln -s $HOME/invoiceninja/public $HOME/public_html
Now open your domain name in the browser and complete the installation. You'll be asked for few details about your server. MySQL credentials are easy to obtain from Virtualmin. You also have SMTP setup on your server. But I recommend using a third party relay like MailGun.
That should do it.