Essetee's Webstek

Apache2 + PHP

sudo apt install build-essential cmake

sudo apt install apache2 libapache2-mod-php

sudo apt install mariadb-server dialog

sudo apt install php php-cli php-xml php-gmp php-gd php-curl php-zip php-mbstring php-mysql

sudo apt install curl git unzip


wget -O /tmp/

sudo unzip /tmp/ -d /var/www/html/

sudo chown -R www-data:www-data /var/www/html/ninja/

sudo chmod -R 755 /var/www/html/ninja/

sudo nano /etc/apache2/sites-available/invoice-ninja.conf

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /var/www/html/invoiceninja/public

    <Directory /var/www/html/invoiceninja/public>
       DirectoryIndex index.php
       Options +FollowSymLinks
       AllowOverride All
       Require all granted

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


sudo a2dissite 000-default

sudo a2ensite invoice-ninja

sudo a2enmod rewrite

sudo systemctl restart apache2


sudo apt install mariadb-server

sudo mysql_secure_installation

Set now your root password for the mysql server. You can use another password than the one you use for the system !

Answer Y to all other questions

sudo su (become super user)


create database invoiceninja;

create user 'ninja'@'%' identified by 'YourStrongPassword';

create user 'ninja'@'localhost' identified by 'YourStrongPassword';

grant all privileges on invoiceninja.* to 'ninja'@'%';

grant all privileges on invoiceninja.* to 'ninja'@'localhost';

create user 'YourUserName'@'%' identified by 'YourStrongPassword';

create user 'YourUserName'@'localhost' identified by 'YourStrongPassword';

grant all privileges on *.* to 'YourUserName'@'%';

grant all privileges on *.* to 'YourUserName'@'localhost';

flush privileges;


Here we create a database invoiceninja and we give the user ninja complete control on that database. Where you replace YourUserName with yours, we give that user complete control over the database mysql. As we disable root loging you need such a user to be able to control the MySQL database. Needed if you want to use phpmyadmin or adminer.

Back to normal user



sudo apt install g++ cmake qt5-default libqt5webkit5-dev python
git clone

cd phantomjs
./configure && make
sudo make install

Invoiceninja setup

http://localhost to configure Invoiceninja.

Once finished

sudo nano /var/www/html/invoiceninja/.env

search for those 2 lines:


Add below those 2 lines:


Enjoy invoiceninja !