Statistics using umami

Original link:

I recently learned from this article that umami is an open-source self-hosted website statistics tool. After trying it out for a while, I think it is really easy to use and worthy of attention.

what is umami

umami is a lightweight website visit statistics tool, open source free, self-hosted, similar to Google Analytics. Of course, umami’s functions are far less rich than Google Analytics, but if you don’t have many needs and just want to know basic information such as website traffic (PV, UV), traffic sources, and record some simple custom events, then umami would be a good choice.

For the specific functions of umami, you can go to the official website of umami to view the official Live Demo.

umami currently does not have an official hosting service, and it basically needs to be self-hosted when using it. Although this will cause some trouble, it also means that your access data is stored on your own server (database), so you don’t have to worry about data leakage.

Deploy via Railway

Various deployment methods are introduced in the umami official documentation , including deployment to Vercel, Railway and other methods. I used docker to deploy on my own server at first, but then I found that hosting with Railway seemed easier and its free credit should be enough to support my usage, so I migrated to Railway.

Railway is a service hosting platform, similar to Vercel, the difference is that in addition to supporting programs such as Next.js, it also provides database storage services such as PostgreSQL, so a dynamic website service can be hosted on it.

Without adding a payment method, Railway gives each user a free $5 per month credit, enough to run most small apps (such as the low-traffic umami app), and adding a credit card turns that credit into $10 per month.

Railway has templates for creating umami projects, which can be created directly from the templates. You can also manually create and connect each service yourself. For details of the installation, please refer to the official documentation . The installation process was smooth and I didn’t encounter any accidents, so I won’t go into details here.


After deploying and configuring the domain name on Railway, you can access your umami service. The next step is to add the corresponding site in the umami background, get the statistics script and add it to your website, and then you can see the website’s Visit Statistics.

umami live panel

It is worth mentioning that the umami management background also supports the mobile terminal very well. After accessing the background with Safari on the iPhone and adding it to the home screen, you can access the management background like an app.

Advantages and disadvantages

After a period of use, I personally feel that umami is a product with both advantages and disadvantages.


  • Free, open source, self-hosted
  • Focus on data security and privacy
  • Lightweight, low server requirements, and low network traffic usage
  • Easy to deploy and use
  • Provides a variety of commonly used customization items, such as changing the name of the statistical js file, preventing it from being blocked by ad plugins, etc.
  • Supports sending data manually using the API , which means that some non-Web applications and even non-JS applications (such as desktop apps) can also use umami for statistics


The shortcomings of umami are mainly focused on functions. If you don’t use these functions, you can ignore these shortcomings.

  • The source of the visitor can only be accurate to the country or region, not the city (on this point, the developer mentioned that it was designed to protect the privacy of the user, and the IP of the visitor was not even recorded in the database, so it is feature is not a bug. Understandable, but if your users are mostly from the same country, then this visitor source is a bit too general)
  • Missing Retention Statistics
  • Custom events are relatively simple, only support one parameter, no secondary parameters or sub-parameters


Overall, umami is a work of heart, if you don’t need to count too much complex data and are looking for an alternative to Google Analytics, then give umami a try.

umami is open source . Looking at the author’s submission record on GitHub, this application is under active development, and I believe it will continue to iteratively improve in the future.

Personally, although umami still lacks some functions, it has basically met my needs. It is expected that I will continue to use umami for a long time to come.

This article is reprinted from:
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.