In this tutorial, we will show you how to install InvoicePlane on Ubuntu 20.04 LTS. For those of you who didn’t know, InvoicePlane is a free-to-use invoicing and customer management web application that makes it possible for almost any individual or business to issue out invoices on demand. It is used by many organizations and freelancers to manage their payments and invoices. It offers custom templates, themes, and other tools that help you to increase the functionality of InvoicePlane. It also supports multiple languages and multiple payment providers such as Paypal, or even Bitcoin via Coinbase.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the InvoicePlane on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Prerequisites
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, you can harm your system if you’re not careful when acting as the root.
Install InvoicePlane on Ubuntu 20.04 LTS Focal Fossa
Step 1. First, make sure that all your system packages are up-to-date by running the following apt
commands in the terminal.
sudo apt update sudo apt upgrade
Step 2. Installing the LAMP stack.
A Ubuntu 20.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.
Step 3. Installing InvoicePlane on Ubuntu 20.04.
By default, InvoicePlane is not available on Ubuntu 20.04 base repository. Now we download the latest version of the InvoicePlane with the following command below:
wget -c -O v1.5.11.zip https://invoiceplane.com/download/v1.5.11
Next, extract the downloaded file:
mkdir /var/www/html/invoiceplane unzip v1.5.11.zip -d /var/www/html/invoiceplane
Then, change the directory and edit the ipconfig.php
file with the following command:
cd /var/www/html/invoiceplane cp ipconfig.php.example ipconfig.php cp htaccess .htaccess nano ipconfig.php
Add the following file:
IP_URL=http://invoice.your-domian.com DB_HOSTNAME=localhost DB_USERNAME=invplane DB_PASSWORD=password DB_DATABASE=invplanedb DB_PORT=3306
We will need to change some folders permissions:
chown -R www-data:www-data /var/www/html/invoiceplane/ chmod -R 755 /var/www/html/invoiceplane/
Step 4. Configuring MariaDB.
By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation
script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:
mysql_secure_installation
Configure it like this:
- Set root password? [Y/n] y - 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
Next, we will need to log in to the MariaDB console and create a database for the InvoicePlane. Run the following command:
mysql -u root -p
This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for InvoicePlane installation:
MariaDB [(none)]> CREATE DATABASE invplanedb; MariaDB [(none)]> CREATE USER 'invplane'@'localhost' IDENTIFIED BY 'your-strong-password'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON invplanedb.* TO 'invplane'@'localhost'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT
Step 5. Configuring Apache.
Now we create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘invoiceplane.conf
’ on your virtual server:
nano /etc/apache2/sites-available/invoiceplane.conf
Add the following lines:
<VirtualHost *:80> ServerAdmin admin@your-domain.com DocumentRoot /var/www/html/invoiceplane ServerName invoice.your-domain.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>
Now, we can restart the Apache webserver so that the changes take place:
sudo a2ensite invoiceplane.conf sudo a2enmod rewrite sudo systemctl restart apache2
Step 6. Set up HTTPS.
We should enable a secure HTTPS connection on InvoicePlane. We can obtain a free TLS certificate from Let’s Encrypt. Install Let’s Encrypt client (certbot) from Ubuntu 20.04 repository:
sudo apt install certbot python3-certbot-apache
Next, run the following command to obtain a free TLS certificate using the Apache plugin:
certbot --apache -d invoice.your-domian.com
You will be asked to provide your email and accept the term of service:
Enabled Apache rewrite module Redirecting vhost in /etc/apache2/sites-enabled/invoice.conf to ssl vhost in /etc/apache2/sites-available/invoice-le-ssl.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://invoice.your-domain.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=invoice.your-domain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/invoice.your-domain.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/invoice.your-domain.com/privkey.pem Your cert will expire on 2022-04-23. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
If the test is successful, reload Apache for the change to take effect:
sudo apache2ctl -t sudo systemctl reload apache2
Step 7. Accessing InvoicePlane Web Interface.
Once successfully installed, open your web browser and access the InvoicePlane web interface using the URL https://invoice.your-domain.com
. You should see the following page:
Congratulations! You have successfully installed InvoicePlane. Thanks for using this tutorial for installing the InvoicePlane on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official InvoicePlane website.