0777.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Running Firefly III on Linux [PHP Based Personal Finance Manager]</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,FireFly III,PHP,MariaDB,MySQL,Apache HTTPD,Personal Finances,Personal Finance Manager,Personal Accounting,Debian,FOSS,Free Open Source Software,Free Software,Open Source Software,Linux,Open-Source,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Running Firefly III on Linux [PHP Based Personal Finance Manager]">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="07/18/2023 03:21:28 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>Running Firefly III on Linux [PHP Based Personal Finance Manager]</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is Firefly III?</h2>
  26. <blockquote><em>&quot;Firefly III&quot; is a (self-hosted) manager for your personal finances. It can help you keep track of your expenses and income, so you can spend less and save more. -<a href="https://docs.firefly-iii.org/firefly-iii/installation/self_hosted/?mtm_campaign=docu-internal&amp;mtm_kwd=self_hosted" target="_blank">https://docs.firefly-iii.org/firefly-iii/installation/self_hosted/?mtm_campaign=docu-internal&amp;mtm_kwd=self_hosted</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 php libapache2-mod-php php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-mbstring php8.1-bcmath php8.1-zip php8.1-intl php-sodium -y<br />
  47. # install composer<br />
  48. curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer<br />
  49. # configure the MySQL database<br />
  50. sudo su<br />
  51. mysql_secure_installation</div>
  52. </li>
  53. <li>Press Enter to login as root</li>
  54. <li>Type N and press Enter to not switch to unix socket authentication</li>
  55. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  56. <li>Type Y and press Enter to remove anonymous users</li>
  57. <li>Type Y and press Enter to disallow root login remotely</li>
  58. <li>Type Y and press Enter to remove the test database</li>
  59. <li>Type Y and press Enter to reload privilege tables</li>
  60. <li>Run the following command to login into MySQL:
  61. <div class="codeBlock">mysql -u root -p</div>
  62. </li>
  63. <li>Authenticate with the root password set earlier</li>
  64. <li>Run the following commands to create the Firefly database and database user
  65. <div class="codeBlock">CREATE DATABASE firefly;<br />
  66. GRANT ALL ON firefly.* to &#39;firefly_rw&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;f!r3f1y:)&#39;;<br />
  67. FLUSH PRIVILEGES;<br />
  68. EXIT;<br />
  69. exit</div>
  70. </li>
  71. <li>Continue with the following commands:
  72. <div class="codeBlock"># create the firefly app<br />
  73. sudo composer create-project grumpydictator/firefly-iii --no-dev --prefer-dist /var/www/firefly<br />
  74. # set ownership of the firefly directory<br />
  75. sudo chown -R www-data:www-data /var/www/firefly<br />
  76. # limit permissions on storage<br />
  77. sudo chmod -R 775 /var/www/firefly/storage<br />
  78. # change directory to the application folder<br />
  79. cd /var/www/firefly<br />
  80. # edit the .env file<br />
  81. sudo nano /var/www/firefly/.env</div>
  82. </li>
  83. <li>Scroll through the .env file and modify the following values
  84. <p>SITE_OWNER=&lt;% admin email address %&gt;<br />
  85. TZ=&lt;% timezone %&gt;<br />
  86. DB_CONNECTION=mysql<br />
  87. DB_HOST=127.0.0.1<br />
  88. DB_PORT=3306<br />
  89. DB_DATABASE=firefly<br />
  90. DB_USERNAME=firefly_rw<br />
  91. DB_PASSWORD=f!r3f1y:)</p>
  92. </li>
  93. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  94. <li>Continue with the following commands in terminal
  95. <div class="codeBlock"># initialize the database<br />
  96. php artisan migrate:refresh --seed<br />
  97. php artisan firefly-iii:upgrade-database<br />
  98. php artisan passport:install<br />
  99. # create firefly apache configuration<br />
  100. sudo nano /etc/apache2/sites-available/firefly.conf</div>
  101. </li>
  102. <li>Paste the following configuration into firefly.conf
  103. <p>Alias /firefly &quot;/var/www/firefly/public/&quot;<br />
  104. <directory firefly="" public="" var="" www=""><br />
  105. Options FollowSymlinks Includes ExecCGI<br />
  106. AllowOverride All<br />
  107. Require all granted<br />
  108. Order allow,deny<br />
  109. allow from all</directory></p>
  110. </li>
  111. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  112. <li>Run the following command to enable the Firefly site
  113. <div class="codeBlock"># enable rewrite module<br />
  114. sudo a2enmod rewrite<br />
  115. # enable the firefly site<br />
  116. sudo a2ensite firefly<br />
  117. # restart the apache2 service<br />
  118. sudo systemctl restart apache2</div>
  119. </li>
  120. <li>Open a web browser and navigate to http://DNSorIP/firefly</li>
  121. <li>Enter an email address and password &gt; Click Register</li>
  122. <li>Welcome to Firefly III</li>
  123. </ol> </div>
  124. </div>
  125. </body>
  126. </html>