0818.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Install InvoiceNinja - Invoice and Payment Manager - On Linux</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Linux,Payment Manager,Invoicing Software,InvoiceNinja,Invoice Ninja,Invoice,Homelab,Expense Tracker,Debian,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Install InvoiceNinja - Invoice and Payment Manager - On Linux">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="09/02/2024 07:59:22 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Install InvoiceNinja - Invoice and Payment Manager - On Linux</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is InvoiceNinja?</h2>
  26. <blockquote><em>[InvoiceNinja is a] powerful suite of features to invoice clients, facilitate payment, track-time &amp; tasks, expenses, and more. -<a href="https://www.invoiceninja.com/invoicing-features/" target="_blank">https://www.invoiceninja.com/invoicing-features/</a></em></blockquote>
  27. <h2>Installation</h2>
  28. <ol>
  29. <li>Log into the Linux device</li>
  30. <li>Run the following commands in a terminal window:
  31. <div class="codeBlock"># update software repositories<br />
  32. sudo apt update<br />
  33. # install prerequisites<br />
  34. sudo apt install curl wget zip lsb-release apt-transport-https ca-certificates git -y<br />
  35. # add the php gpg key<br />
  36. sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg<br />
  37. # add the php apt repository<br />
  38. echo &quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&quot; | sudo tee /etc/apt/sources.list.d/php.list<br />
  39. # update software repositories<br />
  40. sudo apt update<br />
  41. # install available software updates<br />
  42. sudo apt upgrade -y<br />
  43. # install Apache HTTPD and MySQL<br />
  44. sudo apt install apache2 mariadb-server mariadb-client -y<br />
  45. # install PHP components<br />
  46. sudo apt install php8.2 libapache2-mod-php8.2 php8.2-common php8.2-bcmath php8.2-gmp php8.2-gd php8.2-mbstring php8.2-xml php8.2-curl php8.2-zip php8.2-gmp php8.2-mysql php8.2-fpm php8.2-imagick php8.2-soap php8.2-common php8.2-intl -y<br />
  47. # configure the MySQL database<br />
  48. sudo su<br />
  49. mysql_secure_installation</div>
  50. </li>
  51. <li>Press Enter to login as root</li>
  52. <li>Type N and press Enter to not switch to unix socket authentication</li>
  53. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  54. <li>Type Y and press Enter to remove anonymous users</li>
  55. <li>Type Y and press Enter to disallow root login remotely</li>
  56. <li>Type Y and press Enter to remove the test database</li>
  57. <li>Type Y and press Enter to reload privilege tables</li>
  58. <li>Run the following command to login into MySQL:
  59. <div class="codeBlock">mysql -u root -p</div>
  60. </li>
  61. <li>Authenticate with the root password set earlier</li>
  62. <li>Run the following commands to create the InvoiceNinja database and database user
  63. <div class="codeBlock">CREATE DATABASE invoiceninja;<br />
  64. GRANT ALL ON invoiceninja.* to &#39;invoice_ninja_rw&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;!nv0ic3Ninj@!&#39;;<br />
  65. FLUSH PRIVILEGES;<br />
  66. EXIT;<br />
  67. exit</div>
  68. </li>
  69. <li>Continue with the following commands:
  70. <div class="codeBlock"># lookup latest invoiceninja release URL<br />
  71. regex=&#39;&quot;browser_download_url&quot;: &quot;(https:\/\/github.com\/invoiceninja\/invoiceninja\/releases\/download\/[^/]*\/invoiceninja\.tar)&quot;&#39; &amp;&amp; response=$(curl -H &quot;Accept: application/vnd.github.v3+json&quot; https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest) &amp;&amp; &#91;&#91; $response =~ $regex &#93;&#93; &amp;&amp; downloadURL=&quot;${BASH_REMATCH[1]}&quot;<br />
  72. # download the latest release<br />
  73. wget -O /tmp/invoiceninja.tar $downloadURL<br />
  74. # create target directory<br />
  75. mkdir /var/www/invoiceninja -p<br />
  76. # extract the download .tar archive<br />
  77. tar -xvzf /tmp/invoiceninja.tar -C /var/www/invoiceninja<br />
  78. # change permissions on the storage directory<br />
  79. sudo chmod 755 /var/www/invoiceninja/storage/ -R<br />
  80. # copy sample .env file<br />
  81. sudo cp /var/www/invoiceninja/.env.example /var/www/invoiceninja/.env<br />
  82. # create/edit apache site configuration<br />
  83. sudo nano /etc/apache2/sites-available/invoiceninja.conf</div>
  84. </li>
  85. <li>Paste the following configuration into the .conf file
  86. <p>&lt;Directory /var/www/invoiceninja/public&gt;<br />
  87. DirectoryIndex index.php<br />
  88. Require all granted<br />
  89. Options +FollowSymLinks<br />
  90. AllowOverride All<br />
  91. &lt;/Directory&gt;</p>
  92. </li>
  93. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  94. <li>Continue with the following commands:
  95. <div class="codeBlock"># edit .htaccess file<br />
  96. sudo nano /var/www/invoiceninja/public/.htaccess</div>
  97. </li>
  98. <li>Scroll to the bottom of the file and find the following line
  99. <p>RewriteRule ^ index.php [L]</p>
  100. </li>
  101. <li>Replace the line with the following
  102. <p>RewriteRule ^ /invoiceninja/index.php [L]</p>
  103. </li>
  104. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  105. <li>Continue with the following commands:
  106. <div class="codeBlock"># set the owner of the invoiceninja directory<br />
  107. sudo chown -R www-data:www-data /var/www/invoiceninja<br />
  108. # enable mod_rewrite<br />
  109. sudo a2enmod rewrite<br />
  110. # enable invoiceninja site<br />
  111. sudo a2ensite invoiceninja<br />
  112. # restart apache2 service<br />
  113. sudo systemctl restart apache2</div>
  114. </li>
  115. </ol>
  116. <h2>InvoiceNinja Web Installer</h2>
  117. <ol>
  118. <li>Open a web browser and navigate to http://DNSorIP/invoiceninja/setup</li>
  119. <li>The InvoiceNinja web setup should be load</li>
  120. <li>Enter the URL to use for the site (ie http://DNSorIP/invoiceninja)</li>
  121. <li>Uncheck the Require HTTPS option &gt; Click Test PDF</li>
  122. <li>Complete the Database Connection form as follows
  123. <p>Host: localhost<br />
  124. Port: 3306<br />
  125. Database: invoiceninja<br />
  126. Username: invoice_ninja_rw<br />
  127. Password: !nv0ic3Ninj@!</p>
  128. </li>
  129. <li>Click the Test connection button</li>
  130. <li>If you have an Email server, configure it under Email Settings, otherwise leave the driver as Log and click the Send test email button</li>
  131. <li>Completed the User Details form by entering a First Name, Last Name, Email and Password</li>
  132. <li>Check both I Agree checkboxes &gt; Click Submit</li>
  133. <li>If the page redirects to http://localhost, navigate to http://localhost/invoiceninja/index.php</li>
  134. <li>Login with the Email and Password setup earlier &gt; Click Login with email</li>
  135. <li>On the Welcome dialog, enter a company name and select the Light or Dark theme &gt; Click Save</li>
  136. <li>Welcome to InvoiceNinja</li>
  137. </ol>
  138. <p>Source: <a href="https://invoiceninja.github.io/docs/self-host-installation/" target="_blank">https://invoiceninja.github.io/docs/self-host-installation/</a></p> </div>
  139. </div>
  140. </body>
  141. </html>