All Projects → D1ceWard → plausible_on_dokku

D1ceWard / plausible_on_dokku

Licence: other
Dockerfile to run Plausible (analytics) on Dokku (mini-Heroku)

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to plausible on dokku

dokku-elasticsearch
an elasticsearch plugin for dokku
Stars: ✭ 82 (+382.35%)
Mutual labels:  dokku
pageviews
A simple and lightweight pageviews counter for your WordPress posts and pages.
Stars: ✭ 23 (+35.29%)
Mutual labels:  analytics
mixpanel-engage-query
Command line tool to query the MixPanel Engage API for People Data.
Stars: ✭ 48 (+182.35%)
Mutual labels:  analytics
dokku-http-auth
dokku plugin that gives the ability to manage HTTP basic auth for an application
Stars: ✭ 71 (+317.65%)
Mutual labels:  dokku
Awesome-DataScience-Cheatsheets
Collection of cheatsheets for data science, machine learning and deep learning :).
Stars: ✭ 48 (+182.35%)
Mutual labels:  analytics
kaltura-player-android
Kaltura Player is a rich, easy to integrate and easy to use video player for all media types and ad scenarios you need. - based on Google ExoPlayer
Stars: ✭ 22 (+29.41%)
Mutual labels:  analytics
dokku-mysql
a mysql plugin for dokku
Stars: ✭ 85 (+400%)
Mutual labels:  dokku
dokku-graphite
a graphite, grafana, statsd, carbon plugin for dokku
Stars: ✭ 47 (+176.47%)
Mutual labels:  dokku
express-keenio
📊 Rapidly install analytics with a middleware.
Stars: ✭ 42 (+147.06%)
Mutual labels:  analytics
grafana on dokku
Dockerfile to run Grafana (monitoring) on Dokku (mini-Heroku)
Stars: ✭ 12 (-29.41%)
Mutual labels:  dokku
ci-docker-image
A Docker Image meant for use with CI/CD pipelines
Stars: ✭ 23 (+35.29%)
Mutual labels:  dokku
dokku-dockerfile
Deploy applications to Dokku via Dockerfiles outside of the project root
Stars: ✭ 25 (+47.06%)
Mutual labels:  dokku
core-api
Streamr Core backend
Stars: ✭ 52 (+205.88%)
Mutual labels:  analytics
dokku-nats
a nats plugin for dokku
Stars: ✭ 21 (+23.53%)
Mutual labels:  dokku
dashflare
🕵🏼‍♀️ Open Source and privacy-focused analytics solution. 📊 Advanced monitoring for your website behind Cloudflare
Stars: ✭ 78 (+358.82%)
Mutual labels:  analytics
dokku-rethinkdb
a rethinkdb plugin for dokku
Stars: ✭ 42 (+147.06%)
Mutual labels:  dokku
retour-for-kirby
Kirby 3 plugin to manage redirects and track 404s right from the Panel
Stars: ✭ 96 (+464.71%)
Mutual labels:  analytics
statbotics
📈 Modernizing Data Analytics for FRC Robotics
Stars: ✭ 20 (+17.65%)
Mutual labels:  analytics
startuptoolbox
The startup founder toolbelt. A forever-updating crowdsourced collection.
Stars: ✭ 146 (+758.82%)
Mutual labels:  analytics
data-science-best-practices
The goal of this repository is to enable data scientists and ML engineers to develop data science use cases and making it ready for production use. This means focusing on the versioning, scalability, monitoring and engineering of the solution.
Stars: ✭ 53 (+211.76%)
Mutual labels:  analytics

Plausible Dokku Maintenance

Run Plausible on Dokku

Perquisites

What is Plausible?

Plausible is a lightweight and open-source website analytics tool. No cookies and fully compliant with GDPR, CCPA and PECR.

What is Dokku?

Dokku is the smallest PaaS implementation you've ever seen - Docker powered mini-Heroku.

Requirements

Setup

Note: We are going to use the domain plausible.example.com for demonstration purposes. Make sure to replace it with your own domain name.

App and plugins

Create the app

Log onto your Dokku Host to create the Plausible app:

dokku apps:create plausible

Add plugins

Install, create and link PostgreSQL and Clickhouse plugins:

# Install plugins on Dokku
dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
dokku plugin:install https://github.com/dokku/dokku-clickhouse.git clickhouse
# Create running plugins
dokku postgres:create plausible -I 12
dokku clickhouse:create plausible -I 21.3.2.5
# Link plugins to the main app
dokku postgres:link plausible plausible
dokku clickhouse:link plausible plausible

Configuration

Add CLICKHOUSE_DATABASE_URL to environment variables

# Show all enironement variables to copy content of CLICKHOUSE_URL variable
dokku config plausible

Transform CLICKHOUSE_URL to http format like (as example) :

  • clickhouse://plausible:password@dokku-clickhouse-plausible:9000/plausible

Become (scheme and port change):

  • http://plausible:password@dokku-clickhouse-plausible:8123/plausible
# Set CLICKHOUSE_DATABASE_URL
dokku config:set plausible CLICKHOUSE_DATABASE_URL='http://plausible:password@dokku-clickhouse-plausible:8123/plausible'

Setting up secret key

dokku config:set plausible SECRET_KEY_BASE=$(openssl rand -hex 64)

Setting up BASE_URL

dokku config:set plausible BASE_URL=https://plausible.example.com

Setting up smtp information

dokku config:set plausible [email protected] \
                           SMTP_HOST_ADDR=mail.example.com \
                           SMTP_HOST_PORT=465 \
                           [email protected] \
                           SMTP_USER_PWD=example1234 \
                           SMTP_HOST_SSL_ENABLED=true

Setting up first admin information

dokku config:set plausible [email protected] \
                           ADMIN_USER_NAME=admin \
                           ADMIN_USER_PWD=admin1234

Disable registration (optional)

dokku config:set plausible DISABLE_REGISTRATION=true

Domain setup

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

dokku domains:set plausible plausible.example.com

Push Plausible to Dokku

Grabbing the repository

First clone this repository onto your machine.

Via SSH

git clone [email protected]:D1ceWard/plausible_on_dokku.git

Via HTTPS

git clone https://github.com/D1ceWard/plausible_on_dokku.git

Set up git remote

Now you need to set up your Dokku server as a remote.

git remote add dokku [email protected]:plausible

Push Plausible

Now we can push Plausible to Dokku (before moving on to the next part).

git push dokku master

SSL certificate

Last but not least, we can go an grab the SSL certificate from Let's Encrypt.

# Install letsencrypt plugin
dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git

# Set certificate contact email
dokku config:set --no-restart plausible [email protected]

# Generate certificate
dokku letsencrypt plausible

Wrapping up

Your Plausible instance should now be available on https://plausible.example.com.

Bonus: rename script file

By default, Plausible will use a file called /js/plausible.js which is blocked by most adblockers (Adblock business lets you pay to display your ads, but privacy-focused analytics are blocked by default. Yay).

Since Plausible respects user privacy, it seems fair to collect anonymous traffic data. You can add a nginx config file: vi /home/dokku/plausible/nginx.conf.d/rewrite.conf:

rewrite ^/js/pls.js$ /js/plausible.js last;

Rename pls.js to whatever fits your need, and use this file name from now on.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].