Giter VIP home page Giter VIP logo

dokku-matomo's Introduction

Run Matomo on Dokku

Deploy your own instance of Matomo on Dokku.

This setup is makes use of the great ready-to-use matomo-docker image by crazy-max, which does all of the heavy-lifting to properly deploy Matomo without too much headache.

What you get

We will deploy Matomo 3.13.5 onto your own Dokku server.

Limitations

Currently the following features are not supported:

  • Archive via cron
  • Redis cache

Contributions are welcome!

Requirements

Upgrading

You to pull the latest image from Docker Hub and re-deploy it over Dokku. Updating over the web interface is not supported. The upgrade will result in a short downtime of Matomo.

docker pull crazymax/matomo:3.14.0 # This version does not exist yet, its just an example
docker tag crazymax/matomo:3.14.0 dokku/matomo:v3.14.0
dokku tags:deploy matomo v3.14.0

Setup

Pull image and tag it

We pull the matomo image from Docker Hub and tag it properly for Dokku.

docker pull crazymax/matomo:3.13.5
docker tag crazymax/matomo:3.13.5 dokku/matomo:v3.13.5

App and database

First create a new Dokku app. We will call it matomo.

dokku apps:create matomo

Next create the MariaDB database required by Matomo and link it to the app.

dokku mariadb:create mariadb-matomo
dokku mariadb:link mariadb-matomo matomo

Configuration

Main configuration

dokku config:set --no-restart matomo TZ=Europe/Berlin
dokku config:set --no-restart matomo MEMORY_LIMIT=256M
dokku config:set --no-restart matomo UPLOAD_MAX_SIZE=16M
dokku config:set --no-restart matomo OPCACHE_MEM_SIZE=128
dokku config:set --no-restart matomo REAL_IP_FROM=0.0.0.0/32
dokku config:set --no-restart matomo REAL_IP_HEADER=X-Forwarded-For
dokku config:set --no-restart matomo LOG_LEVEL=WARN

Persistent storage

You need to mount a volume on your host (the machine running Dokku) to persist all settings that you set in the Matomo interface.

mkdir /var/lib/dokku/data/storage/matomo
# UID:GUID are set to 101. These are the values the nginx image uses,
# that is used by crazymax/matomo
chown 101:101 /var/lib/dokku/data/storage/matomo
dokku storage:mount matomo /var/lib/dokku/data/storage/matomo:/data

Domain setup

To get the routing working, we need to apply a few settings. First we set the domain.

dokku domains:set matomo matomo.example.com

We also need to update the ports set by Dokku.

dokku proxy:ports-add matomo http:80:8000
dokku proxy:ports-remove matomo http:80:5000

If Dokku proxy:report sentry shows more than one port mapping, remove all port mappings except the added above.

Email settings (optional)

You need to set the following settings if you want to receive emails from Matomo.

dokku config:set --no-restart SSMTP_HOST=smtp.example.com
dokku config:set --no-restart SSMTP_PORT=587
dokku config:set --no-restart SSMTP_HOSTNAME=matomo.example.com
dokku config:set --no-restart [email protected]
dokku config:set --no-restart SSMTP_PASSWORD=yoursmtppassword
dokku config:set --no-restart SSMTP_TLS=YES

GeoIP2

The GeoIP2 plugin is already installed but needs to be configured. Follow the instructions in the crazymax/docker-matomo repository to enable it.

Advanced configuration

If needed, the Matomo configuration file is located at /var/lib/dokku/data/storage/matomo/config/config.ini.php and can be manually edited.

Deploy

Deploy app for the first time

Deploy Matomo from the previously tagged docker image.

dokku tags:deploy matomo v3.13.5

Setup Let's Encrypt

Setup an SSL certificate via Let's Encrypt.

dokku config:set --no-restart matomo [email protected]
dokku letsencrypt matomo
dokku letsencrypt:auto-renew matomo

Grep MariaDB information for the setup

We will need to set up Matomo in the web interface and provide the database details. You should be able to access the page via https://matomo.example.com.

Run the command below to retrieve the DSN.

dokku mariadb:info mariadb-matomo

An example DSN might look like this: mysql://mariadb:ffd4fc238ba8adb3@dokku-mariadb-mariadb-matomo:3306/mariadb_matomo. Copy and paste the details as follows:

Hostname: dokku-mariadb-mariadb-matomo
Username: mariadb
Password: ffd4fc238ba8adb3
Database Name: mariadb_matomo

After going through the setup, you should be able to use Matomo.

dokku-matomo's People

Contributors

mimischi avatar rclement avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dokku-matomo's Issues

Update to Matomo 4.4.1

Hey, I've been using this tutorial for a while, but it's not possible for me to update to the latest Matomo version (from 4.1.1 to 4.4.1).

Could you update the tutorial?

How to use latest docker image?

Hello, thank you for this, I'm trying to update to use the latest image but get a 404 upon deploying. Do you have any idea how to go about this? It seems to be related to crazy-max/docker-matomo#14 and needing to configure the traefik.frontend.rule in the docker-compose.yml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.