Plausible Deployment | Part 2
Google Analytics is the most popular and widely used analytics tool in the world, but it doesn't always have your best interests at heart.
Fortunately there are alternatives like Plausible Analytics that will give you more privacy-friendly data.
Follow along this comprehensive installation tutorial, to get your own Plausible Analytics instance running for your business.
If you like Plausible software, please consider sponsoring Plausible project or subscribing to their cloud platform.
We simplified the process of deploying Plausible on your infrastructure by creating a custom installation script. You can also refer to the installation guide by Plausible..
Webnestify is here to help you with installation if needed. We will install your desired applications, in case of being stuck securing your docker or server.
For more information, please visit our Docker deployment service page.
Video Walkthrough
Optional API Keys
Before installation, make sure that you have prepared the following requirements to have a fully functional instance.
- Google Search Console API keys | Follow this guide to get your API keys.
- Max Minds GeoIP API keys | Create free account.
Installation
Before deploying this stack in Portainer, make sure to add a domain & setup SSL and proxy host first. More in video walkthrough.
Please change to your own values [YOUR VALUE]!
Create secret hash
Open terminal and paste following code:openssl rand -base64 64 | tr -d '\n' ; echo
Copy value and paste it in SECRET_KEY_BASE=[ADD YOUR GENERATED KEY]
version: "3.3"
services:
mail:
image: bytemark/smtp #SMTP Mailer Service
restart: always
labels:
- "com.centurylinklabs.watchtower.enable=true" # Change 'true' to 'false' if you want to disable autoupdate.
plausible_db:
# supported versions are 12, 13, and 14
image: postgres:alpine #User data database
restart: always
volumes:
- ./db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
plausible_events_db:
image: clickhouse/clickhouse-server:latest-alpine #Analytics database
restart: always
volumes:
- ./plausible/event-data:/var/lib/clickhouse
- ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
- ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
plausible:
image: plausible/analytics #Plausible API & Front-end
restart: always
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
depends_on:
- plausible_db
- plausible_events_db
- mail
ports:
- 8004:8000
environment:
- ADMIN_USER_EMAIL=[YOUR VALUE]
- ADMIN_USER_NAME=[YOUR VALUE]
- ADMIN_USER_PWD=[YOUR VALUE] # Use only character and numbers
- BASE_URL=[YOUR VALUE] # for example, https://analytics.example.com
- DISABLE_REGISTRATION=true # Change 'true' to false if you want to enable public registrations
- SECRET_KEY_BASE=[YOUR VALUE] # To get key, run following command: openssl rand -base64 64 | tr -d '\n' ; echo
- MAILER_EMAIL=[YOUR VALUE] #change later to your own
- SMTP_HOST_ADDR=[YOUR VALUE] # Change SMTP server, if you are not using Postmark
- SMTP_HOST_PORT=587 # If not supported, change to your supported SMTP port
- SMTP_USER_NAME=[YOUR VALUE] #change later to your own
- SMTP_USER_PWD=[YOUR VALUE] #change later to your own
- SMTP_HOST_SSL_ENABLED=true
- MAILER_ADAPTER=Bamboo.SMTPAdapter # Change 'Bamboo.SMTPAdapter' to 'Bamboo.PostmarkAdapter' if you are not using Postmark.
# - POSTMARK_API_KEY=[YOUR VALUE] # Keep commented out by '#' at the beginning of this line, if you are not using Postmark.
- GOOGLE_CLIENT_ID=[YOUR VALUE]
# Uncommend this line and add your API Keys. Visit https://plausible.io/docs/self-hosting-configuration#google-search-integration to get your API keys.
- GOOGLE_CLIENT_SECRET=[YOUR VALUE]
# Uncommend this line and add your API Keys. Visit https://plausible.io/docs/self-hosting-configuration#google-search-integration to get your API keys.
plausible_geoip:
image: maxmindinc/geoipupdate:latest #GEO IP Service
environment:
- GEOIPUPDATE_EDITION_IDS=GeoLite2-Country
- GEOIPUPDATE_FREQUENCY=168 # update every 7 days
- GEOIPUPDATE_ACCOUNT_ID=[YOUR VALUE] # Generate key at https://www.maxmind.com/en/geolite2/signup?lang=en
- GEOIPUPDATE_LICENSE_KEY=[YOUR VALUE] # Generate key at https://www.maxmind.com/en/geolite2/signup?lang=en
volumes:
- ./geoip:/usr/share/GeoIP
restart: always
Plausible Dashboard
Now is time to visit your Plausible dashboard! Enter your URL you chosen and enter your main email and password that you created in installation file.
If you like Plausible software, please consider sponsoring Plausible project or subscribing to their cloud platform.
WordPress Installation
Follow this video tutorial to get you started with tracking.
About Webnestify
Imagine a world where you can focus on your business and less time maintaining your cloud infrastrucure. With Webnestify cloud based solutions, we provide customized solutions for all types of companies to meet their needs; no matter how big or small they may be!
Read our reviews on Trustpilot!
Subscribe to our YouTube channel!
If you need to setup your own Docker instances or need help with security, visit our Docker deployment service.