# Install InvoiceNinja - Invoice and Payment Manager - On Windows

## What is InvoiceNinja?

> [InvoiceNinja is a] powerful suite of features to invoice clients, facilitate payment, track-time & tasks, expenses, and more. -https://www.invoiceninja.com/invoicing-features/

## Installation

1. Download XAMPP Download
2. Download InvoiceNinja Download
3. Download Microsoft Visual C++ Download
4. Install Microsoft Visual C++
5. Right click the downloaded XAMPP file > Extract All...
6. Right click the downloaded InvoiceNinja .zip file > Extract All...
7. Cut the invoiceninja folder inside the XAMPP directory
8. Navigate into the invoiceninja folder > Create a copy of .env.example
9. Rename the copy .env
10. Navigate into the invoiceninja/public folder
11. Edit the .htaccess file in a text editor
12. Scroll to the bottom of the file and find the following lines and add the /invoiceninja/ folder to the RewriteRule

    RewriteRule ^ %1 [L,R=301]
    RewriteRule ^ index.php [L]

13. Replace the line with the following

    RewriteRule ^ /invoiceninja/%1 [L,R=301]
    RewriteRule ^ /invoiceninja/index.php [L]

14. Save the changes and close the editor
15. Navigate back to the Downloads directory and copy the extracted XAMPP directory to a safe location to run from, C:\Program Files for example
16. Run XAMPP/setup_xampp.bat to update the configuration files with the new server location
17. Navigate into XAMPP/PHP and edit php.ini in a text editor
18. Find the list of extensions and make sure the following are enabled by removing the ; at the start of the line

    extension=curl
    extension=fileinfo
    extension=gd
    extension=gmp
    extension=mbstring
    extension=mysqli
    extension=openssl
    extension=pdo_mysql

19. Save the changes to php.ini
20. Navigate into XAMPP/Apache/conf and edit httpd.conf in a text editor
21. Uncomment the following Apache modules by removing the # in front of them

    LoadModule deflate_module modules/mod_deflate.so
    LoadModule filter_module modules/mod_filter.so

22. Search the file for <Directory /><directory></directory>
23. Overwrite the existing values with the following

    Options Indexes FollowSymLinks
    AllowOverride All

24. Paste the following at the bottom of the httpd.conf file

    Alias /invoiceninja "C:/Program Files/xampp/invoiceninja/public"
    <Directory "C:/Program Files/xampp/invoiceninja/public">
    DirectoryIndex index.php
    Options +FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>

25. Save the changes and close out of the editor
26. Click the Start button > Search Control > Click Control Panel
27. Click on System > Advanced system settings
28. Click the Environment Variables...
29. Edit the System Path variable
30. Click the New button
31. Add the PHP installation directory (ie C:\Program Files\xampp\PHP\)
32. Click the New button
33. Add the MySQL installation directory (ie C:\Program Files\xampp\mysql\bin\)
34. Click OK to all open dialog windows
35. Back in File Explorer, runun XAMPP/xampp-control.exe
36. Click the Start buttons next to Apache and MySQL
37. Navigate to XAMPP/mysql/bin
38. Hold the SHIFT key and right click in the white space > Open PowerShell window here...
39. Run the following commands in the PowerShell window to setup the database
    .\mysql -u root
    CREATE DATABASE invoiceninja;
    GRANT ALL ON invoiceninja.* to 'invoice_ninja_rw'@'localhost' IDENTIFIED BY '!nv0ic3Ninj@!';
    FLUSH PRIVILEGES;
    EXIT;
    exit

## InvoiceNinja Web Installer

1. Open a web browser and navigate to http://DNSorIP/invoiceninja/setup
2. The InvoiceNinja web setup should be load
3. Enter the URL to use for the site (ie http://DNSorIP/invoiceninja)
4. Uncheck the Require HTTPS option > Click Test PDF
5. Complete the Database Connection form as follows

   Host: localhost
   Port: 3306
   Database: invoiceninja
   Username: invoice_ninja_rw
   Password: Click the Test connection button

6. If you have an Email server, configure it under Email Settings, otherwise leave the driver as Log and click the Send test email button
7. Completed the User Details form by entering a First Name, Last Name, Email and Password
8. Check both I Agree checkboxes > Click Submit
9. If the page redirects to http://localhost, navigate to http://localhost/invoiceninja/index.php
10. Login with the Email and Password setup earlier > Click Login with email
11. On the Welcome dialog, enter a company name and select the Light or Dark theme > Click Save
12. Welcome to InvoiceNinja

Source: https://invoiceninja.github.io/docs/self-host-installation/