console
Thomas Johnson <https://johnson.tj/>
Andreas Fuchs <https://anfuchs.de/>
lang-nodejs
web
analytics
umami is a simple, easy to use, self-hosted web analytics solution. The goal is to provide you with a friendlier, privacy-focused alternative to Google Analytics and a free, open-sourced alternative to paid solutions. Umami collects only the metrics you care about and everything fits on a single page.
Note
For this guide you should be familiar with the basic concepts of
Node.js <lang-nodejs>
and its package manager :manual_anchor:npm <lang-nodejs.html#npm>MySQL <database-mysql>
supervisord <daemons-supervisord>
domains <web-domains>
We're using Node.js <lang-nodejs>
version 16:
[isabell@stardust ~]$ uberspace tools version show node
Using 'Node.js' version: '16'
[isabell@stardust ~]$
Your website domain needs to be set up:
We clone the repository to our home directory and install the application.
[isabell@stardust ~]$ git clone https://github.com/mikecao/umami.git
[isabell@stardust ~]$ cd umami
[isabell@stardust umami]$ yarn install
(...)
[isabell@stardust umami]$
After the installation you need to create the database.
[isabell@stardust umami]$ mysql -e "CREATE DATABASE ${USER}_umami"
[isabell@stardust umami]$
Use your favorite editor to create ~/umami/.env
with the following content:
DATABASE_URL=mysql://isabell:mypassword@localhost:3306/isabell_umami
Additionally you can define a HASH_SALT environment variable. That's no longer required, but optional if you still want to use it.
HASH_SALT=(any random string)
Create a ~/umami/.babelrc
file with the following content:
{
"presets": ["next/babel"]
}
Now you can create the production build:
[isabell@stardust umami]$ yarn build
[isabell@stardust umami]$
Warning
In newer versions, sometimes the build process fails without any errors in the next build stage. This is due to Uberspace killing the process for needing to much memory. If this happens, you will not be able to start the app – it will say Error: Could not find a production build in the '/home/isabell/umami/.next [...]' directory. Try running the build process via NODE_OPTIONS=--max_old_space_size=512 npm run build --debug
to limit the RAM usage and build the app successfully.
Create database tables
[isabell@stardust umami]$ yarn update-db
[isabell@stardust umami]$
This will also create a login account with username admin and password umami.
Create ~/etc/services.d/umami.ini
with the following content:
[program:umami]
directory=%(ENV_HOME)s/umami
command=yarn start
autostart=yes
autorestart=yes
Note
umami is running on port 3000.
Your Umami installation will create a default administrator account with the username admin
and the password umami
.
Warning
The first thing you will want to do is log in and change your password.
For more information check the umami documentation.
Note
Check the git repository regularly to stay informed about changes.
To update the application, stop the daemon and repeat the installation step.
Tested with umami 1.33.0 and Uberspace 7.12.2