五折优惠 全部方案,限时优惠。起价 $2.48/mo
GoatCounter

GoatCounter

GoatCounter 是一款注重隐私的网站分析工具。无 Cookie、不追踪用户、符合 GDPR 规范,非商业用途免费使用。单个 Go 二进制文件,支持 SQLite 或 PostgreSQL 后端,由一位关注开放网络的独立开发者构建。极简可用的分析方案。

版本

最新

操作系统

Ubuntu Server 24.04 LTS

最小 RAM

1 GB

IP 类型

IPv4

访问

  1. 打开浏览器,访问: https://<SERVER_IP>
  2. 浏览器会出现 SSL 警告,这是预期的(自签名证书)
  3. 首次访问时创建第一个用户和站点。

重要文件与目录

  • 安装目录: /root/goatcounter
  • Docker Compose: /root/goatcounter/docker-compose.yml
  • 数据量 /var/lib/docker/volumes/goatcounter_goatcounter-data/_data
  • Nginx 配置: /etc/nginx/sites-available/goatcounter
  • 已启用的 Nginx 站点: /etc/nginx/sites-enabled/goatcounter
  • SSL 证书: /etc/nginx/ssl/

为域名启用 SSL

1. 将域名解析到服务器 IP。

2. 编辑 Nginx 配置,把两处 server_name <IP>; 替换为你的域名(<your-domain>)在 HTTP(端口 80)和 HTTPS(端口 443)两个块中都替换:

vim /etc/nginx/sites-available/goatcounter

3. 安装 Certbot:

apt install -y certbot python3-certbot-nginx

4. 运行以下命令生成有效的 Let's Encrypt 证书:

certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com

5. 替换 Nginx 配置中的 SSL 路径:

vim /etc/nginx/sites-available/goatcounter
# Before:
    # ssl_certificate       /etc/nginx/ssl/goatcounter.crt;
    # ssl_certificate_key   /etc/nginx/ssl/goatcounter.key;
# After:
    # ssl_certificate       /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    # ssl_certificate_key   /etc/letsencrypt/live/yourdomain.com/privkey.pem;

6. 重启 Nginx 以应用更改:

systemctl restart nginx

7. 打开浏览器,访问: https://yourdomain.com

更多监控内容

相关应用。

立即部署 GoatCounter。 起价 $2.48/月。