How to Install InvoicePlane on Ubuntu 18.04 LTS

InvoicePlane is a free, open source and self-hosted application for managing your invoices, clients and payments. It is specially designed for business owners to create and manage their invoices and client payments. Currently many companies around the world used this application to manage their complete billing circle.

In this tutorial, we will explain the installation of InvoicePlane on Ubuntu 18.04 LTS (Bionic Beaver).

Requirements

  • A server running Ubuntu 18.04.
  • A non-root user with sudo privileges.

Install LAMP Server

InvoicePlane is runs on web server, written in PHP and uses MariaDB to store their data. First, install Apache and MariaDB server with the following command:

sudo apt-get install apache2 mariadb-server -y

Next, you will need to add ondrej PHP repository to your system. You can add it by running the following command:

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php

Once the repository is added, update the repository and install PHP with all required libraries with the following command:

sudo apt-get install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-mysql wget unzip php7.2-cli php7.2-mcrypt php7.2-zip php7.2-curl -y

Once all the packages are installed, open php.ini file and make some changes:

sudo nano /etc/php/7.2/apache2/php.ini

Make the following changes:

memory_limit = 256M
upload_max_filesize = 128M
max_execution_time = 360
date.timezone = Asia/Kolkata

Save and clsoe the file. Then, start Apache and MariaDB service and enable them to start on boot time with the following command:

sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mariadb
sudo systemctl enable mariadb

Configure MariaDB

Before configuring MariaDB, secure MariaDB installation using the following command:

sudo mysql_secure_installation

This script will set root password, remove anonymous users, disallow root login remotely and remove test database as shown below:

Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Once MariaDB is secured, log in to MariaDB shell:

mysql -u root -p

Enter your root password then create a database and user for InvoicePlane:

MariaDB [(none)]> CREATE DATABASE invplane_db;
MariaDB [(none)]> CREATE USER 'invplane'@'localhost' IDENTIFIED BY 'password';

Next, grant privileges to the InvoicePlane database with the following command:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON invplane_db.* TO 'invplane'@'localhost';

Next, run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MariaDB:

MariaDB [(none)]> FLUSH PRIVILEGES;

Finally, exit from the MariaDB shell:

MariaDB [(none)]> EXIT

Download and Install InvoicePlane

First, download the latest version of InvoicePlane with the following command:

wget -c -O v1.5.9.zip https://invoiceplane.com/download/v1.5.9

Once the download is completed, unzip the downloaded file with the following command:

mkdir invoiceplane
unzip v1.5.9.zip -d invoiceplane

Next, change the directory to the invoiceplane and copy required files to the Apache root directory with the following command:

cd invoiceplane
sudo mv ip /var/www/html/invoiceplane
cd /var/www/html/invoiceplane
sudo cp ipconfig.php.example ipconfig.php
sudo cp htaccess .htaccess

Next, set proper permissions to the invoiceplane directory:

sudo chown -R www-data:www-data /var/www/html/invoiceplane/
sudo chmod -R 755 /var/www/html/invoiceplane/

Next, create an Apache virtual host file for InvoicePlane:

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

Add the following lines:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/invoiceplane
     ServerName example.com
     ServerAlias www.example.com

     <Directory /var/www/html/invoiceplane/>
          Options +FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

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

</VirtualHost>

Save the file, when you are finished.

Next, enable apache virtual host file and rewrite module with the following command:

sudo a2ensite invoiceplane.conf
sudo a2enmod rewrite

Finally, restart Apache service to apply all the changes:

sudo systemctl restart apache2

Access InvoicePlane

InvoicePlane is now installed and configured, it's time to access their web installation wizard.

Open your web browser and type the URL http://example.com. You will be redirected to the following page:

InvoicePlane installer

Now, click on the Setup button. You should see the following page:

Choose language

Next, choose the language and click on the Continue button. You should see the following page:

Prerequisites check

Next, click on the Continue button. You should see the following page:

Database Details

Here, provide your database details and click on the Try Again button. You should see the following page:

Database details set correctly

Now, click on the Continue button. You should see the following page:

Database tables installed

Now, click on the Continue button. You should see the following page:

Create an account

Now, provide all the required details, then click on the Continue button. Once the installation is completed, you should see the following page:

InvoicePlane installation complete

Now, click on the Login button. You should see the following page:

Login to InvoicePlane

Here, provide your admin username and password, then click on the Login button. You will be redirected to the InvoicePlane dashboard as shown below:

InvoicePlane dashboard

Share this page:

0 Comment(s)