Deploy Krab on Render for reliable cloud hosting with automatic HTTPS, monitoring, and scaling.
- Render account (https://render.com)
- GitHub repository
- API keys for your LLM providers
-
Connect GitHub Repository:
- Go to Render Dashboard
- Click "New" → "Web Service"
- Connect your GitHub repository
- Select the Krab repository
-
Configure Service:
Name: krab Runtime: Node Build Command: npm run build Start Command: npm run start:prod Plan: Starter ($7/month)
-
Environment Variables:
# Required: LLM Provider GEMINI_API_KEY=your_gemini_api_key OPENAI_API_KEY=your_openai_api_key ANTHROPIC_API_KEY=your_anthropic_api_key # Optional: Messaging Channels TELEGRAM_BOT_TOKEN=your_telegram_bot_token DISCORD_BOT_TOKEN=your_discord_bot_token LINE_CHANNEL_ACCESS_TOKEN=your_line_access_token LINE_CHANNEL_SECRET=your_line_secret # Render-specific NODE_ENV=production KRAB_RENDER=true KRAB_DEFAULT_MODEL=anthropic/claude-sonnet-4-5
-
Deploy:
- Click "Create Web Service"
- Wait for deployment to complete (usually 5-10 minutes)
-
Access Your App:
- Gateway:
https://krab.onrender.com(port 10000) - Control Panel:
https://krab.onrender.com/control - Health Check:
https://krab.onrender.com/health
- Gateway:
# Google Gemini (Free tier available)
GEMINI_API_KEY=your_api_key_here
# OpenAI
OPENAI_API_KEY=your_api_key_here
# Anthropic Claude
ANTHROPIC_API_KEY=your_anthropic_api_key
# DeepSeek (Budget-friendly)
DEEPSEEK_API_KEY=your_api_key_here# Telegram Bot
TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
# Discord Bot
DISCORD_BOT_TOKEN=your_discord_bot_token
# LINE Bot
LINE_CHANNEL_ACCESS_TOKEN=your_line_access_token
LINE_CHANNEL_SECRET=your_line_secret
# WhatsApp (requires QR pairing)
# Note: WhatsApp works best on VPS, not serverless# Model selection
KRAB_DEFAULT_MODEL=anthropic/claude-sonnet-4-5
KRAB_DEFAULT_MODEL_FALLBACK=openai/gpt-4o-mini
# Debug mode (set to 'false' for production)
KRAB_DEBUG=false
# Render-specific flags
NODE_ENV=production
KRAB_RENDER=true- Go to your Render service settings
- Click "Settings" tab
- Scroll to "Custom Domains"
- Add your domain and follow DNS instructions
- Render provides free SSL certificate
Render supports PostgreSQL databases:
-
Create Database:
- In Render dashboard, click "New" → "PostgreSQL"
- Choose plan (Starter is $7/month)
- Name it
krab-db
-
Connect to Application:
DATABASE_URL=your_render_postgres_url
-
Environment Variables: Render automatically provides these for PostgreSQL:
DATABASE_URL(External connection string)DATABASE_PRIVATE_URL(Internal connection)
# In Render dashboard
1. Go to your service
2. Click "Logs" tab
3. View real-time logs
4. Filter by time, level, or search termsRender automatically monitors your app using the /health endpoint.
- CPU/Memory Usage: Available in service dashboard
- Request Count & Response Times: Built-in monitoring
- Uptime: 99.9% SLA on paid plans
Upgrade your plan for more resources:
- Starter: 512MB RAM, 0.5 CPU
- Standard: 2GB RAM, 1 CPU
- Pro: 4GB RAM, 2 CPUs (and more)
Render supports horizontal scaling with multiple instances:
- Go to service settings
- Adjust "Instances" count
- Render automatically load balances
Render provides automatic daily backups for PostgreSQL databases.
# Connect to database
psql $DATABASE_URL
# Create backup
pg_dump $DATABASE_URL > backup.sql# Restore from backup
psql $DATABASE_URL < backup.sql# Check build logs in Render dashboard
# Common issues:
- Missing environment variables
- Node.js version mismatch
- Build timeout (increase timeout in settings)# Check application logs
# Common issues:
- Database connection failures
- Invalid API keys
- Port binding issues (Render uses $PORT)# Upgrade Render plan
# Or optimize your code:
- Reduce concurrent operations
- Use streaming responses
- Implement proper error handlingEnable debug logging:
# Set in Render environment variables
KRAB_DEBUG=trueRedeploy to apply changes.
Render offers a generous free tier:
- 750 hours/month
- 1GB bandwidth/month
- Static sites free forever
-
Use Free LLM Providers:
KRAB_DEFAULT_MODEL=gemini/gemini-2.0-flash
-
Optimize Resource Usage:
- Set appropriate timeouts
- Use caching for repeated requests
- Implement connection pooling
-
Monitor Usage:
- Check Render dashboard regularly
- Set up billing alerts
Render supports blue-green deployments:
# In render.yaml
services:
- type: web
name: krab
runtime: node
blueGreen: trueFor internal services:
services:
- type: pserv # Private service
name: krab-worker
runtime: node
plan: starterFor scheduled tasks:
services:
- type: cron
name: krab-cleanup
runtime: node
schedule: "0 2 * * *" # Daily at 2 AM
command: npm run cleanup- Never commit API keys to GitHub
- Use Render's environment variable management
- Rotate keys regularly
- Render provides automatic HTTPS
- Use private services for databases
- Implement rate limiting in your app
- Configure channel access policies
- Use Render's team features for collaboration
- Enable 2FA on your account
Render automatically deploys when you push to your connected branch.
# Trigger manual deployment
# In Render dashboard:
1. Go to your service
2. Click "Manual Deploy" → "Deploy latest commit"# Rollback to previous deployment
# In Render dashboard:
1. Go to "Deploys" tab
2. Find previous successful deploy
3. Click "Promote"Create separate services for different environments:
# Production
services:
- type: web
name: krab-prod
branch: main
# Staging
services:
- type: web
name: krab-staging
branch: developRender can send deployment webhooks to Slack, Discord, etc.
Use Render API for programmatic deployments:
curl -X POST \
https://api.render.com/v1/services/$SERVICE_ID/deploys \
-H "Authorization: Bearer $RENDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"branch": "main"}'- Create Render account
- Connect GitHub repository
- Configure environment variables
- Create web service
- Set up database (optional)
- Configure custom domain (optional)
- Test all features
- Set up monitoring
Happy deploying! 🎉