Deploy to Render
🎨 Deploy to Render
Deploy your ElizaOS agent to Render with automatic GitHub deployments and free tier options.
Prerequisites
- GitHub account
- Render account (free)
- ElizaOS agent working locally
- API keys ready (OpenAI/Anthropic/etc.)
Step 1: Prepare Your Repository
Create a GitHub Repository
- Create a new repository on GitHub
- Push your agent code:
cd your-agent-folder
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
git push -u origin main
Add Required Files
Ensure your repository has:
package.json
with start script:
{
"name": "my-elizaos-agent",
"version": "1.0.0",
"scripts": {
"start": "elizaos start",
"build": "echo 'No build required'"
},
"dependencies": {
"@elizaos/cli": "latest"
},
"engines": {
"node": ">=20.0.0"
}
}
render.yaml
(optional, for Infrastructure as Code):
services:
- type: web
name: my-elizaos-agent
runtime: node
buildCommand: bun install
startCommand: bun start
envVars:
- key: NODE_ENV
value: production
- key: DATABASE_URL
fromDatabase:
name: elizaos-db
property: connectionString
databases:
- name: elizaos-db
plan: free
databaseName: elizaos
user: elizaos
Step 2: Deploy to Render
Create New Web Service
- Go to render.com
- Click "New +" → "Web Service"
- Connect your GitHub account
- Select your repository
- Configure service settings:
- Name: your-agent-name
- Runtime: Node
- Branch: main
- Build Command:
bun install
- Start Command:
bun start
Configure Environment Variables
In the Render dashboard, add environment variables:
# Required - AI Provider (choose one)
OPENAI_API_KEY=sk-your-openai-key
# OR
ANTHROPIC_API_KEY=your-anthropic-key
# Optional - Platform Integrations
DISCORD_APPLICATION_ID=your-discord-app-id
DISCORD_API_TOKEN=your-discord-bot-token
TELEGRAM_BOT_TOKEN=your-telegram-token
TWITTER_API_KEY=your-twitter-api-key
TWITTER_API_SECRET=your-twitter-secret
TWITTER_ACCESS_TOKEN=your-access-token
TWITTER_ACCESS_SECRET=your-access-secret
# Database (if using PostgreSQL)
DATABASE_URL=postgresql://user:pass@host:5432/dbname
Step 3: Database Options
Option 1: Render PostgreSQL
- Click "New +" → "PostgreSQL"
- Configure database:
- Name: elizaos-db
- Database: elizaos
- User: elizaos
- Plan: Free (limited to 90 days) or Starter ($7/month)
- Copy connection string to
DATABASE_URL
Option 2: External Database
Use any PostgreSQL provider:
- Supabase (free tier)
- Neon (free tier)
- ElephantSQL (free tier)
Option 3: PGLite (Default)
No configuration needed - uses local file storage.
Note: Data may be lost on redeploy with free tier.
Step 4: Deploy Configuration
Free Tier Limitations
- Spins down after 15 minutes of inactivity
- 750 hours/month (enough for one service)
- Limited CPU and RAM
- No persistent disk (use external database)
Keeping Service Active
For 24/7 availability on free tier:
- Use external monitoring service (UptimeRobot, Pingdom)
- Set up health check endpoint
- Ping your service every 14 minutes
Add health endpoint to your agent:
// In your configuration
{
"settings": {
"port": process.env.PORT || 10000,
"healthCheckPath": "/health"
}
}
Step 5: Custom Domain
Add Custom Domain
- Go to Settings → Custom Domains
- Add your domain
- Update DNS records:
- Type: CNAME
- Name: your-subdomain
- Value: your-app.onrender.com
SSL Certificate
Render provides free SSL certificates automatically.
Deployment Tips
Auto-Deploy Setup
- Enable auto-deploy in Settings
- Every push to main branch triggers deployment
- Set up branch protection for production
Environment Management
Create separate services for staging/production:
# render-staging.yaml
services:
- type: web
name: my-agent-staging
branch: develop
envVars:
- key: NODE_ENV
value: staging
# render-production.yaml
services:
- type: web
name: my-agent-production
branch: main
envVars:
- key: NODE_ENV
value: production
Build Optimization
Speed up deployments:
{
"scripts": {
"postinstall": "echo 'Skipping postinstall'",
"build": "echo 'No build step required'"
}
}
Monitoring & Logs
View Logs
- Go to your service dashboard
- Click "Logs" tab
- Filter by:
- Deploy logs
- Service logs
- Time range
Set Up Alerts
- Go to Settings → Notifications
- Configure alerts for:
- Deploy failures
- Service failures
- High resource usage
Performance Monitoring
Monitor in dashboard:
- CPU usage
- Memory usage
- Response times
- Request count
Troubleshooting
Service Won't Start
Check for common issues:
"Error: Cannot find module" → Missing dependency
"EADDRINUSE" → Port conflict (use PORT env var)
"API key not found" → Check environment variables
Solutions:
- Verify package.json dependencies
- Use
process.env.PORT
for port binding - Double-check environment variables
- Check build and deploy logs
Slow Cold Starts
Free tier services spin down after inactivity:
- First request takes 30-60 seconds
- Use health check pings to keep active
- Upgrade to paid tier for always-on
Database Connection Issues
If using Render PostgreSQL:
- Check connection string format
- Verify database is running
- Check connection pool settings
- Review database logs
Memory Limits
Free tier has 512MB RAM limit:
- Optimize agent memory usage
- Reduce conversation history
- Limit concurrent connections
- Upgrade to paid tier if needed
Scaling & Optimization
Upgrade Options
When to upgrade from free tier:
- Need 24/7 availability without delays
- More than 750 hours/month usage
- Require persistent disk storage
- Need more CPU/RAM
Performance Tips
- Enable caching for repeated queries
- Optimize dependencies - remove unused packages
- Use connection pooling for database
- Implement rate limiting to prevent abuse
Cost Optimization
Render pricing tiers:
- Free: $0/month (limited features)
- Starter: $7/month (always-on, 512MB RAM)
- Standard: $25/month (1GB RAM, autoscaling)
- Pro: $85/month (4GB RAM, priority support)
Security Best Practices
Environment Variables
- Never commit secrets to GitHub
- Use Render's secret management
- Rotate API keys regularly
- Use different keys for staging/production
Network Security
- Enable force HTTPS
- Set up CORS properly
- Use rate limiting
- Implement request validation
Access Control
- Use GitHub branch protection
- Enable 2FA on all accounts
- Limit deploy permissions
- Monitor access logs
Support Resources
- Render Documentation: docs.render.com
- Render Community: community.render.com
- ElizaOS Discord: discord.gg/elizaos
- Status Page: status.render.com
💡 Pro Tip: Start with the free tier to test your deployment, then upgrade once you've validated your agent works well in production.
🚀 Quick Start: Use our render.yaml template for fastest setup!