Skip to main content
Deploying Instance to production requires HTTPS domains for both your Web Dashboard and API Server so Meta OAuth callbacks and real-time Instagram webhooks work reliably.

1. Production Environment Variables

Configure these variables in your hosting provider (or .env on your server):
Make sure you also configure R2_* variables if you use media uploads (Bio Link avatars, Sales Chat assets, Automation voice/PDF/images, and Scheduled Posts).

2. Database Migrations

Instance uses Prisma ORM. Always run migrations using DIRECT_URL before starting new API and worker builds:
  • Why both DATABASE_URL and DIRECT_URL? Serverless and managed Postgres providers (like Neon or Supabase) use a connection pooler (DATABASE_URL) for high-concurrency runtime queries, while Prisma schema migrations require a direct, unpooled connection (DIRECT_URL).
  • If deploying with docker-compose.yml, the db-migrate service runs migrations automatically before api and workers start.

3. Configure Meta Webhooks for Production

  1. Open your app in the Meta Developer Dashboard.
  2. Navigate to Instagram -> API setup with Instagram Business login -> Configure Webhook.
  3. Set Callback URL to:
    (Always include the /api/ prefix, because NestJS mounts all routes under /api.)
  4. Set Verify Token to match your META_WEBHOOK_VERIFY_TOKEN.
  5. Click Verify and Save, then subscribe to messages, messaging_postbacks, comments, message_reactions, and live_comments.

4. Health Checks and Cron Jobs

  • API Health Check: GET https://api.yourdomain.com/api/health returns 200 OK when the API, PostgreSQL, and Redis are healthy.
  • Background Workers (apps/workers): Must run continuously alongside apps/api to process outbound DMs, comment replies, profile enrichment, and scheduled posts.
  • Scheduled Cron Maintenance: Configure your cron runner (or Railway/GitHub Actions) to call the /api/cron/* maintenance endpoints with Authorization: Bearer <CRON_SECRET> so hourly rate-limit counters reset and paused accounts auto-resume on schedule.

5. Moving to Live Mode

In Development Mode, Instagram automations only fire for accounts listed as Instagram Testers. To enable automations for all public followers worldwide, complete Meta App Review.