Self-hosted app·Dashboards, analytics and smart home
GoatCounter hosting on a Swiss VPS.
GoatCounter hosting in ALP1, Swiss Alps: a Docker Compose setup for v2.7, sizing, SQLite or PostgreSQL, backups and the monthly cost.
- Go
- PostgreSQL
- SQLite
ALP1·Swiss Alps
In stockRecommended for this use case
- 1 Gbps port20 TB of transfer a monthIncluded
- Debian 13preinstalled with the orderIncluded
- DDoS protection, 1 IPv4VNC console and full rootIncluded
Optional: daily backups +20% · extra IPv4 $2 · priority support $10
Pay yearly: $206.99 a year, about 25% less
- No KYC
- Crypto only
- Swiss jurisdiction
ALP1 · Swiss Alps · Our own hardware, under Swiss law, paid in crypto
- 6 vCPU, 8 GB RAM
- 320 GB NVMe local storage
- 20 TB transfer on a 1 Gbps port
- DDoS protection included
- Swiss jurisdiction, outside the EU
01/06
Short answer.
GoatCounter runs on any of our Cloud VPS plans in ALP1, our facility in the Swiss Alps, and the plan we put it on by default is Cloud VPS Pro: 6 vCPU, 8 GB RAM, 320 GB NVMe and 20 TB of monthly transfer for $22.99, installed on Debian 13 with the official Docker image of GoatCounter 2.7. Pro is more than a single blog needs, and the sizing section says so plainly; one modest site on SQLite is comfortable on Starter. What decides the plan is less your pageview count than how many distinct paths you track and which database holds them, because that is where GoatCounter spends its effort.
02/06
What GoatCounter is and who maintains it.
GoatCounter is open-source web analytics written in Go by Martin Tournoij (arp242 on GitHub), who also runs a donation-funded hosted edition at goatcounter.com. It counts visits without setting cookies. Each incoming hit is keyed on the site ID, the User-Agent and the IP address; that key lives in memory for eight hours, mapped to a random UUID, and only the UUID and the counters reach the database. The project documents that IP addresses and User-Agents are not written to the database or to disk. Since version 2.6.0, individual pageviews are no longer kept by default either, so what accumulates on your disk is aggregate data unless you switch on Individual pageviews to get CSV exports.
There are four ways to feed it: a script tag of about 3.5 KB, a no-JavaScript tracking pixel, the HTTP API called from your application backend, or goatcounter import reading nginx, Apache, Caddy or CloudFront logs. Log import is the option most people overlook. It counts visitors whose browsers block scripts and adds nothing to your pages, at the cost of keeping web server logs, full IP addresses included, for as long as the import needs them.
The code is published under a lightly modified EUPL 1.2 (the author removed some licences from the compatibility appendix), the count.js script under the ISC licence, and self-hosting carries no restrictions. The current release is v2.7.0 of 15 December 2025, still the latest when we checked on 4 November 2026. Official Docker images exist from 2.6.0 onwards and are tagged latest, 2, 2.7 and 2.7.0 in the usual major/minor/patch pattern. The hosted service is free for reasonable public use; the author draws the line well short of millions of pageviews a day and points heavier users to self-hosting.

Our servers are in Switzerland and answer to Swiss law. We act only on orders from competent Swiss authorities, and a request from abroad has to pass through one of them first.
03/06
Requirements and sizing.
GoatCounter is one statically linked binary with its templates and static files compiled in, and its only dependency is a SQLite file or a PostgreSQL connection. The Docker image is 17.1 MB on Docker Hub, runs as an unprivileged goatcounter user and starts with serve -automigrate, so pending database migrations run on every start. By default it listens on port 8080 in plain HTTP. It can also terminate TLS and obtain certificates over ACME itself, in which case ports 80 and 443 must be reachable from the internet; PostgreSQL's 5432 should never be. Outbound mail is used for password resets and optional email reports. Port 25 is open on every VPS we sell, but a relay with proper SPF and DKIM gets delivered where a fresh IP sending directly often does not. Without an -smtp setting GoatCounter prints emails to stdout, so a password-reset link turns up in docker compose logs, which is convenient once and unpleasant if you forget.
The author's own guidance on load is the most useful sizing fact available: the bottleneck is how widely pageviews are spread across distinct paths, not how many there are. Ten million pageviews over five pages is quick even on SQLite; the same volume over a million different pages is much slower. A blog or brochure site has few paths and lives happily on SQLite with the defaults GoatCounter sets (WAL journal, 20 MB page cache). A documentation portal, a shop with faceted URLs, a forum, or one instance serving many sites collects paths quickly and should start on PostgreSQL. Moving later is possible, but it is a manual pgloader job with schema preparation, not a setting.
Bandwidth is not the constraint. As a theoretical calculation, if every pageview costs the uncached 3.5 KB script plus roughly 1 KB for the count request and response, a million pageviews a month moves about 4.5 GB, around 0.02 % of Pro's 20 TB allowance, and browser caching of the script lowers it further.
| Situation | Database | Plan | vCPU / RAM / NVMe / transfer | Per month |
|---|---|---|---|---|
| One or two sites with few distinct paths | SQLite | Starter | 2 / 2 GB / 80 GB / 10 TB | $6.99 |
| Several sites, log imports, path count growing | SQLite or PostgreSQL | Standard | 4 / 4 GB / 160 GB / 15 TB | $12.99 |
| PostgreSQL, many paths or sites, website and proxy on the same VPS | PostgreSQL | Pro | 6 / 8 GB / 320 GB / 20 TB | $22.99 |
| Multi-tenant instance for an agency's clients | PostgreSQL | Power | 12 / 16 GB / 640 GB / 40 TB | $42.99 |
We default to Pro because it is the smallest plan on which PostgreSQL can keep GoatCounter's working set in memory with a website and reverse proxy running beside it, and where a dashboard query over a two-year range does not compete with background jobs for the same two cores.
04/06
How to deploy it with us.
Deploy Cloud VPS Pro with Debian 13. You get a plain Debian 13 server in ALP1 with root access; GoatCounter is not preinstalled. Ordering is no-KYC: an email address is enough, and payment is in crypto.
- 01Create an A record for
stats.example.compointing at the server's IPv4 address. Counting from your own subdomain keeps the script and the endpoint first-party. - 02Install Docker Engine and the Compose plugin from Docker's apt repository for Debian 13.
- 03Put this in
/opt/goatcounter/compose.yaml. It uses SQLite and GoatCounter's built-in TLS, which is the fewest moving parts for a server that does nothing else:
services:
goatcounter:
image: arp242/goatcounter:2.7
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- goatcounter-data:/home/goatcounter/goatcounter-data
environment:
GOATCOUNTER_LISTEN: ":443"
GOATCOUNTER_TLS: "tls,rdr,acme"
GOATCOUNTER_EMAIL_FROM: "stats@example.com"
GOATCOUNTER_SMTP: "smtps://user:password@mail.example.com:465"
volumes:
goatcounter-data: {}- 04Create the site and its first user before the server is reachable, then start it:
cd /opt/goatcounter
docker compose pull
docker compose run --rm goatcounter db create site -createdb \
-vhost=stats.example.com -user.email=you@example.com
docker compose up -dThe order matters. Since 2.5.0 an empty database shows a setup form to whoever loads the page first, and docker compose run does not publish ports, so the form is never exposed. The site answers only on its vhost, so a request to the bare IP does not reach your dashboard. Certificates and the SQLite file both live in the named volume.
- 05Add the tag to your pages:
<script data-goatcounter="https://stats.example.com/count"
async src="//stats.example.com/count.js"></script>If the website runs on the same VPS, put Caddy or nginx in front instead: drop the two TLS variables, publish 127.0.0.1:8080:8080 rather than 80 and 443, and proxy stats.example.com to it. Since 2.7.0 GoatCounter decides on secure cookies from the X-Forwarded-Proto header; Caddy sends it by default, nginx needs proxy_set_header X-Forwarded-Proto $scheme;. Binding to 127.0.0.1 also sidesteps the old trap of Docker-published ports bypassing ufw rules.
For PostgreSQL, add a database service and point GoatCounter at it. The upstream compose.yaml tunes PostgreSQL for a larger machine than this (effective_cache_size=10GB, work_mem=200MB), and its default password is goatcounter; on 8 GB we start lower and keep the port unpublished:
services:
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: goatcounter
POSTGRES_PASSWORD: "<long random string>"
POSTGRES_DB: goatcounter
volumes:
- pg-data:/var/lib/postgresql/data
command: ["-c", "shared_buffers=2GB", "-c", "effective_cache_size=5GB",
"-c", "work_mem=32MB", "-c", "random_page_cost=1.5"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U goatcounter -d goatcounter"]
interval: 5s
goatcounter:
# same as above, plus:
depends_on:
postgres: {condition: service_healthy}
environment:
GOATCOUNTER_DB: "postgresql+postgresql://goatcounter:<password>@postgres:5432/goatcounter?sslmode=disable"
volumes:
goatcounter-data: {}
pg-data: {}Back up off the server. For SQLite, take a consistent copy with the online backup command rather than copying a file that is being written, then push it to an S3-compatible object storage bucket with restic (after a one-time restic init, with the endpoint and access key from your client panel and the secret key from the ticket we send at delivery):
apt install sqlite3 restic
VOL=$(docker volume inspect -f '{{ .Mountpoint }}' goatcounter_goatcounter-data)
sqlite3 "$VOL/db.sqlite3" ".backup /var/backups/goatcounter.sqlite3"
restic -r s3:https://<endpoint>/<bucket> backup /var/backups/goatcounter.sqlite3With PostgreSQL, docker compose exec postgres pg_dump -U goatcounter -Fc goatcounter does the same job. For upgrades, the 2.7 tag follows 2.7.x patch releases; read the release notes before moving to a new minor version, because -automigrate runs whatever it finds at start-up. The 2.5.0 migration rewrote the hits table and could take hours on very large instances, with enough free disk needed for the copy.
05/06
Cost.
| Item | Per month |
|---|---|
| Cloud VPS Pro, ALP1 | $22.99 |
| Daily backups (+20 %) | $4.60 |
| Object storage, 250 GB, for off-site copies | $1.99 |
| Total | $29.58 |
The plan includes 6 vCPU, 8 GB RAM, 320 GB NVMe, 20 TB of transfer on a 1 Gbps port, and outbound port 25. Yearly billing takes about 25 % off the VPS, which brings it to roughly $17.25 a month. An extra IPv4 is $2 a month and priority support $10. Every price on the site is on our pricing page.
Payment is crypto only (Monero, Bitcoin, Tether, Ethereum, Litecoin and others), with prices and balances in US dollars. Top-ups run from $25 to $5,000 and carry a bonus of 5 % from $50, 10 % from $100, 15 % from $250 and 20 % from $500; the unused paid part of a top-up is refundable within 14 days. Business customers paying in crypto are welcome.
06/06
Limits and acceptable use.
VPS transfer is not unmetered: Pro includes 20 TB a month, and the calculation above shows GoatCounter alone will not come near it. Whatever else shares the server counts against the same allowance.
Running the instance makes you the controller for what it processes. Depending on where you and your visitors are, that brings in the revised Swiss FADP, in force since 1 September 2023, the GDPR, or both. GoatCounter's own documentation argues that its design needs no consent notice; that is the author's position on his software, not an assessment of your installation. IP addresses and User-Agents are still processed in memory for up to eight hours, and turning on individual pageviews, a City GeoIP database for regional data, or log imports changes what you hold and for how long. Your privacy notice has to describe the instance as you have configured it, and patching it is your job.
On our side, the jurisdiction page sets out how we handle complaints and authority requests. In short: a DMCA notice has no direct legal effect in Switzerland. We forward complete complaints to the customer, who must remove the content or justify it, and we act on a decision of a competent Swiss authority or where content is manifestly unlawful, following the Swico Code of Conduct Hosting 2025. Sending spam through port 25, attacking or scanning other networks, and hosting unlawful content are not allowed on any of our servers. Switzerland Hosting is operated by Hosta AG, a Swiss société anonyme (IDE CHE-107.875.655, Käppeligasse 1, 4125 Riehen); to reach us, open a support ticket from the client panel.
Catalogue·Options
Every configuration, every option, every price.
Six cloud VPS plans on AMD EPYC with local NVMe. Transfer is included on every plan, from 10 TB to 100 TB a month.
| Plan | vCPU | Memory | NVMe | Transfer | Port | Price | Deploy |
|---|---|---|---|---|---|---|---|
| StarterStaging, dev | 2 | 2 GB | 80 GB | 10 TB / month | 1 Gbps | $6.99/mo | Deploy Starter |
| StandardSmall apps | 4 | 4 GB | 160 GB | 15 TB / month | 1 Gbps | $12.99/mo | Deploy Standard |
| ProRecommendedProduction | 6 | 8 GB | 320 GB | 20 TB / month | 1 Gbps | $22.99/mo | Deploy Pro |
| PowerHeavy workloads | 12 | 16 GB | 640 GB | 40 TB / month | 2 Gbps | $42.99/mo | Deploy Power |
| UltraDatabases | 16 | 32 GB | 1000 GB | 60 TB / month | 2 Gbps | $65.99/mo | Deploy Ultra |
| SummitDense hosts | 32 | 64 GB | 2000 GB | 100 TB / month | 5 Gbps | $119.99/mo | Deploy Summit |
Every plan runs on AMD EPYC with local NVMe. Yearly billing costs about 25% less.
Every plan
- AMD EPYCon every host
- Local NVMenot network storage
- DDoS protectionalways on
- 1 IPv4 addressmore at $2 each
- VNC consoleand full root access
FAQ
Questions people ask first.
Short answers about running this in ALP1. If yours is not here, open a ticket from your panel.
Why self-host GoatCounter when goatcounter.com is free?
The hosted service is free for reasonable public use and suits a personal site well. Self-hosting makes sense when your traffic is beyond what the author considers reasonable, when you need several sites under one administration, or when you want the data on a server whose operator and jurisdiction you chose. On our VPS the instance sits in ALP1 under Swiss law, and you hold the only copy.
Can I move an existing goatcounter.com site to my own instance?
Export the site as CSV from goatcounter.com and load the file on your server with goatcounter import. Check the export first: since 2.6.0 the CSV is built from individual pageviews, which are no longer stored by default, so a site that never had that setting enabled may export less history than its dashboard shows.
Do my visitors need a consent banner?
GoatCounter sets no cookies for counting and stores no IP addresses on disk, which is why many operators run it without a banner. Whether that holds for you depends on your configuration and on the law that applies to your site, and we do not give legal advice. Describe the processing in your privacy notice either way.
Will ad blockers hide part of my traffic?
Some will. Blocklists can target analytics scripts and count endpoints, GoatCounter's included, and serving it from your own subdomain helps only partly. If you need numbers that a browser cannot suppress, import your web server logs with goatcounter import instead of, or alongside, the script.
I am in the EU. Can my analytics data sit in Switzerland?
Yes. In its review of 15 January 2024 the European Commission confirmed that Switzerland continues to ensure an adequate level of data protection, and decision 2000/518/EC remains in force. Personal data can therefore flow from the EU to a server in ALP1 without additional safeguards.
Does Swiss hosting put the data out of reach of US authorities?
As of 31 October 2026 the US Department of Justice lists CLOUD Act executive agreements only with the United Kingdom and Australia, none with Switzerland. We are a Swiss company and answer to Swiss law and Swiss authorities, but that is a narrower statement than "out of reach": an order valid under Swiss law is still an order. GoatCounter's design also means there is little personal data on the server to request.
Sources
Every fact on this page, with its source
Checked 4 Nov 2026 unless noted.
Swiss law and authorities
EU and other countries
- European Commission review of 15 January 2024 confirming Swiss adequacy (decision 2000/518/EC)European Commission, adequacy decisions
- CLOUD Act executive agreements (United Kingdom and Australia only), verified 31 October 2026US Department of Justice · verified 31 Oct 2026
Industry, providers and software
- GoatCounter README (features, self-hosting, Docker, PostgreSQL, sizing guidance)github.com
- GoatCounter releases, v2.7.0 of 15 December 2025, 2.6.0 and 2.5.0 notesgithub.com
- GoatCounter Dockerfile and compose.yaml (main branch)github.com
- goatcounter help serve and goatcounter help db textsgithub.com
- GoatCounter licence (modified EUPL 1.2, ISC for count.js)github.com
Other references
- Official Docker images and tag schemehub.docker.com
- Sessions and visitors (what is kept in memory and what is stored)goatcounter.com
- Hosted service terms of use and pricinggoatcounter.com
ALP1·Swiss Alps
Your server in the Alps, ready when you are.
Cloud VPS start at $6.99 a month and are usually set up within minutes of your order.
