FedoraRHEL Based

How To Install Invoice Ninja on Fedora 43

Install Invoice Ninja on Fedora 42

Managing invoices, tracking expenses, and handling client payments are essential tasks for freelancers and small businesses. Invoice Ninja provides a comprehensive open-source solution that simplifies these financial operations while maintaining complete control over your data. This guide walks you through the complete installation process of Invoice Ninja on Fedora 43, covering everything from initial system setup to SSL security configuration.

By following this tutorial, you’ll have a fully functional invoicing platform running on your Fedora 43 server. The installation leverages the LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) to create a robust environment for your billing operations. Whether you’re migrating from commercial solutions like FreshBooks or starting fresh, this step-by-step guide ensures a smooth deployment.

What is Invoice Ninja?

Invoice Ninja is a powerful open-source invoicing and billing platform designed specifically for freelancers, small businesses, and medium-sized enterprises. Built on the Laravel PHP framework, it provides professional-grade financial management tools without the recurring costs associated with commercial alternatives. The platform excels at creating and sending professional invoices, managing client relationships, tracking project time, and monitoring payment status in real-time.

Key features include customizable invoice templates that reflect your brand identity, automated recurring billing for subscription-based services, and comprehensive multi-currency support for international clients. The software integrates seamlessly with popular payment gateways including PayPal, Stripe, Authorize.net, and WePay, enabling clients to pay invoices directly online. Additionally, Invoice Ninja offers detailed financial reporting, expense tracking, project management capabilities, and time tracking functionality. It supports multiple languages and can generate quotes, proposals, and credit notes alongside standard invoices. As a self-hosted solution, you maintain complete ownership of your financial data while enjoying the flexibility to customize the platform according to your specific business requirements.

Prerequisites and System Requirements

Before beginning the Invoice Ninja installation on Fedora 43, ensure your system meets the necessary requirements. A server or virtual machine running Fedora 43 with at least 2GB RAM and 10GB available disk space provides adequate resources for small to medium deployments. You’ll need root or sudo access to install packages and configure system services. While optional, having a registered domain name pointing to your server IP address enables professional email delivery and SSL certificate installation.

The software stack requires Apache or Nginx web server to serve the application. PHP version 8.3 or higher is mandatory, along with essential extensions including php-mysqlnd for database connectivity, php-gd for image processing, php-mbstring for multi-byte string handling, php-curl for HTTP requests, php-xml for XML parsing, php-zip for archive management, php-bcmath for precise financial calculations, and php-gmp for arbitrary precision arithmetic. Your database needs MySQL 8.0+ or MariaDB 10.3+ as the data storage backend. Composer dependency manager handles PHP package installation automatically.

For production environments, configure your firewall to allow HTTP (port 80) and HTTPS (port 443) traffic. An SSL certificate from Let’s Encrypt provides encrypted connections at no cost. Ensure your server has consistent internet connectivity for downloading packages and receiving software updates.

Step 1: Update System Packages

Maintaining current system packages prevents compatibility issues and security vulnerabilities during installation. Fedora’s DNF package manager handles system updates efficiently. Begin by opening your terminal and connecting to your Fedora 43 server via SSH.

Execute the following command to update all installed packages:

sudo dnf update -y

This command fetches the latest package lists from Fedora repositories and upgrades outdated packages to their newest versions. The -y flag automatically confirms installation prompts. Depending on your system’s current state, this process may take several minutes. If kernel updates are installed, reboot your server to apply changes:

sudo reboot

After rebooting, verify your Fedora version by running:

cat /etc/fedora-release

This displays the exact Fedora release number, confirming you’re running version 43. Keeping your system updated establishes a stable foundation for the Invoice Ninja installation and ensures all dependencies resolve correctly.

Step 2: Install Apache Web Server

Apache HTTP Server powers millions of websites worldwide and provides excellent PHP integration. Fedora 43 includes Apache in its default repositories, making installation straightforward.

Install Apache using DNF:

sudo dnf install httpd -y

Once installation completes, enable Apache to start automatically during system boot:

sudo systemctl enable httpd

Start the Apache service immediately:

sudo systemctl start httpd

Verify Apache is running properly:

sudo systemctl status httpd

You should see “active (running)” in green text, indicating successful startup. Configure Fedora’s firewall to permit web traffic. By default, firewalld blocks incoming HTTP and HTTPS connections:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

These commands permanently allow web traffic through ports 80 and 443. Test your Apache installation by opening a web browser and navigating to your server’s IP address. You should see the default Fedora test page, confirming Apache serves content correctly. The web server is now ready to host Invoice Ninja.

Step 3: Install and Configure MariaDB

MariaDB serves as the relational database management system storing all Invoice Ninja data including invoices, clients, payments, and system configuration. Fedora 43 provides recent MariaDB versions in its official repositories.

Install MariaDB server and client packages:

sudo dnf install mariadb-server mariadb -y

Enable MariaDB to launch at system startup:

sudo systemctl enable mariadb

Start the database service:

sudo systemctl start mariadb

Confirm MariaDB is active:

sudo systemctl status mariadb

Secure your MariaDB installation by running the security script:

sudo mysql_secure_installation

The script prompts several security-related questions. Since this is a fresh installation, press Enter when asked for the current root password. Type Y to set a root password, then enter a strong password twice. Answer Y to remove anonymous users, disallow remote root login, remove the test database, and reload privilege tables. These steps significantly improve database security.

Create a dedicated database and user account for Invoice Ninja. Log into MariaDB as root:

sudo mysql -u root -p

Enter your root password when prompted. Execute the following SQL commands:

CREATE DATABASE invoiceninja CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'ninjauser'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON invoiceninja.* TO 'ninjauser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Replace StrongPassword123! with a secure password combining uppercase, lowercase, numbers, and special characters. The utf8mb4 character set ensures proper handling of international characters and emoji in invoices. Note these credentials as you’ll need them during Invoice Ninja configuration.

Step 4: Install PHP and Required Extensions

Invoice Ninja requires PHP 8.3 or newer with specific extensions enabling core functionality. Fedora 43 includes PHP 8.3 in default repositories, simplifying the installation process.

Install PHP and PHP-FPM:

sudo dnf install php php-fpm -y

Install all required PHP extensions:

sudo dnf install php-mysqlnd php-gd php-cli php-curl php-mbstring php-xml php-zip php-bcmath php-gmp php-fileinfo php-pdo php-intl -y

Each extension serves specific purposes: php-mysqlnd enables MariaDB database connections, php-gd handles image generation for invoice PDFs, php-mbstring processes multi-byte strings in different languages, php-curl manages HTTP requests for payment gateway APIs, php-xml parses XML configuration files, php-zip compresses and extracts archive files, php-bcmath performs precise decimal calculations essential for financial data, and php-gmp handles large number arithmetic. The php-intl extension provides internationalization support for multiple currencies and date formats.

Configure PHP settings by editing the php.ini file:

sudo nano /etc/php.ini

Locate and modify these directives:

memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
date.timezone = Asia/Jakarta

Adjust date.timezone to match your location. These settings allocate sufficient memory for Invoice Ninja operations, allow uploading larger file attachments, and set appropriate execution timeouts for complex reports. Save changes by pressing Ctrl+O, then exit with Ctrl+X.

Restart Apache to load PHP modules:

sudo systemctl restart httpd

Verify PHP installation by creating a test file:

echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php

Access http://your-server-ip/info.php in your browser to view PHP configuration details. Remove this file after verification for security:

sudo rm /var/www/html/info.php

Step 5: Install Composer

Composer manages PHP dependencies required by Invoice Ninja’s Laravel framework. Installing Composer globally allows easy package management.

Download the Composer installer:

cd /tmp
curl -sS https://getcomposer.org/installer | php

This downloads and executes the official Composer installation script. Move the Composer binary to a system-wide location:

sudo mv composer.phar /usr/local/bin/composer

Make Composer executable:

sudo chmod +x /usr/local/bin/composer

Verify successful installation:

composer --version

The output displays the installed Composer version, typically 2.x or higher. Composer will automatically handle Invoice Ninja’s extensive dependency tree, downloading and configuring all required Laravel packages.

Step 6: Download and Install Invoice Ninja

Create a dedicated directory for Invoice Ninja within Apache’s web root:

sudo mkdir -p /var/www/invoiceninja
cd /var/www/invoiceninja

Download the latest stable release from GitHub. Check the Invoice Ninja releases page for the current version number:

sudo wget https://github.com/invoiceninja/invoiceninja/releases/download/v5.12.28/invoiceninja.tar

Replace v5.12.28 with the latest version if a newer release exists. Extract the archive:

sudo tar -xvf invoiceninja.tar

The extraction creates all necessary application files and directories. Navigate to the Invoice Ninja directory:

cd /var/www/invoiceninja

Install PHP dependencies using Composer:

sudo composer install --no-dev -o

The --no-dev flag excludes development dependencies, reducing installation size and improving performance. The -o flag optimizes the autoloader for production use. This process downloads hundreds of packages and may take several minutes depending on your connection speed.

Set correct file ownership and permissions. Apache runs as the apache user on Fedora:

sudo chown -R apache:apache /var/www/invoiceninja
sudo chmod -R 755 /var/www/invoiceninja
sudo chmod -R 775 /var/www/invoiceninja/storage
sudo chmod -R 775 /var/www/invoiceninja/bootstrap/cache

These permissions allow Apache to read application files while maintaining security. The storage and cache directories require write access for logging and temporary file creation.

Step 7: Configure Invoice Ninja Environment

Invoice Ninja uses environment variables for configuration. Copy the example environment file:

sudo cp .env.example .env

Edit the configuration file:

sudo nano .env

Modify the following essential parameters:

APP_URL=http://your-domain.com
APP_DEBUG=false
APP_KEY=

DB_HOST=localhost
DB_DATABASE=invoiceninja
DB_USERNAME=ninjauser
DB_PASSWORD=StrongPassword123!

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-email-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@gmail.com
MAIL_FROM_NAME="Your Company Name"

Replace your-domain.com with your actual domain or server IP. Set APP_DEBUG=false for production environments to prevent exposing sensitive error information. Update database credentials to match those created earlier. Configure MAIL settings according to your email provider’s SMTP requirements. Gmail, Office 365, and other providers have specific configuration requirements available in their documentation.

Generate an application encryption key:

sudo php artisan key:generate

This command creates a random encryption key and automatically updates the .env file. The key encrypts sensitive data including passwords and API tokens.

Run database migrations to create all necessary tables:

sudo php artisan migrate:fresh --seed

The migration process creates tables for invoices, clients, payments, products, and other Invoice Ninja entities. The --seed flag populates initial configuration data. When prompted, confirm you want to run migrations by typing yes.

Step 8: Configure Apache Virtual Host

Create a virtual host configuration file for Invoice Ninja:

sudo nano /etc/httpd/conf.d/invoiceninja.conf

Add the following configuration:

<VirtualHost *:80>
    ServerName your-domain.com
    ServerAlias www.your-domain.com
    DocumentRoot /var/www/invoiceninja/public

    <Directory /var/www/invoiceninja/public>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/invoiceninja-error.log
    CustomLog /var/log/httpd/invoiceninja-access.log combined
</VirtualHost>

Replace your-domain.com with your actual domain name. The DocumentRoot points to the public directory, not the application root, for security purposes. AllowOverride All enables Laravel’s .htaccess file for URL rewriting. Save and exit the editor.

Test Apache configuration syntax:

sudo apachectl configtest

You should see “Syntax OK”. If errors appear, review your virtual host configuration for typos.

Fedora uses SELinux for enhanced security, which may block Apache from accessing Invoice Ninja files. Set appropriate SELinux contexts:

sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/invoiceninja/storage(/.*)?"
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/invoiceninja/bootstrap/cache(/.*)?"
sudo restorecon -Rv /var/www/invoiceninja/

If semanage is not found, install the required package:

sudo dnf install policycoreutils-python-utils -y

Allow Apache to make network connections for payment gateway APIs:

sudo setsebool -P httpd_can_network_connect 1

Restart Apache to apply all changes:

sudo systemctl restart httpd

Step 9: Complete Web-Based Installation

Open your web browser and navigate to your Invoice Ninja installation at http://your-domain.com. The setup wizard performs system checks, verifying all requirements are met. If any checks fail, return to previous steps to install missing components.

The database configuration screen appears if checks pass. Invoice Ninja reads configuration from your .env file, so database details should populate automatically. Click “Test Connection” to verify database connectivity. Successful connection proceeds to account creation.

Create your administrator account by providing an email address and secure password. This account manages all Invoice Ninja settings and has full system access. Enter your company name, which appears on invoices and client communications. Select your country, currency, and language preferences.

Configure basic settings including invoice number format, payment terms, and tax rates. These settings customize Invoice Ninja for your business but can be modified later through the admin panel. Click “Save” to finalize installation.

Invoice Ninja creates all necessary database entries and initializes your account. You’ll be redirected to the dashboard where you can begin creating invoices, adding clients, and configuring payment gateways. Explore the settings panel to customize invoice templates, enable specific payment processors, and configure email notifications.

Step 10: Secure Invoice Ninja with SSL Certificate

HTTPS encryption protects sensitive financial data transmitted between clients and your Invoice Ninja server. Let’s Encrypt provides free SSL certificates with automated renewal.

Install Certbot and the Apache plugin:

sudo dnf install certbot python3-certbot-apache -y

Obtain and install an SSL certificate:

sudo certbot --apache -d your-domain.com -d www.your-domain.com

Certbot prompts for your email address for renewal notifications and asks you to agree to terms of service. It automatically configures Apache with SSL settings and creates a redirect from HTTP to HTTPS. Choose option 2 to redirect all traffic to HTTPS when prompted.

Update Invoice Ninja’s environment configuration to use HTTPS:

sudo nano /var/www/invoiceninja/.env

Change the APP_URL:

APP_URL=https://your-domain.com

Save and exit. Clear Invoice Ninja’s cache:

sudo php artisan config:clear
sudo php artisan cache:clear

Test certificate renewal:

sudo certbot renew --dry-run

Successful output confirms automatic renewal is configured correctly. Certbot creates a systemd timer that checks for renewal twice daily. Certificates renew automatically 30 days before expiration.

Restart Apache to apply all SSL changes:

sudo systemctl restart httpd

Access your Invoice Ninja installation at https://your-domain.com to verify SSL is active. Your browser should display a padlock icon indicating a secure connection.

Post-Installation Configuration

Invoice Ninja requires scheduled tasks for automated functions including recurring invoice generation, payment reminders, and report generation. Configure a cron job to execute the Laravel scheduler.

Edit the Apache user’s crontab:

sudo crontab -e -u apache

Add the following line:

* * * * * cd /var/www/invoiceninja && php artisan schedule:run >> /dev/null 2>&1

This executes the scheduler every minute. Laravel’s internal scheduler determines which tasks run at specific times. Save and exit the crontab editor.

Configure queue workers to process background jobs. Create a systemd service file:

sudo nano /etc/systemd/system/invoiceninja-worker.service

Add this configuration:

[Unit]
Description=Invoice Ninja Queue Worker
After=network.target

[Service]
Type=simple
User=apache
Group=apache
WorkingDirectory=/var/www/invoiceninja
ExecStart=/usr/bin/php /var/www/invoiceninja/artisan queue:work --sleep=3 --tries=3
Restart=always

[Install]
WantedBy=multi-user.target

Enable and start the worker service:

sudo systemctl enable invoiceninja-worker
sudo systemctl start invoiceninja-worker

Test email functionality by navigating to Settings > Email Settings in the Invoice Ninja admin panel. Send a test email to verify SMTP configuration works correctly. Properly configured email ensures clients receive invoices and payment confirmations.

Implement regular backups to protect your financial data. Create a backup script:

sudo nano /usr/local/bin/backup-invoiceninja.sh

Add backup commands:

#!/bin/bash
BACKUP_DIR="/backups/invoiceninja"
DATE=$(date +%Y%m%d_%H%M%S)

mkdir -p $BACKUP_DIR

# Backup database
mysqldump -u ninjauser -p'StrongPassword123!' invoiceninja > $BACKUP_DIR/database_$DATE.sql

# Backup files
tar -czf $BACKUP_DIR/files_$DATE.tar.gz /var/www/invoiceninja

# Keep only last 30 days of backups
find $BACKUP_DIR -type f -mtime +30 -delete

Make the script executable:

sudo chmod +x /usr/local/bin/backup-invoiceninja.sh

Schedule daily backups with cron:

sudo crontab -e

Add:

0 2 * * * /usr/local/bin/backup-invoiceninja.sh

This backs up your database and files daily at 2 AM.

Troubleshooting Common Issues

Permission errors typically occur when Apache cannot write to storage or cache directories. Fix permissions:

sudo chown -R apache:apache /var/www/invoiceninja
sudo chmod -R 755 /var/www/invoiceninja
sudo chmod -R 775 /var/www/invoiceninja/storage
sudo chmod -R 775 /var/www/invoiceninja/bootstrap/cache

Database connection errors indicate incorrect credentials or MariaDB service issues. Verify database is running:

sudo systemctl status mariadb

Test database connection manually:

mysql -u ninjauser -p invoiceninja

If connection fails, review credentials in /var/www/invoiceninja/.env and ensure they match those created during database setup.

Missing PHP extensions cause various functionality issues. List all loaded PHP modules:

php -m

Compare output against required extensions listed earlier. Install any missing extensions using sudo dnf install php-extension-name.

SELinux blocks on Fedora prevent Apache from accessing files or making network connections. Check for SELinux denials:

sudo ausearch -m avc -ts recent

If denials appear, adjust SELinux contexts as described in Step 8 or temporarily set SELinux to permissive mode for testing:

sudo setenforce 0

Remember to re-enable enforcing mode after identifying the issue:

sudo setenforce 1

SSL mixed content warnings occur when HTTPS pages load HTTP resources. Ensure APP_URL in .env uses https:// and clear application cache. Check browser console for specific resources causing issues.

Apache configuration errors prevent the web server from starting. Test configuration syntax:

sudo apachectl configtest

Review error logs for specific issues:

sudo tail -f /var/log/httpd/invoiceninja-error.log

Common mistakes include missing closing tags in virtual host configuration or incorrect file paths.

Congratulations! You have successfully installed InvoiceNinja. Thanks for using this tutorial for installing Invoice Ninja free invoice generator on your Fedora 43 Linux system. For additional help or useful information, we recommend you check the official Invoice Ninja website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button