Self-hosting coming soon
We're still working on the self-hosting release. This guide will be available when we launch. For now, use CroissantPay Cloud or get in touch to be notified when self-hosting is ready.
Deploy CroissantPay on your own infrastructure with Docker. (Coming soon.)
The fastest way to get CroissantPay running locally.
# Clone the repository
git clone https://github.com/croissantpay/croissantpay.git
cd croissantpay
# Start with Docker Compose
docker compose up -d
# CroissantPay is now running at http://localhost:3000Create a .env file to configure CroissantPay.
# Database
DATABASE_URL=postgresql://croissantpay:croissantpay@localhost:5432/croissantpay
# Deployment mode (self-hosted or cloud)
CROISSANTPAY_DEPLOYMENT_MODE=self-hosted
# Authentication
BETTER_AUTH_SECRET=your-secret-key-at-least-32-chars
BETTER_AUTH_URL=http://localhost:3000
# Optional: Email notifications (using Resend)
RESEND_API_KEY=re_xxxxxxxxxxxxx
EMAIL_FROM="CroissantPay <noreply@yourdomain.com>"Run database migrations to create the required tables.
# Using Docker
docker compose exec web pnpm db:push
# Or locally
cd apps/web
pnpm db:pushFor production, you'll want to configure SSL and use a proper domain.
Apple and Google webhooks require HTTPS. Use a reverse proxy like Nginx or Traefik with Let's Encrypt.
services:
traefik:
image: traefik:v2.10
command:
- "--providers.docker=true"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
- "--certificatesresolvers.letsencrypt.acme.email=you@example.com"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
ports:
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./letsencrypt:/letsencrypt"
web:
labels:
- "traefik.http.routers.croissantpay.rule=Host(`croissantpay.yourdomain.com`)"
- "traefik.http.routers.croissantpay.tls.certresolver=letsencrypt"# Use a managed PostgreSQL in production
DATABASE_URL=postgresql://user:password@your-db-host:5432/croissantpay
# Production URL
BETTER_AUTH_URL=https://croissantpay.yourdomain.com
# Strong secret (generate with: openssl rand -base64 32)
BETTER_AUTH_SECRET=your-very-long-random-secret-here
# Enable production mode
NODE_ENV=productionConfigure Apple and Google to send webhook notifications to your instance.
In App Store Connect → App → App Store Server Notifications
https://croissantpay.yourdomain.com/api/webhooks/appleIn Play Console → App → Monetization → Real-time notifications
https://croissantpay.yourdomain.com/api/webhooks/googleSet up automated database backups for production.
#!/bin/bash
# Daily PostgreSQL backup
DATE=$(date +%Y-%m-%d)
pg_dump $DATABASE_URL | gzip > "/backups/croissantpay-$DATE.sql.gz"
# Keep last 30 days
find /backups -name "croissantpay-*.sql.gz" -mtime +30 -deleteBETTER_AUTH_SECRET secure and never commit it to git