Cara Install Invoice Ninja di Ubuntu 22.04
Invoice Ninja adalah perangkat lunak invoice yang ditujukan untuk usaha kecil menengah. Invoice Ninja tersedia dalam versi cloud (Software as a Service) dan tersedia dalam versi self-hosted yang dapat diinstalasi di server perusahaan.
Server Requirements
Invoice Ninja dikembangkan dengan menggunakan PHP framework Laravel dan MySQL database. Server requirements yang harus dipenuhi yaitu:
- PHP 8.1+
- MySQL 5.7+ atau MariaDB 10.3+
- Apache atau Nginx
Tutorial Environment
Pada tutorial ini menggunakan:
- VPS Vultr
- OS Ubuntu 22.04
- PHP 8.2
- MariaDB 10.6
- Apache
- Certbot
- Subdomain invoice.aminlabs.my.id
Install Apache
Install Apache web server.
1 | sudo apt install apache2 -y |
Membuat virtual host untuk invoice.aminlabs.my.id.
1 | sudo nano /etc/apache2/sites-available/invoice.aminlabs.my.id.conf |
Masukkan konfigurasi virtual host.
1 2 3 4 5 6 7 8 9 10 11 | <VirtualHost *:80> ServerName invoice.aminlabs.my.id DocumentRoot /var/www/invoice.aminlabs.my.id <Directory /var/www/invoice.aminlabs.my.id> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> ErrorLog /var/log/apache2/invoice.aminlabs.my.id_error.log CustomLog /var/log/apache2/invoice.aminlabs.my.id_access.log combined </VirtualHost> |
Mengaktifkan virtual host.
1 | sudo a2ensite invoice.aminlabs.my.id.conf |
Mengaktifkan modul rewrite.
1 | sudo a2enmod rewrite |
Me-restart service apache2.
1 | sudo systemctl restart apache2 |
Membuka port HTTP di UFW.
1 | sudo ufw allow http |
Install SSL
Install certbot untuk Apache web server.
1 | sudo apt install certbot python3-certbot-apache -y |
Membuka port HTTPS di UFW.
1 | sudo ufw allow https |
Request SSL untuk invoice.aminlabs.my.id.
1 | sudo certbot --non-interactive -m musa@aminlabs.my.id --agree-tos --no-eff-email --apache -d invoice.aminlabs.my.id --redirect |
Install PHP
Memasang repository PPA ondrej/php.
1 | sudo add-apt-repository ppa:ondrej/php -y |
Menginstal PHP 8.2 dan extension.
1 | sudo apt install libapache2-mod-php8.2 php8.2 php8.2-cli php8.2-common php8.2-mbstring php8.2-gd php8.2-intl php8.2-xml php8.2-bcmath php8.2-mysql php8.2-zip php8.2-curl php8.2-tidy php8.2-imagick php8.2-gmp -y |
Me-restart service apache2.
1 | sudo systemctl restart apache2 |
Install MariaDB
Install MariaDB database.
1 | sudo apt install mariadb-server -y |
Login ke MariaDB.
1 | sudo mariadb |
Membuat database.
1 2 3 4 | create database invoice; grant all privileges on invoice.* to 'invoice'@'localhost' identified by 'rahasia'; flush privileges; exit |
Install Invoice Ninja
Download Invoice Ninja v5.7.11.
1 | wget https://github.com/invoiceninja/invoiceninja/releases/download/v5.7.11/invoiceninja.zip |
Install unzip.
1 | sudo apt install unzip -y |
Extract invoiceninja.zip.
1 | sudo unzip invoiceninja.zip -d /var/www/invoice.aminlabs.my.id |
Copy file .env.
1 2 | cd /var/www/invoice.aminlabs.my.id sudo cp .env.example .env |
Mengubah user dan group direktori invoice.
1 | sudo chown -R www-data:www-data /var/www/invoice.aminlabs.my.id |
Akses https://invoice.aminlabs.my.id/setup
untuk melanjutkan instalasi.
- Masukkan
URL
dan klikTest PDF
untuk menguji fitur PDF. - Masukkan nama database, username, dan password. Klik
Test connection
untuk menguji koneksi ke MariaDB. - Klik
Send test email
. - Masukkan nama, email, dan password. Centang
ToS
danPrivacy Policy
. Lalu klikSubmit
. - Jika berhasil, akan redirect ke form login.
Selamat mencoba 🙂