Running on DigitalOcean

DigitalOcean is an affordable cloud hosting provider that will let you host your own Umami setup. In this setup guide we are going to install Ubuntu, a Postgresql or MySQL database, an Nginx webserver, Node.js and Umami. DigitalOcean also has a NodeJS Droplet template that comes with Node.js, Ubuntu and Nginx which can get you started quicker.

For personal use, you can start with a single $5 a month cloud server and scale up as needed. You can use this link to get a $100 credit for the first 60 days.

Note, these steps can be repeated on any cloud hosting provider that offers Ubuntu.

Install Ubuntu

Install database (Postgresql or MySQL)

Install Nginx

Install Node.js

Install Umami

Running Umami

You can simply run npm start to start Umami, but it’s highly recommended you use a process manager like PM2 which will handle restarts for you.

To run with PM2:

  1. npm install pm2 -g
  2. cd umami
  3. pm2 start npm --name umami -- start
  4. pm2 save

Proxying with Nginx

With Umami now running, you can proxy requests to a domain or subdomain from Nginx to Umami.

The following config will send all requests from umami.yourdomain.com to your local Umami instance.

  1. server {
  2. server_name umami.yourdomain.com;
  3. location / {
  4. proxy_pass http://localhost:3000;
  5. proxy_set_header X-Real-IP $remote_addr;
  6. proxy_set_header Host $host;
  7. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  8. }
  9. }

Adding an SSL certificate (optional)

Finish

That’s it! You’re now self-hosting Umami on your own server.