What is Umami
Umami is a simple, fast, website analytics alternative to Google Analytics. -https://github.com/mikecao/umami
Installing NodeJS
- Log into the Linux device
- Run the following commands in a terminal window
# download nodejs
wget -O nodejs.tar.xz https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz
# extract nodejs.tar.xz
tar -xJf nodejs.tar.xz
# change directory to extracted folder
cd node-v14.17.0-linux-x64
# copy node binaries to /usr/local
sudo cp -R * /usr/local/
# test node is working
node -v
# test npm is working
npm -v
Running Umami
- Run the following commands in a terminal window
# install MySQL
sudo apt install mariadb-server -y
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the database and database user
CREATE DATABASE umami DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON umami.* TO 'umami_rw'@'localhost' IDENTIFIED BY 'um@m1!';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands:
# install git
sudo apt install git -y
# cd back to home
cd ~
# clone umami github repo
git clone https://github.com/mikecao/umami.git
# cd into git clone
cd umami
# import database structure
mysql -u umami_rw -p umami < sql/schema.mysql.sql
# install dependencies
npm install
# create and edit .env
nano ./.env - Paste the following into .env
DATABASE_URL=mysql://umami_rw:um@m1!@localhost:3306/umami
HASH_SALT=SomethingSecure - Press CTRL+O, Enter, CTRL+X to write the changes to .env
- Continue with the following commands:
# build umami
npm run build
# run umami
npm start - Open a web browser and navigate to http://DNSorIP:3000
- Login with the username admin and password umami
- Navigate to Settings > Profile and click the Change Password button
- Enter the current password (umami) and enter and confirm the new password > Click save