0384.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Roll Your Own Google Analytics Alternative with Umami on Windows</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,Alternative To Google Analytics,Analytics,FOSS,Google Analytics,Google Analytics Alternative,MariaDB,MySQL,NodeJS,Open Source,Self-hosted Web Analytics,Umami,Umami Analytics,Web Analytics,Web Traffic,Windows,Microsoft Windows,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Roll Your Own Google Analytics Alternative with Umami on Windows">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="07/20/2024 04:55:22 AM" />
  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>Roll Your Own Google Analytics Alternative with Umami on Windows</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is Umami?</h2>
  26. <blockquote><em>Umami is a simple, fast, privacy-focused alternative to Google Analytics. -<a href="https://github.com/umami-software/umami" target="_blank">https://github.com/umami-software/umami</a></em></blockquote>
  27. <h2>Installation</h2>
  28. <ol>
  29. <li>Log into the Windows device</li>
  30. <li>Download the latest Umami release <a href="https://github.com/umami-software/umami/releases/latest" target="_blank">Download</a></li>
  31. <li>Download NodeJS <a href="https://nodejs.org/en/download/prebuilt-installer/current" target="_blank">Download</a></li>
  32. <li>Download the latest MySQL .msi installer <a href="https://dev.mysql.com/downloads/mysql/" target="_blank">Download</a></li>
  33. <li><label for="cb_li_917989_0">Download Microsoft Visual C++ </label><label for="cb_li_917989_0"><a href="https://aka.ms/vs/16/release/vc_redist.x64.exe" target="_blank">Download</a></label></li>
  34. <li>Install Microsoft Visual C++</li>
  35. <li>Run the downloaded MySQL installer, accepting the defaults and selecting the Typical installation when prompted</li>
  36. <li>When the installation completes, make sure &quot;Run MySQL Configurator&quot; is checked &gt; Click Finish</li>
  37. <li>Step through the installer accepting all the defaults</li>
  38. <li>Enter and confirm a root password when prompted</li>
  39. <li>Launch a Terminal or PowerShell window</li>
  40. <li>Run the following commands to login into MySQL
  41. <div class="codeBlock PS"># change directory to mysql\bin<br />
  42. cd &quot;C:\Program Files\MySQL\MySQL Server*\bin&quot;<br />
  43. # connect to the database<br />
  44. .\mysql -u root -p</div>
  45. </li>
  46. <li>Authenticate with the root password set during the database configuration</li>
  47. <li>Run the following commands to create the database and database user
  48. <div class="codeBlock PS">CREATE DATABASE umami DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<br />
  49. CREATE USER &#39;umami_rw&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;um@m1!&#39;;<br />
  50. GRANT ALL ON umami.* TO &#39;umami_rw&#39;@localhost;<br />
  51. FLUSH PRIVILEGES;<br />
  52. EXIT;<br />
  53. exit</div>
  54. </li>
  55. <li>Back in File Explorer, navigate to the Downloads directory</li>
  56. <li>Install NodeJS, accepting all defaults</li>
  57. <li>Extract the downloaded Umami files</li>
  58. <li>Rename the extracted folder Umami</li>
  59. <li>Cut the Umami folder to a location it can safely run from, C:\apps\Umami in this example</li>
  60. <li>Hold the SHIFT key and right click in the white space &gt; Open PowerShell windows here...</li>
  61. <li>Run the following commands in the PowerShell window
  62. <div class="codeBlock PS"># create .env file<br />
  63. notepad .\.env</div>
  64. </li>
  65. <li>Paste the following into the .env file
  66. <p>DATABASE_URL=mysql://umami_rw:um@m1!@localhost:3306/umami<br />
  67. HASH_SALT=SomethingSecure</p>
  68. </li>
  69. <li>Save the changes to .env and close Notepad</li>
  70. <li>Continue with the following commands in the PowerShell window
  71. <div class="codeBlock PS"># make sure .env didn&#39;t get a .txt extension<br />
  72. mv .\.env.txt .\.env<br />
  73. # install dependencies<br />
  74. npm install --force<br />
  75. # build umami<br />
  76. npm run build<br />
  77. # run umami<br />
  78. npm start</div>
  79. </li>
  80. <li>Open a web browser and navigate to http://DNSorIP:3000</li>
  81. <li>Login with the username admin and password umami</li>
  82. <li>Navigate to Settings &gt; Profile and click the Change Password button</li>
  83. <li>Enter the current password (umami) and enter and confirm the new password &gt; Click save</li>
  84. <li>Welcome to Umami</li>
  85. </ol>
  86. <h2>Run Umami on System Startup (Optional, but recommended)</h2>
  87. <ol>
  88. <li>Press CTRL + C to kill the running Umami process in the open PowerShell window</li>
  89. <li>Open a text editor and paste the following
  90. <p>:: Start Umami server<br />
  91. cd /D &quot;%~dp0&quot;<br />
  92. start &quot;Umami&quot; /b npm start</p>
  93. </li>
  94. <li>Save the file as umami.bat in the Umami directory, C:\apps\umami in this example</li>
  95. <li>Click on the Start Button &gt; Type task &gt; Launch Task Scheduler</li>
  96. <li>Right click the Task Scheduler Library folder in the left pane &gt; Create Basic Task...</li>
  97. <li>Set the name to Umami and optionally set a Description &gt; Click Next</li>
  98. <li>For the Trigger, select When the computer starts &gt; Click Next</li>
  99. <li>For the Action, select Start a program &gt; Click Next</li>
  100. <li>Complete the form fields as follows:
  101. <p>Program/script: &quot;C:\apps\Umami\umami.bat&quot;<br />
  102. Add arguments:<br />
  103. Start in:</p>
  104. </li>
  105. <li>Click Next</li>
  106. <li>Check the Open the Properties dialog checkbox &gt; Click Finish</li>
  107. <li>In the Properties dialog, click the Change User or Group... button</li>
  108. <li>Type System in the Object name field &gt; Click OK</li>
  109. <li>Check the Run with highest privileges box</li>
  110. <li>Click OK to create the scheduled task</li>
  111. <li>Right click the Umami task &gt; Run</li>
  112. <li>Refresh the open web browser to verify Umami is now running from the scheduled task</li>
  113. </ol>
  114. <p>Documentation: <a href="https://github.com/umami-software/umami" target="_blank">https://github.com/umami-software/umami</a></p> </div>
  115. </div>
  116. </body>
  117. </html>