0820.html 6.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Run InvoiceNinja - Invoice and Payment Manager - in Docker</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Docker Made Easy,Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Container,Containerization,Docker,Docker How To,Docker Installation Tutorial,Docker Simplified,Docker Tutorial,Linux,Homelab,Ubuntu,InvoiceNinja,Invoice Ninja,Invoice,Payment Manager,Invoicing Software,Expense Tracker,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Run InvoiceNinja - Invoice and Payment Manager - in Docker">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="05/24/2024 01:23:25 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>Run InvoiceNinja - Invoice and Payment Manager - in Docker</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>Installing Docker</h2>
  28. <ol>
  29. <li>Log into the Linux based device</li>
  30. <li>Run the following commands in the terminal
  31. <div class="codeBlock"># install prerequisites<br />
  32. sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
  33. # add docker gpg key<br />
  34. curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
  35. # add docker software repository<br />
  36. sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
  37. # install docker<br />
  38. sudo apt install docker-ce docker-compose containerd.io -y<br />
  39. # enable and start docker service<br />
  40. sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
  41. # add the current user to the docker group<br />
  42. sudo usermod -aG docker $USER<br />
  43. # reauthenticate for the new group membership to take effect<br />
  44. su - $USER</div>
  45. </li>
  46. </ol>
  47. <h2>Running the InvoiceNinja Container</h2>
  48. <ol>
  49. <li>Now that Docker is installed, run the following commands to setup the InvoiceNinja Docker container and run it
  50. <div class="codeBlock"># create working directories<br />
  51. mkdir ~/docker/invoiceninja/{public,storage} -p &amp;&amp; mkdir ~/docker/mariadb -p &amp;&amp; mkdir ~/docker/nginx -p<br />
  52. # download the invoiceninja nginx config<br />
  53. wget -O ~/docker/nginx/invoiceninja.conf https://raw.githubusercontent.com/invoiceninja/dockerfiles/master/config/nginx/in-vhost.conf<br />
  54. # update the config file with the invoiceninja container name<br />
  55. sed -i &#39;s/fastcgi_pass app:9000;/fastcgi_pass invoiceninja:9000;/g&#39; ~/docker/nginx/invoiceninja.conf &amp;&amp; sed -i &#39;s/listen 80 default_server;/listen 80;/g&#39; ~/docker/nginx/invoiceninja.conf<br />
  56. # set ownership on the working directories<br />
  57. sudo chown &quot;$USER&quot;:&quot;$USER&quot; ~/docker -R<br />
  58. # allow the container to write to files/ and settings.php<br />
  59. sudo chmod a+rwx -R ~/docker/invoiceninja<br />
  60. # run the mariadb docker container<br />
  61. docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=r00tp@$$ -e MYSQL_USER=invoiceninja_rw -e MYSQL_PASSWORD=&#39;!nv0ic3Ninj@!&#39; -e MYSQL_DATABASE=invoiceninja -v ~/docker/mariadb:/var/lib/mysql -p 3306:3006 --restart=unless-stopped mariadb:latest<br />
  62. # generate application key<br />
  63. docker run --rm -it invoiceninja/invoiceninja php artisan key:generate --show<br />
  64. # run the invoiceninja container<br />
  65. # change the IN_USER_EMAIL and IN_PASSWORD variables to setup the default user<br />
  66. # update the APP_KEY variable with the key generated earlier<br />
  67. docker run -d --name=invoiceninja --link mariadb -p 8080:80 -v ~/docker/invoiceninja/public:/var/www/app/public -v ~/docker/invoiceninja/storage:/var/www/app/storage -e IN_USER_EMAIL=&#39;i12bretro@i12bretro.local&#39; -e IN_PASSWORD=&#39;SomethingSecure!&#39; -e REQUIRE_HTTPS=false -e APP_ENV=&#39;production&#39; -e APP_DEBUG=0 -e APP_URL=&#39;http://ubuntuserver.local:8080&#39; -e APP_KEY=&#39;&lt;%key generated earlier%&gt;&#39; -e APP_CIPHER=&#39;AES-256-CBC&#39; -e DB_TYPE=&#39;mysql&#39; -e DB_STRICT=&#39;false&#39; -e DB_HOST=&#39;mariadb&#39; -e DB_DATABASE=&#39;invoiceninja&#39; -e DB_USERNAME=&#39;invoiceninja_rw&#39; -e DB_PASSWORD=&#39;!nv0ic3Ninj@!&#39; --restart=unless-stopped invoiceninja/invoiceninja<br />
  68. # run the nginx container<br />
  69. docker run -d --name nginx --link invoiceninja -p 8081:80 -v ~/docker/invoiceninja/public:/var/www/app/public:ro -v ~/docker/nginx:/etc/nginx/conf.d:ro --restart=unless-stopped nginx</div>
  70. </li>
  71. <li>Open a web browser and navigate to http://DNSorIP:8081</li>
  72. <li>Login with the Email and Password setup in the InvoiceNinja container variables &gt; Click Login with email</li>
  73. <li>On the Welcome dialog, enter a company name and select the Light or Dark theme &gt; Click Save</li>
  74. <li>Welcome to InvoiceNinja</li>
  75. </ol>
  76. <p>Documentation: <a href="https://hub.docker.com/r/invoiceninja/invoiceninja" target="_blank">https://hub.docker.com/r/invoiceninja/invoiceninja</a></p> </div>
  77. </div>
  78. </body>
  79. </html>