Umami Self Hosted Analytics Cloud VPS β Configuration π§
Umami is a simple, fast, website analytics alternative to Google Analytics.
Install and Setup Umami on Ubuntu Cloud VPS Server β
- Cloud VPS
- OS - Ubuntu 20.04 LTS
- Node.JS LTS Version
- MYSQL 8
- Nginx + Reverse Proxy
- Certbot for Free SSL
- Systemd Service for Run the APP Permanently
- Git for Clone and Update the Software
- install and setup umami
cd /var/www/
git clone https://github.com/mikecao/umami.git
cd umami
npm install
- Create database tables
cd /var/www/umami
mysql -u username -p databasename < sql/schema.mysql.sql
- Create
.env
file for database connection and Hash salt in the umami cloned/downloaded Folder/var/www/umami
touch .env
nano .env
DB_USER=username
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=3306
DB_NAME=databasename
DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
HASH_SALT=somerandomstring
Generate Hash Salt from - https://bitwarden.com/password-generator/
- Build the Package
npm run build
- Start the server
npm start
- Bash script for start the app via systemd service - https://github.com/mskian/umami-conf/blob/master/start.sh
- create systemd service for Run the App forever - https://github.com/mskian/umami-conf/blob/master/stats.service
- Nginx + Reverse Proxy + SSL Setup https://github.com/mskian/umami-conf/blob/master/stats.conf
if you enabled the ufw on your Server then allow the umami port and MYSQL port
ufw allow 3000
ufw allow mysql
ufw reload
MIT