Umami is a self-hosted analytics platform that helps you understand your website and its users. This tutorial will guide you through the process of installing Umami on FreeBSD Latest.
Before starting with the installation process, you need to make sure that your system meets the following prerequisites:
First, you need to clone the Umami repository from GitHub. To do that, open your terminal and run the following command:
git clone https://github.com/mikecao/umami.git
This will clone the Umami repository to your local system.
After cloning the repository, navigate to the Umami folder using the following command:
cd umami
Then, install the dependencies by running the following command:
npm install
Once the dependencies are installed, you can build Umami by running the following command:
npm run build
This will compile the Umami source code into a production-ready format.
After building Umami, you need to configure it by creating a configuration file. Copy the .env.example
file to .env
and edit the variables according to your setup:
cp .env.example .env
nano .env
In the .env
file, you need to configure the following variables:
NODE_ENV
: Set this to production
.SERVER_PROTOCOL
: Set this to http
or https
depending on your web server configuration.SERVER_HOST
: Set this to your server's IP or domain name.SERVER_PORT
: Set this to the port number where you want to run Umami (default is 3000).DATABASE_URL
: Set this to your PostgreSQL database connection string.After configuring Umami, you can start the server by running the following command:
npm start
This will start the Umami server at the specified port. You can now access the Umami dashboard by visiting http://your-server-ip:3000
in your web browser.
To make Umami accessible over the internet, you need to configure your web server (such as Nginx) to proxy requests to the Umami server. To do that, create a new Nginx server block by running the following command:
nano /usr/local/etc/nginx/conf.d/umami.conf
Paste the following configuration in the file and save it:
server {
listen 80;
server_name your-domain-name.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name your-domain-name.com;
ssl_certificate /path/to/your/cert.pem;
ssl_certificate_key /path/to/your/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
}
}
Replace your-domain-name.com
with your actual domain name and /path/to/your/cert.pem
and /path/to/your/privkey.pem
with the paths to your SSL certificate and private key.
Once you have saved the configuration file, test it for syntax errors:
nginx -t
If there are no errors, reload the Nginx configuration:
service nginx reload
You have successfully installed Umami on FreeBSD Latest and configured it to run behind Nginx. You can now start tracking your website visitors and analyzing their behavior using Umami.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!