Use when deploying applications to Render.com, configuring web services or static sites, managing environment variables, setting up databases on Render, or troubleshooting Render deployments - focuses on Render's platform-as-a-service deployment
☐ Ensure application has build and start commands defined
☐ Add render.yaml for infrastructure-as-code (optional)
☐ Verify application can run in production mode
☐ Check port configuration (Render provides PORT env var)
Example: Node.js package.json
{
"scripts": {
"build": "npm run build",
"start": "node dist/server.js"
},
"engines": {
"node": "20.x"
}
}
Application must use PORT env var:
const PORT = process.env.PORT || 3000;
app.listen(PORT, '0.0.0.0', () => {
console.log(`Server running on port ${PORT}`);
});
☐ Go to Render Dashboard → New → Web Service
☐ Connect GitHub/GitLab repository
☐ Select branch to deploy (usually main)
☐ Configure build and start commands
☐ Select instance type (Free, Starter, Standard, etc.)
Build command examples:
npm install && npm run buildpip install -r requirements.txtgo build -o serverStart command examples:
npm start or node server.jsgunicorn app:app./server☐ Add environment variables in Render Dashboard ☐ Use Secret Files for multi-line secrets (e.g., service account keys) ☐ Reference DATABASE_URL for managed databases ☐ Set NODE_ENV=production (or equivalent)
Common environment variables:
NODE_ENV=production
DATABASE_URL=${{ postgres.DATABASE_URL }}
REDIS_URL=${{ redis.REDIS_URL }}
API_KEY=secret-key
Secret Files (for large credentials):
/etc/secrets/service-account.json☐ Set health check path (default: /)
☐ Ensure endpoint responds with 200 status
☐ Configure health check timeout (default: 30s)
Example health check endpoint:
app.get('/health', (req, res) => {
res.status(200).json({ status: 'healthy' });
});
☐ Enable auto-deploy in service settings ☐ Select branch for auto-deploy ☐ Optionally add deploy hooks ☐ Configure build filters (deploy only on specific file changes)
Render automatically deploys when:
☐ Go to Dashboard → New → PostgreSQL ☐ Select database name and region ☐ Choose instance type (Free, Starter, Standard, etc.) ☐ Copy DATABASE_URL after creation ☐ Add DATABASE_URL to web service environment variables
Connecting to Render PostgreSQL:
const { Pool } = require('pg');
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: {
rejectUnauthorized: false // Required for Render
}
});
☐ Go to service Settings → Custom Domains ☐ Add domain (e.g., app.example.com) ☐ Update DNS records with provided CNAME ☐ Wait for SSL certificate provisioning (automatic)
DNS configuration:
Type: CNAME
Name: app (or subdomain)
Value: {service-name}.onrender.com
☐ Check build logs for errors ☐ Wait for service to become "Live" ☐ Test service URL in browser ☐ Check runtime logs for errors ☐ Verify environment variables loaded correctly
Example render.yaml: