---
title: Deploy Plausible with AI on Blossom
url: "/deploy/plausible/"
canonical_url: https://blossom88.com/deploy/plausible/
markdown_url: https://blossom88.com/deploy/plausible.md
summary: Deploy Plausible Analytics with AI on Blossom. Track visits and custom events
  with a private dashboard, managed PostgreSQL and persistent ClickHouse storage.
categories:
- deployment
- analytics
stack:
- Elixir
- Phoenix
- PostgreSQL
- ClickHouse
---

# Deploy Plausible with AI on Blossom

[Plausible](https://plausible.io/) is a cookieless website analytics app. See
where visitors come from, which pages they read and which actions they take.



## Ask Your Agent

> **Ask your AI agent:** Deploy Plausible on Blossom and help me track my website.
>
> Follow this guide: https://blossom88.com/deploy/plausible/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## Your Analytics Setup

| Part | Purpose |
|---|---|
| Plausible | Serves the dashboard and collects events on regular App Capacity |
| Managed PostgreSQL | Keeps accounts, websites and settings |
| ClickHouse Persistent Service | Keeps analytics events on a Volume |

The dashboard stays behind Blossom Account access and your Plausible login.
Your website's visitors can load the tracking script and send events without
a Blossom account.

ClickHouse uses one Container with a
[Persistent Service](/docs/apps/persistent-services/). Keep both
databases when updating the App; replacing the web Container leaves analytics
in their own storage.

<details class="optional-reading" markdown="1">
<summary>Deployment setup and commands</summary>

Use the [Community Edition setup](https://github.com/plausible/community-edition)
and [application source](https://github.com/plausible/analytics) for current
compatible releases. Plausible is written in Elixir with Phoenix. Pin maintained
image indexes and choose resources for the expected traffic.

    blossom profile:show
    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom database_instance:create --data database_instance.yml --follow
    blossom database:list --database_instance database_instance-100
    blossom environment_link:create --data postgres-link.yml
    blossom service:create --data clickhouse-service.yml
    blossom environment:deploy --id environment-100 --follow

Keep ClickHouse private and mount its data directory on the Volume. Use its
supported initialization to create the analytics database and a passworded
application user. Check memory-related settings against the selected
ClickHouse release; shrinking a background pool independently of its task
thresholds can prevent startup.

The managed PostgreSQL database already exists. Once ClickHouse is ready, run
Plausible's migrations in a Release Phase Hook with `db migrate`; the upstream
`db createdb` command expects PostgreSQL administration privileges.

Set `DATABASE_URL`, `CLICKHOUSE_DATABASE_URL`, `BASE_URL`, `SECRET_KEY_BASE`
and `TOTP_VAULT_KEY` using the selected release's requirements. Keep the
secrets stable. The web startup can derive its HTTPS origin from
`BLOSSOM_SERVICE_HOST` on the first deploy.

    blossom env_var:push --environment environment-100 --file .env.production
    blossom environment:deploy_hooks:update --id environment-100 --data deploy-hooks.yml
    blossom service:create --data plausible-service.yml
    blossom environment:deploy --id environment-100 --follow

Use an HTTP health check at `/api/health`. Keep Environment access restricted
to Account members and allow only `/js/*` and `/api/event` for public tracking.
Create the first Plausible owner, then disable public registration. Configure
an email provider for invitations and password resets.

</details>

## Connect Your Website

Add your website in Plausible and copy its generated script into your site's
HTML. Create a goal for an action such as requesting a demo, then send that
custom event from the button or form. Follow the
[custom event instructions](https://plausible.io/docs/custom-event-goals).

![Plausible showing visits to a synthetic demo website, its traffic source and top pages.](/deploy/assets/images/plausible/dashboard.png)

<details class="optional-reading" markdown="1">
<summary>Updates and storage</summary>

Our test sent pageviews and a custom event through the public tracker. Fresh
web and ClickHouse Containers retained the site and history, then collected
new visits. This setup uses a single ClickHouse writer; replacing it can
briefly pause analytics.

Preserve PostgreSQL, the ClickHouse Volume and application secrets. Back up
both databases before changing versions and follow the selected releases'
upgrade instructions. A same-image Container replacement does not test a
database-format upgrade or a replicated ClickHouse cluster.

    blossom environment:deploy --id environment-100 --follow
    blossom service:show --id service-100
    blossom logs --environment environment-100 --lines 30

</details>

## What You Get

- A private dashboard for visitors, pages and conversions
- Public tracking endpoints for your website
- Accounts, site settings and analytics that survive Container replacement
