2020-08-13 16:41:11 +08:00
# umami
2022-04-08 09:15:45 +08:00
Umami is a simple, fast, privacy-focused alternative to Google Analytics.
2020-08-20 05:35:38 +08:00
## Getting started
A detailed getting started guide can be found at [https://umami.is/docs/ ](https://umami.is/docs/ )
2020-08-23 10:05:07 +08:00
## Installing from source
2020-08-13 16:41:11 +08:00
2020-08-20 05:35:38 +08:00
### Requirements
2023-08-30 04:02:51 +08:00
- A server with Node.js version 16.13 or newer
2024-04-11 18:20:40 +08:00
- A database. Umami supports [MySQL ](https://www.mysql.com/ ) (minimum v8.0) and [Postgresql ](https://www.postgresql.org/ ) (minimum v12.14) databases.
2020-08-20 05:35:38 +08:00
2022-06-19 15:07:01 +08:00
### Install Yarn
2022-05-25 12:33:38 +08:00
```
npm install -g yarn
```
2020-08-20 11:51:35 +08:00
### Get the source code and install packages
2020-08-13 16:41:11 +08:00
```
2022-07-21 20:31:09 +08:00
git clone https://github.com/umami-software/umami.git
2020-08-13 16:41:11 +08:00
cd umami
2022-05-19 04:04:21 +08:00
yarn install
2020-08-17 12:28:54 +08:00
```
2020-08-13 16:41:11 +08:00
### Configure umami
Create an `.env` file with the following
```
2022-07-17 13:04:53 +08:00
DATABASE_URL=connection-url
2020-08-13 16:41:11 +08:00
```
The connection url is in the following format:
2022-11-01 14:42:37 +08:00
2020-08-13 16:41:11 +08:00
```
postgresql://username:mypassword@localhost:5432/mydb
mysql://username:mypassword@localhost:3306/mydb
```
2022-06-23 00:34:03 +08:00
### Build the application
2022-06-19 15:07:01 +08:00
```bash
2022-06-23 00:34:03 +08:00
yarn build
2022-06-19 15:07:01 +08:00
```
2023-12-08 14:39:04 +08:00
The build step will also create tables in your database if you are installing for the first time. It will also create a login user with username **admin** and password **umami** .
2022-06-27 17:41:31 +08:00
2020-08-17 12:28:54 +08:00
### Start the application
2020-09-06 13:44:56 +08:00
```bash
2022-05-25 12:33:38 +08:00
yarn start
2020-08-17 12:28:54 +08:00
```
2022-06-12 14:38:58 +08:00
By default this will launch the application on `http://localhost:3000` . You will need to either
2020-08-17 12:28:54 +08:00
[proxy ](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/ ) requests from your web server
2020-08-17 15:05:57 +08:00
or change the [port ](https://nextjs.org/docs/api-reference/cli#production ) to serve the application directly.
2020-08-23 10:05:07 +08:00
## Installing with Docker
2020-08-19 12:23:04 +08:00
To build the umami container and start up a Postgres database, run:
2020-09-06 13:44:56 +08:00
```bash
2023-03-31 02:34:11 +08:00
docker compose up -d
2020-08-19 12:23:04 +08:00
```
2020-09-06 13:44:56 +08:00
Alternatively, to pull just the Umami Docker image with PostgreSQL support:
2022-11-01 14:42:37 +08:00
2020-09-06 13:44:56 +08:00
```bash
2024-05-07 12:24:17 +08:00
docker pull docker.umami.is/umami-software/umami:postgresql-latest
2020-09-06 13:44:56 +08:00
```
Or with MySQL support:
2022-11-01 14:42:37 +08:00
2020-09-06 13:44:56 +08:00
```bash
2024-05-07 12:24:17 +08:00
docker pull docker.umami.is/umami-software/umami:mysql-latest
2020-09-06 13:44:56 +08:00
```
2020-09-04 07:32:09 +08:00
## Getting updates
2020-09-03 23:56:51 +08:00
To get the latest features, simply do a pull, install any new dependencies, and rebuild:
2020-09-06 13:44:56 +08:00
```bash
2020-09-03 23:56:51 +08:00
git pull
2022-05-25 12:33:38 +08:00
yarn install
yarn build
2020-09-03 23:56:51 +08:00
```
2022-03-18 03:51:24 +08:00
To update the Docker image, simply pull the new images and rebuild:
```bash
2022-09-07 10:55:15 +08:00
docker compose pull
docker compose up --force-recreate
2022-03-18 03:51:24 +08:00
```
2020-08-17 15:05:57 +08:00
## License
2020-09-06 13:44:56 +08:00
MIT
2024-05-07 02:16:54 +08:00