Running on DigitalOcean
Self-host Umami on a DigitalOcean droplet with Ubuntu, PostgreSQL, Node.js, PM2, and an Nginx reverse proxy, with optional SSL from Let's Encrypt.
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 database, an Nginx web server, Node.js and Umami. DigitalOcean also has a Node.js droplet build 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 PostgreSQL#
Install Nginx#
Install Node.js#
Install Umami#
- See Install under Quickstart
Running Umami#
You can simply run pnpm 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:
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.
The following config will allow you to host Umami at a subpath for your domain (e.g. website.com/stats).
This requires setting the environment variable BASE_PATH=/stats in your .env file. BASE_PATH is a build-time variable, so you need to rebuild Umami with pnpm build after setting it.
Adding an SSL certificate (optional)#
Finish#
That's it! You're now self-hosting Umami on your own server.