Skip to main content
Deploy Paperclip to production with authentication, hosted PostgreSQL, and proper security hardening.

Production Checklist

Before deploying to production:
1

Choose deployment mode

Configure authenticated mode with public exposure for internet-facing deployments.
2

Set up hosted database

Use a managed PostgreSQL service (Supabase, AWS RDS, etc.).
3

Configure authentication

Set explicit public base URL and configure Better Auth.
4

Enable secrets strict mode

Prevent inline secrets in environment variables.
5

Set up storage

Use S3-compatible storage for production file uploads.
6

Configure logging and monitoring

Set up log aggregation and health check monitoring.
7

Run security validation

Use pnpm paperclipai doctor to validate configuration.

Deployment Modes

Paperclip supports two deployment modes:

local_trusted

For: Local development, single-operator workflows
  • No login required
  • Localhost-only binding
  • Company deletion enabled
  • Fastest startup

authenticated

For: Production, multi-user, internet-facing deployments Two exposure policies:

Private Exposure

For: Private network access (VPN, Tailscale, LAN)
  • Login required
  • Auto URL detection
  • Lower friction setup
  • Private-host trust policy

Public Exposure

For: Internet-facing deployments
  • Login required
  • Explicit public URL required
  • Stricter deployment checks
  • Enhanced security validation

Configuration

Interactive Setup

Run the onboarding wizard:
You’ll be prompted for:
  1. Deployment mode (local_trusted or authenticated)
  2. Exposure policy (if authenticated): private or public
  3. Public base URL (if authenticated + public)

Environment Variables

For automated deployments, use environment variables:

Hosted Database Setup

Supabase

  1. Create a project at database.new
  2. Get connection string from Project Settings > Database > Connection string
  3. Use connection pooling (port 6543) for the application:
  1. Update packages/db/src/client.ts to disable prepared statements:
  1. Push schema using direct connection (port 5432):

AWS RDS

  1. Create PostgreSQL 17 instance
  2. Configure security groups for your deployment
  3. Set connection string:

Other Providers

Any PostgreSQL 17+ provider works:
  • Google Cloud SQL
  • Azure Database for PostgreSQL
  • DigitalOcean Managed Databases
  • Neon
  • Railway

Storage Configuration

S3-Compatible Storage

For production, use S3 or compatible services:

MinIO or Custom S3 Endpoint

Authentication Setup

Paperclip uses Better Auth for session management.

Set Public Base URL

Bootstrap Admin User

On first deployment in authenticated mode, the system creates a board claim URL. Check startup logs:
  1. Sign in as a regular user
  2. Visit the claim URL
  3. You’re promoted to instance admin

Allowed Hostnames

For multi-domain deployments:

Logging and Monitoring

Application Logs

Logs are written to:
  • Console: INFO level and above (JSON format in production)
  • File: .paperclip/logs/server.log (DEBUG level)
Log configuration in server/src/middleware/logger.ts:1.

Health Checks

Monitor /api/health endpoint:
Response:

Heartbeat Monitoring

Heartbeat scheduler runs every 30 seconds by default:

Docker Production Deployment

Build Production Image

Run with Production Config

Docker Compose Production

Validation

Run the doctor command to validate production setup:
This checks:
  • Deployment mode configuration
  • Database connectivity
  • Secret provider setup
  • Storage provider configuration
  • Authentication readiness
Use --repair to auto-fix issues:

Platform-Specific Guides

Railway

Click Deploy: Configure DATABASE_URL from Railway Postgres plugin

Render

Web Service + Postgres: Set environment variables in dashboard

Fly.io

Use fly.toml: Attach Postgres, configure secrets

AWS ECS

Task definition: Use RDS for database, S3 for storage

Security Best Practices

Always enable in production:
Prevent accidental data loss:
For hosted databases, use pooled connections (e.g., Supabase port 6543)
Store master key in a secure vault, not in environment variables
Set up uptime monitoring on /api/health

Next Steps

Security

Secure your deployment with best practices

Database

Advanced database configuration and migrations