---
title: Deploy GoatCounter with AI on Blossom
url: "/deploy/goatcounter/"
canonical_url: https://blossom88.com/deploy/goatcounter/
markdown_url: https://blossom88.com/deploy/goatcounter.md
summary: Track pageviews with GoatCounter and keep your analytics dashboard private.
categories:
- deployment
- analytics
- websites
stack:
- Go
- JavaScript
- PostgreSQL
---

# Deploy GoatCounter with AI on Blossom

[GoatCounter](https://www.goatcounter.com/) is a lightweight web analytics
app that shows which pages people visit without using tracking cookies.

![GoatCounter’s private dashboard showing a visit to a sample page.](/deploy/assets/images/goatcounter/pageviews.webp)

## Ask Your Agent

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

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and choose a Blossom Cloud Location when you log in. You can also use [Blossom BYOC (bring your own cloud)](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#blossom-byoc).

## Track Your First Pageview

Create a site in GoatCounter and add its script to a website you control.
Visit a page, then sign in to GoatCounter to see the pageview.

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

Use the [GoatCounter recipe](/deploy/recipes/goatcounter/README.md) as the
Dockerfile build context. Link managed PostgreSQL as `DATABASE_URL`. The
recipe runs the official upstream image’s binary and passes the database
connection through environment variables.
[Upstream license](https://github.com/arp242/goatcounter/blob/v2.7.0/LICENSE)

Keep the Environment behind Blossom Account access while creating the first
site and GoatCounter account. Add only `/count.js` and `/count` to the
public paths so visits can reach GoatCounter while the dashboard stays private.

    blossom profile:show
    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom git_repo:create --data git-repo.yml
    blossom environment:build_config:update --id environment-100 --data build.yml
    blossom database_instance:create --data postgres.yml
    blossom environment_link:create --data database-link.yml
    blossom service:create --data web.yml
    blossom environment:deploy --id environment-100 --follow
    blossom environment:update --id environment-100 --data public-tracking.yml

</details>

## What You Get

- A private dashboard for pageviews and referrers
- A small tracking script and pageview history in managed PostgreSQL
