This guide covers deploying KaireonAI using a fully managed cloud stack — no servers to maintain, automatic scaling, and managed databases.Documentation Index
Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
Production Stack
| Service | Provider | Purpose | Pricing |
|---|---|---|---|
| App Runtime | AWS App Runner | Hosts the Next.js application | Pay per vCPU/memory |
| Database | Supabase (PostgreSQL) | Primary data store via Prisma 7 | Free tier available |
| Cache | Upstash (Redis) | Enrichment caching, rate limiting | Free tier available |
| DNS | Route 53 | Domain management | ~$0.50/zone/month |
| CDN | CloudFront | Marketing site + static assets | Pay per request |
| Container Registry | Amazon ECR | Docker image storage | Pay per GB |
Step-by-Step Setup
Create a Supabase project
- Go to supabase.com and create a new project
- Choose a region close to your App Runner deployment
- Copy the Connection string (Settings → Database → URI)
- The format is:
postgresql://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres
Create an Upstash Redis database
- Go to upstash.com and create a new Redis database
- Choose the same region as your Supabase project
- Copy the Redis URL (starts with
rediss://) - Upstash provides TLS by default — the
rediss://protocol handles encryption
Create App Runner service
- Go to the AWS App Runner console
- Choose Container registry → Amazon ECR as the source
- Select the
kaireon-apirepository andlatesttag - Configure:
- CPU: 1 vCPU (or 2 for production)
- Memory: 2 GB (or 4 for production)
- Port: 3000
- Add environment variables:
Initialize the database
Run migrations against your Supabase database from your local machine:Then seed the admin user:
Updating
To deploy a new version:Monitoring
- App Runner logs — Available in the App Runner console or CloudWatch
- Supabase dashboard — Monitor database connections, query performance, and storage
- Upstash dashboard — Monitor Redis commands, memory usage, and latency
Required Environment Variables (Production)
In addition to the core variables shown above, production deployments on App Runner should include these security-related variables. The platform validates them at startup and will refuse to start if they are missing:Troubleshooting
ECR authentication expired ('no basic auth credentials')
ECR authentication expired ('no basic auth credentials')
ECR login tokens expire after 12 hours. Re-authenticate before pushing:If using CI/CD, ensure your pipeline refreshes the token on each run.
App Runner service fails to start (health check timeout)
App Runner service fails to start (health check timeout)
App Runner expects the application to respond on the configured port within 120 seconds. Common causes:
- Missing environment variables — The platform validates
DATABASE_URLand production secrets at startup. Check the App Runner logs in CloudWatch for[env-validation] Missing required environment variables. - Insufficient memory — The Next.js build requires at least 2 GB. For production, allocate 4 GB.
- Database unreachable — Ensure the Supabase connection string uses the direct connection (port 5432), not the pooler, and that the App Runner VPC can reach the database.
Database connection errors ('connection refused' or 'timeout')
Database connection errors ('connection refused' or 'timeout')
Supabase databases may require SSL. Ensure your Also verify the connection string uses the correct port (5432 for session mode, 6543 for transaction pooler).
DATABASE_URL includes ?sslmode=require if connecting from App Runner:App Runner deployment stuck in 'Operation in progress'
App Runner deployment stuck in 'Operation in progress'
App Runner deployments can take 5-10 minutes. If stuck beyond 15 minutes, check CloudWatch logs for the service. You may need to cancel the deployment and redeploy. Common causes include oversized Docker images (keep under 1 GB) and slow health checks.
Next Steps
Kubernetes Deployment
Self-host on any Kubernetes cluster with Helm.
Operations
Set up monitoring, metrics, and alerting.