How to Install Umami Privacy Analytics on Ubuntu 24.04
Umami is a self-hosted web analytics solution that prioritizes privacy. Follow these steps to install Umami on your VPS server.
Prerequisites
- An Ubuntu 24.04 VPS server
- Root or sudo access
- Basic knowledge of the command line
Step 1: Update Your System
Start by ensuring your system is up to date:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Packages
Install the necessary packages including Node.js, npm, and PostgreSQL:
sudo apt install curl postgresql postgresql-contrib
Install Node.js and npm from the NodeSource repository:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
Step 3: Setup PostgreSQL Database
- Start the PostgreSQL service:
sudo systemctl start postgresql
- Log into PostgreSQL:
sudo -u postgres psql
- Create a new database and user:
CREATE DATABASE umami;
CREATE USER umamiuser WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE umami TO umamiuser;
\q
Step 4: Install Umami
- Clone the Umami repository:
git clone https://github.com/umami-software/umami.git
- Change into the Umami directory:
cd umami
- Install dependencies:
npm install
Step 5: Configure Umami
Create a new environment file:
cp .env.example .env
Open the .env file and configure your database settings:
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=umami
DB_USERNAME=umamiuser
DB_PASSWORD=your_password
Step 6: Run Migrations
Run the migrations to set up the database:
npm run migrate
Step 7: Start Umami
Start the Umami server:
npm start
Umami should now be running on http://your_vps_ip:3000.
Step 8: Access Umami
Visit http://your_vps_ip:3000 in your web browser to access the Umami dashboard.
Conclusion
You have successfully installed Umami Privacy Analytics on your Ubuntu 24.04 VPS server. Now you can start tracking your website’s analytics while respecting user privacy!