Overview
Render provides:- One-click deployment from GitHub
- Automatic HTTPS/SSL certificates
- Zero-downtime deployments
- Automatic health checks
- Managed infrastructure
- Built-in monitoring
Prerequisites
Render Account
Sign up at render.com
GitHub Repository
Code hosted on GitHub (or GitLab)
OpenAI API Key
Valid API key with Whisper access
Render Configuration
The deployment is configured inrender.yaml at the project root:
Deployment Methods
Method 1: Render Dashboard (Recommended)
Connect GitHub
- Go to dashboard.render.com
- Click “New +” → “Web Service”
- Connect your GitHub account if not already connected
- Select your LangShazam repository
Configure Service
Basic Settings:
- Name:
langshazam-backend - Region: Choose closest to your users
- Branch:
main(or your default branch) - Root Directory:
backend
- Runtime: Python 3
- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn src.main:app --host 0.0.0.0 --port 10000
Set Environment Variables
Add these environment variables:
| Key | Value |
|---|---|
OPENAI_API_KEY | Your OpenAI API key |
PORT | 10000 |
PYTHON_VERSION | 3.9.0 |
Choose Plan
Free Tier:
- 512 MB RAM
- Shared CPU
- Sleeps after 15 min inactivity
- Great for testing
- 512 MB RAM
- Dedicated resources
- No sleep
- 24/7 availability
- 2 GB RAM
- Better performance
- Production-ready
Method 2: Render Blueprint (render.yaml)
This method requires a properly configured
render.yaml file in your repository root.Deploy from Dashboard
- Go to dashboard.render.com
- Click “New +” → “Blueprint”
- Connect your repository
- Render will detect
render.yamlautomatically - Enter
OPENAI_API_KEYwhen prompted - Click “Apply”
Method 3: Render CLI
Configuration
Environment Variables
Add or update environment variables in the Render dashboard:- Go to your service dashboard
- Click “Environment” tab
- Add/edit variables:
- Click “Save Changes”
- Service will automatically redeploy
Custom Domain
Add Custom Domain
- In service dashboard, go to “Settings” tab
- Scroll to “Custom Domains”
- Click “Add Custom Domain”
- Enter your domain (e.g.,
api.langshazam.com)
Health Checks
Render automatically monitors your service health. Default health check:- Endpoint:
/(root endpoint) - Expected: HTTP 200 response
- Interval: 30 seconds
- Go to “Settings” tab
- Scroll to “Health Check Path”
- Change if needed (default
/works for LangShazam)
Auto-Deploy
Render automatically deploys when you push to GitHub.Enable/Disable Auto-Deploy
- Go to service dashboard
- Click “Settings” tab
- Find “Auto-Deploy”
- Toggle on/off
Manual Deploy
Trigger manual deployment:- Go to service dashboard
- Click “Manual Deploy” button
- Select branch to deploy
- Click “Deploy”
Monitoring
View Logs
- Dashboard
- CLI
- Go to service dashboard
- Click “Logs” tab
- View real-time logs
- Filter by severity (Info, Warning, Error)
Metrics
View service metrics in the “Metrics” tab:- CPU usage
- Memory usage
- Request rate
- Response time
- Error rate
Alerts
Set up alerts in service settings:- Go to “Settings” tab
- Scroll to “Notifications”
- Add email or Slack webhook
- Configure alert conditions
Scaling
Vertical Scaling (Upgrade Plan)
- Go to service dashboard
- Click “Settings” tab
- Scroll to “Instance Type”
- Select a larger plan
- Click “Save Changes”
| Plan | RAM | CPU | Price/Month |
|---|---|---|---|
| Free | 512 MB | Shared | $0 |
| Starter | 512 MB | 0.5 CPU | $7 |
| Standard | 2 GB | 1 CPU | $25 |
| Pro | 4 GB | 2 CPU | $85 |
| Pro Plus | 8 GB | 4 CPU | $185 |
Horizontal Scaling (Multiple Instances)
Horizontal scaling is available on Pro plans and above.
- Go to “Settings” tab
- Scroll to “Scaling”
- Increase “Instance Count”
- Render automatically load balances
Connecting Frontend
Update your frontend CORS configuration to include your Render URL. Inbackend/src/config/settings.py:
Troubleshooting
Build Failed
Check logs for errors:- Go to “Events” tab
- Find the failed deployment
- Click “View Logs”
- Missing
requirements.txt - Wrong Python version
- Incorrect start command
- Missing dependencies
Service Unavailable
Free tier sleeping: Free services sleep after 15 minutes of inactivity.- First request takes 30-60 seconds (cold start)
- Upgrade to Starter plan ($7/month) for 24/7 availability
- Check logs for errors
- Verify
OPENAI_API_KEYis set - Check health check is passing
- Restart service manually
Slow Performance
Free tier limitations:- Shared CPU
- 512 MB RAM
- Slower cold starts
- Upgrade to Starter or Standard plan
- Optimize application code
- Use connection pooling
- Implement caching
Environment Variable Not Working
- Verify variable is set in dashboard
- Check spelling and capitalization
- Restart service after changes
- Check logs for “KeyError” or “None”
Cost Optimization
Free Tier
Free tier includes:
- 750 hours/month (enough for 1 service running 24/7)
- 100 GB bandwidth/month
- Automatic SSL
- Sleep after 15 min inactivity
- Personal projects
- Testing and development
- Low-traffic applications
- Demos and prototypes
Paid Plans
When to upgrade:- You need 24/7 availability
- Traffic exceeds free tier limits
- You need better performance
- You require custom domains
- Starter ($7/month): 1 service, 24/7, 512 MB RAM
- Standard ($25/month): 1 service, 24/7, 2 GB RAM
- 2x Standard ($50/month): 2 instances, load balanced
Security
Environment Variables
HTTPS
Render automatically provides:- Free SSL certificates
- Automatic renewal
- HTTPS redirects
- TLS 1.2+
DDoS Protection
Render includes:- Built-in DDoS mitigation
- Rate limiting
- Traffic filtering
Backup and Rollback
Rollback to Previous Deploy
- Go to “Events” tab
- Find the previous successful deployment
- Click “Rollback to this version”
- Confirm
Database Backups
LangShazam is stateless and doesn’t require database backups. If you add a database later, Render provides automatic daily backups.
Next Steps
Environment Variables
Configure all environment variables
CORS Setup
Allow your frontend domain
Custom Domain
Set up your own domain
Monitoring
Monitor your service

