{"id":130008,"date":"2026-03-20T02:44:39","date_gmt":"2026-03-19T23:44:39","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=130008"},"modified":"2026-03-21T15:42:27","modified_gmt":"2026-03-21T12:42:27","slug":"install-invoice-ninja-ubuntu","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/install-invoice-ninja-ubuntu\/","title":{"rendered":"Install Invoice Ninja 5 on Ubuntu 24.04"},"content":{"rendered":"\n<p>Invoice Ninja is a free, open-source invoicing, billing, and payment management platform built for freelancers and small businesses. It supports recurring invoices, expense tracking, time tracking, quotes, and integrates with popular payment gateways like Stripe, PayPal, and many others. Version 5 is a complete rewrite using Laravel and React, offering a modern UI and improved performance over earlier releases.<\/p>\n\n\n\n<p>This guide covers a full production installation of <a href=\"https:\/\/invoiceninja.com\/\" target=\"_blank\" rel=\"noopener\">Invoice Ninja<\/a> 5.13.2 on Ubuntu 24.04 with Apache, MariaDB, and PHP 8.3.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before you begin, make sure you have the following in place:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ubuntu 24.04 server with root or sudo access &#8211; see <a href=\"https:\/\/computingforgeeks.com\/install-and-configure-ssh-server-on-ubuntu\/\">Install and Configure SSH Server on Ubuntu<\/a><\/li>\n\n\n\n<li>At least 2GB RAM (4GB recommended for production)<\/li>\n\n\n\n<li>A registered domain name pointed to your server IP<\/li>\n\n\n\n<li>Ports 80 and 443 open in your firewall<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 &#8211; Update System and Install Dependencies<\/h2>\n\n\n\n<p>Start by updating the package index and upgrading installed packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update && sudo apt upgrade -y<\/code><\/pre>\n\n\n\n<p>Install basic dependencies that Invoice Ninja requires:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y curl wget git unzip software-properties-common<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 &#8211; Install Apache, MariaDB, and PHP 8.3 (LAMP Stack)<\/h2>\n\n\n\n<p>Ubuntu 24.04 ships with PHP 8.3.6 in the default repositories. Install Apache, MariaDB, and all the PHP extensions Invoice Ninja needs in one command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y apache2 mariadb-server \\\n  php php-{fpm,soap,bcmath,common,imagick,mysql,gmp,curl,intl,mbstring,gd,xml,cli,zip,bz2} \\\n  libapache2-mod-php<\/code><\/pre>\n\n\n\n<p>Verify the installed PHP version:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -v<\/code><\/pre>\n\n\n\n<p>Expected output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PHP 8.3.6 (cli) (built: ...)\nCopyright (c) The PHP Group\nZend Engine v4.3.6, Copyright (c) Zend Technologies\n    with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies<\/code><\/pre>\n\n\n\n<p>Enable and start both Apache and MariaDB:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable --now apache2 mariadb<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Tune PHP for Invoice Ninja<\/h3>\n\n\n\n<p>Invoice Ninja needs higher memory and upload limits than the PHP defaults. Edit the Apache PHP configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sed -i 's\/memory_limit = .*\/memory_limit = 512M\/' \/etc\/php\/8.3\/apache2\/php.ini\nsudo sed -i 's\/upload_max_filesize = .*\/upload_max_filesize = 100M\/' \/etc\/php\/8.3\/apache2\/php.ini\nsudo sed -i 's\/post_max_size = .*\/post_max_size = 100M\/' \/etc\/php\/8.3\/apache2\/php.ini<\/code><\/pre>\n\n\n\n<p>Confirm the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -E \"memory_limit|upload_max_filesize|post_max_size\" \/etc\/php\/8.3\/apache2\/php.ini | head -3<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 &#8211; Secure MariaDB<\/h2>\n\n\n\n<p>Run the MariaDB security script to set a root password, remove anonymous users, disable remote root login, and drop the test database:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>Answer the prompts as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Switch to unix_socket authentication: <strong>N<\/strong><\/li>\n\n\n\n<li>Set root password: <strong>Y<\/strong> (enter a strong password)<\/li>\n\n\n\n<li>Remove anonymous users: <strong>Y<\/strong><\/li>\n\n\n\n<li>Disallow root login remotely: <strong>Y<\/strong><\/li>\n\n\n\n<li>Remove test database: <strong>Y<\/strong><\/li>\n\n\n\n<li>Reload privilege tables: <strong>Y<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 &#8211; Create Database and User<\/h2>\n\n\n\n<p>Log into MariaDB and create a dedicated database and user for Invoice Ninja:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Run these SQL statements (replace <code>StrongPassword123!<\/code> with your own password):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE invoiceninja CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nCREATE USER 'ninjauser'@'localhost' IDENTIFIED BY 'StrongPassword123!';\nGRANT ALL PRIVILEGES ON invoiceninja.* TO 'ninjauser'@'localhost';\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5 &#8211; Download and Extract Invoice Ninja 5.13.2<\/h2>\n\n\n\n<p>The latest Invoice Ninja release is distributed as a <code>.tar<\/code> archive from the <a href=\"https:\/\/github.com\/invoiceninja\/invoiceninja\" target=\"_blank\" rel=\"noopener\">GitHub repository<\/a>. Fetch the latest version number automatically and download it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VER=$(curl -s https:\/\/api.github.com\/repos\/invoiceninja\/invoiceninja\/releases\/latest \\\n  | grep tag_name | cut -d '\"' -f 4 | sed 's\/v\/\/')\necho \"Downloading Invoice Ninja v${VER}...\"\ncurl -sL -o \/tmp\/invoiceninja.tar \\\n  \"https:\/\/github.com\/invoiceninja\/invoiceninja\/releases\/download\/v${VER}\/invoiceninja.tar\"<\/code><\/pre>\n\n\n\n<p>Extract the archive to <code>\/var\/www\/<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tar xf \/tmp\/invoiceninja.tar -C \/var\/www\/<\/code><\/pre>\n\n\n\n<p>The extracted directory name may include the version number. Rename it to a clean path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mv \/var\/www\/invoiceninja* \/var\/www\/invoiceninja<\/code><\/pre>\n\n\n\n<p>Verify the files are in place:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls \/var\/www\/invoiceninja\/<\/code><\/pre>\n\n\n\n<p>You should see directories like <code>app<\/code>, <code>bootstrap<\/code>, <code>config<\/code>, <code>public<\/code>, <code>vendor<\/code>, and the <code>.env.example<\/code> file.<\/p>\n\n\n\n<p>Clean up the downloaded archive:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -f \/tmp\/invoiceninja.tar<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6 &#8211; Configure the .env File<\/h2>\n\n\n\n<p>Invoice Ninja uses a <code>.env<\/code> file for all configuration. Copy the example file and edit it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/invoiceninja\nsudo cp .env.example .env\nsudo nano .env<\/code><\/pre>\n\n\n\n<p>Update the following values in the file. Replace the domain, database password, and mail settings with your actual values:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>APP_URL=https:\/\/invoice.example.com\nAPP_DEBUG=false\n\nDB_HOST=localhost\nDB_PORT=3306\nDB_DATABASE=invoiceninja\nDB_USERNAME=ninjauser\nDB_PASSWORD=StrongPassword123!\n\nMAIL_MAILER=smtp\nMAIL_HOST=smtp.example.com\nMAIL_PORT=587\nMAIL_USERNAME=your@email.com\nMAIL_PASSWORD=your-mail-password\nMAIL_ENCRYPTION=tls\nMAIL_FROM_ADDRESS=invoice@example.com\nMAIL_FROM_NAME=\"Invoice Ninja\"<\/code><\/pre>\n\n\n\n<p>Save and close the file when done.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7 &#8211; Set File Permissions<\/h2>\n\n\n\n<p>Apache runs as the <code>www-data<\/code> user. Set ownership and permissions so Invoice Ninja can read and write the files it needs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown -R www-data:www-data \/var\/www\/invoiceninja\nsudo chmod -R 755 \/var\/www\/invoiceninja\nsudo chmod -R 775 \/var\/www\/invoiceninja\/storage\nsudo chmod -R 775 \/var\/www\/invoiceninja\/bootstrap\/cache<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 8 &#8211; Configure Apache Virtual Host<\/h2>\n\n\n\n<p>Create an Apache virtual host configuration for Invoice Ninja. Replace <code>invoice.example.com<\/code> with your actual domain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tee \/etc\/apache2\/sites-available\/invoiceninja.conf > \/dev\/null &lt;&lt;'VHOST'\n&lt;VirtualHost *:80&gt;\n    ServerName invoice.example.com\n    DocumentRoot \/var\/www\/invoiceninja\/public\n\n    &lt;Directory \/var\/www\/invoiceninja\/public&gt;\n        AllowOverride All\n        Require all granted\n        Options -Indexes +FollowSymLinks\n    &lt;\/Directory&gt;\n\n    ErrorLog ${APACHE_LOG_DIR}\/invoiceninja-error.log\n    CustomLog ${APACHE_LOG_DIR}\/invoiceninja-access.log combined\n&lt;\/VirtualHost&gt;\nVHOST<\/code><\/pre>\n\n\n\n<p>Enable the site, the required Apache modules, and disable the default site:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2ensite invoiceninja.conf\nsudo a2dissite 000-default.conf\nsudo a2enmod rewrite\nsudo apache2ctl configtest<\/code><\/pre>\n\n\n\n<p>If the config test returns <code>Syntax OK<\/code>, restart Apache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 9 &#8211; Run Artisan Commands<\/h2>\n\n\n\n<p>Generate the application key, run database migrations, and optimize the application cache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/invoiceninja\nsudo -u www-data php artisan key:generate --force\nsudo -u www-data php artisan migrate --seed --force\nsudo -u www-data php artisan optimize<\/code><\/pre>\n\n\n\n<p>The <code>migrate --seed<\/code> command creates all database tables and populates them with the required default data. This may take a minute depending on your server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 10 &#8211; Configure Cron Job for Invoice Ninja<\/h2>\n\n\n\n<p>Invoice Ninja uses Laravel&#8217;s task scheduler for recurring invoices, sending reminders, and other background tasks. Add a cron job for the <code>www-data<\/code> user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo crontab -u www-data -e<\/code><\/pre>\n\n\n\n<p>Add this line at the bottom of the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>* * * * * cd \/var\/www\/invoiceninja && php artisan schedule:run >> \/dev\/null 2>&1<\/code><\/pre>\n\n\n\n<p>This runs the scheduler every minute. Laravel internally determines which tasks are due.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 11 &#8211; Configure UFW Firewall<\/h2>\n\n\n\n<p>If UFW is active on your server, allow HTTP and HTTPS traffic:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow 80\/tcp\nsudo ufw allow 443\/tcp\nsudo ufw reload<\/code><\/pre>\n\n\n\n<p>Verify the rules are in place:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw status<\/code><\/pre>\n\n\n\n<p>You should see ports 80 and 443 listed as ALLOW.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 12 &#8211; Access the Invoice Ninja Web UI<\/h2>\n\n\n\n<p>Open your browser and navigate to your domain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/invoice.example.com<\/code><\/pre>\n\n\n\n<p>You will see the Invoice Ninja setup wizard. It walks you through creating the first admin account, verifying your database connection, and configuring basic settings like company name and currency.<\/p>\n\n\n\n<p>After completing the wizard, log in with the admin credentials you just created. The dashboard gives you access to clients, invoices, payments, expenses, and reports.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enable HTTPS with Let&#8217;s Encrypt (Recommended)<\/h2>\n\n\n\n<p>For production use, you should secure Invoice Ninja with a TLS certificate. Install Certbot and obtain a free Let&#8217;s Encrypt certificate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y certbot python3-certbot-apache\nsudo certbot --apache -d invoice.example.com<\/code><\/pre>\n\n\n\n<p>Certbot will automatically configure Apache to redirect HTTP to HTTPS. Verify auto-renewal is set up:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo certbot renew --dry-run<\/code><\/pre>\n\n\n\n<p>After enabling HTTPS, make sure the <code>APP_URL<\/code> in your <code>.env<\/code> file starts with <code>https:\/\/<\/code>. Then clear the config cache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/invoiceninja\nsudo -u www-data php artisan optimize:clear\nsudo -u www-data php artisan optimize<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Production Tips<\/h2>\n\n\n\n<p>A few things to keep in mind for a production Invoice Ninja deployment:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Backups<\/strong> &#8211; Set up automated database backups with <code>mysqldump<\/code> or <code>mariadb-dump<\/code> and back up the <code>\/var\/www\/invoiceninja\/storage<\/code> directory where uploaded files and logos are stored.<\/li>\n\n\n\n<li><strong>Updates<\/strong> &#8211; Check the <a href=\"https:\/\/github.com\/invoiceninja\/invoiceninja\" target=\"_blank\" rel=\"noopener\">Invoice Ninja GitHub releases page<\/a> regularly. To update, download the new <code>.tar<\/code> file, extract it over the existing installation, and run <code>php artisan migrate --force<\/code> followed by <code>php artisan optimize<\/code>.<\/li>\n\n\n\n<li><strong>Email delivery<\/strong> &#8211; For reliable invoice email delivery, use a transactional email service like Postmark, Mailgun, or Amazon SES rather than your server&#8217;s local mail.<\/li>\n\n\n\n<li><strong>PDF generation<\/strong> &#8211; Invoice Ninja uses Snappdf for PDF generation. If PDF generation fails, make sure the <code>storage<\/code> directory has correct write permissions and that Chromium dependencies are installed.<\/li>\n\n\n\n<li><strong>Monitoring<\/strong> &#8211; Check the application logs at <code>\/var\/www\/invoiceninja\/storage\/logs\/laravel.log<\/code> when troubleshooting issues.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Invoice Ninja 5 is now installed and running on your Ubuntu 24.04 server with Apache, MariaDB, and PHP 8.3. You have a working LAMP-based invoicing platform with the scheduler configured for recurring tasks, and HTTPS ready for production traffic. From here, configure your payment gateways, customize your invoice templates, and start billing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Guides<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/install-and-configure-ssh-server-on-ubuntu\/\">Install and Configure SSH Server on Ubuntu<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-install-lamp-stack-on-ubuntu\/\">How to Install LAMP Stack on Ubuntu<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/install-odoo-18-with-lets-encrypt-ssl-on-ubuntu\/\">Install Let&#8217;s Encrypt SSL on Ubuntu with Certbot<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/install-mariadb-ubuntu\/\">How to Install MariaDB on Ubuntu<\/a><\/li>\n<\/ul>\n\n","protected":false},"excerpt":{"rendered":"<p>Invoice Ninja is a free, open-source invoicing, billing, and payment management platform built for freelancers and small businesses. It supports recurring invoices, expense tracking, time tracking, quotes, and integrates with popular payment gateways like Stripe, PayPal, and many others. Version 5 is a complete rewrite using Laravel and React, offering a modern UI and improved &#8230; <a title=\"Install Invoice Ninja 5 on Ubuntu 24.04\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/install-invoice-ninja-ubuntu\/\" aria-label=\"Read more about Install Invoice Ninja 5 on Ubuntu 24.04\">Read more<\/a><\/p>\n","protected":false},"author":21,"featured_media":130035,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,50,81],"tags":[38110],"class_list":["post-130008","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-linux-tutorials","category-ubuntu","tag-invoice-ninja-5-on-ubuntu"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/130008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=130008"}],"version-history":[{"count":2,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/130008\/revisions"}],"predecessor-version":[{"id":163090,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/130008\/revisions\/163090"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/130035"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=130008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=130008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=130008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}