WordPress & Full-stack development

Plausible is a great and user-friendly alternative to Google Analytics. You can purchase a subscription for the SaaS-version or you can host your own. If you choose the latter, make sure to set up an SMTP server so you can receive password reset mails and can invite other people to your analytics.

In this guide I'll assume that:

  • You set up Plausible Analytics with a Docker installation (I followed this Digital Ocean guide)
  • You set up a custom domain and SSL for your Plausible installation
  • You have an active Mailgun account (could be a free one), added the domain and got the domain sending API key.

Plausible.conf.env

First you need to locate the file that holds the environment variables for Plausible. It's usually in /opt/plausible/plausible.conf.env

Open it up with SSH or SFTP so you can update the file. Add this to the bottom of the file:

MAILER_NAME=Plausible
[email protected]
MAILER_ADAPTER=Bamboo.MailgunAdapter
MAILGUN_API_KEY="your-mailgun-api-key"
MAILGUN_DOMAIN="yourmailgundomain.com"
MAILGUN_BASE_URI="https://api.eu.mailgun.net/v3"

If you use the default Mailgun server based in the US, you don't need the MAILGUN_BASE_URI variable. But since I'm using the EU server, I need to add this line.

Save the file.

Recreating the containers

Updating the file won't have any results. You still need to recreate the container.

Run this command:

docker compose up --build

When this is done, you can use the Mailgun integration. You can try it out by requesting a new password.

You’ve successfully subscribed to Teebow Dev Blog
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Success! Your email is updated.
Your link has expired
Success! Check your email for magic link to sign-in.