Complete guide for deploying your custom n8n image with InstaGist to Render.com.
Since Render.com doesn't allow you to install packages directly on their managed Docker containers, you need to:
- Build a custom Docker image with
yt-dlpandffmpeg - Push it to a container registry (Docker Hub or GitHub Container Registry)
- Deploy it on Render.com using your custom image
-
Create a Docker Hub account (if you don't have one)
- Go to hub.docker.com
- Sign up for free
-
Login to Docker Hub from your terminal
docker login
-
Build your custom n8n image
cd /Users/fribu/Sites/insta-gist docker build -t your-dockerhub-username/insta-gist-n8n:latest .
-
Test the image locally (optional but recommended)
docker run -p 5678:5678 your-dockerhub-username/insta-gist-n8n:latest
Visit http://localhost:5678 to verify n8n starts correctly
-
Push to Docker Hub
docker push your-dockerhub-username/insta-gist-n8n:latest
-
Go to Render.com Dashboard
- Navigate to render.com/dashboard
-
Create a New Web Service
- Click "New +" → "Web Service"
-
Configure the Service
- Deployment Method: Choose "Deploy an existing image from a registry"
- Image URL: Enter your Docker Hub image
your-dockerhub-username/insta-gist-n8n:latest
-
Configure Service Settings
- Name:
insta-gist-n8n(or your preferred name) - Region: Choose closest to your users
- Instance Type:
- Start with "Free" for testing
- Upgrade to "Starter" ($7/mo) or higher for production
- Port:
5678
- Name:
-
Add Environment Variables Click "Advanced" and add these environment variables:
Key Value Notes N8N_HOSTYour Render URL (e.g., insta-gist-n8n.onrender.com)Required N8N_PROTOCOLhttpsRender provides HTTPS WEBHOOK_URLhttps://your-app.onrender.comYour full Render URL GENERIC_TIMEZONEAmerica/New_YorkYour timezone N8N_ENCRYPTION_KEYGenerate a random string For credential encryption Generate encryption key:
openssl rand -hex 32
-
Create the Service
- Click "Create Web Service"
- Render will deploy your custom n8n image
- Wait for deployment to complete (5-10 minutes)
-
Access n8n
- Once deployed, visit your Render URL:
https://your-app.onrender.com - Complete n8n setup wizard
- Create your admin account
- Once deployed, visit your Render URL:
-
Import the workflow
- In n8n UI: Workflows → Import from File
- Select
n8n-workflows/instagram-gist-workflow.json
-
Add OpenAI credentials
- Credentials → Add Credential → OpenAI API
- Enter your OpenAI API key
-
Update webhook nodes
- The webhook URL will be:
https://your-app.onrender.com/webhook/instagram-gist - Note this URL for testing
- The webhook URL will be:
-
Activate the workflow
- Toggle the workflow to "Active"
export WEBHOOK_URL="https://your-app.onrender.com/webhook/instagram-gist"
./scripts/test-webhook.sh "https://www.instagram.com/reel/EXAMPLE/"If you prefer using GitHub's container registry:
-
Create a Personal Access Token
- Go to GitHub → Settings → Developer settings → Personal access tokens
- Generate new token with
write:packagespermission
-
Login to GHCR
echo YOUR_GITHUB_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
-
Build and tag the image
docker build -t ghcr.io/your-github-username/insta-gist-n8n:latest . -
Push to GHCR
docker push ghcr.io/your-github-username/insta-gist-n8n:latest
-
Make the package public (for Render to access)
- Go to GitHub → Your profile → Packages
- Find
insta-gist-n8n - Package settings → Change visibility → Public
Follow the same steps as Option 1, but use the GHCR image URL:
ghcr.io/your-github-username/insta-gist-n8n:latest
For automatic rebuilds when you update the Dockerfile:
-
Create a GitHub repository
cd /Users/fribu/Sites/insta-gist git init git add . git commit -m "Initial commit: InstaGist n8n workflow" git remote add origin https://github.com/your-username/insta-gist.git git push -u origin main
-
Create render.yaml (see next section)
-
In Render Dashboard
- Click "New +" → "Blueprint"
- Connect your GitHub repository
- Render will automatically detect
render.yaml
-
Approve and Deploy
- Review the configuration
- Click "Apply"
Create this file for automatic deployments:
services:
- type: web
name: insta-gist-n8n
env: docker
dockerfilePath: ./Dockerfile
plan: free # or 'starter' for production
region: oregon # or your preferred region
envVars:
- key: N8N_HOST
sync: false
- key: N8N_PROTOCOL
value: https
- key: WEBHOOK_URL
sync: false
- key: GENERIC_TIMEZONE
value: UTC
- key: N8N_ENCRYPTION_KEY
generateValue: true
healthCheckPath: /healthz- Sleep after 15 minutes of inactivity
- Service will spin down
- First request after sleep takes 30-60 seconds to wake up
- Not suitable for production
Solution: Upgrade to Starter plan ($7/mo) for always-on service
-
Ephemeral filesystem
- Temporary files are deleted on restart
/tmpis cleared periodically- This is fine for InstaGist (we cleanup files anyway)
-
Persistent storage
- n8n data needs to persist
- Use Render Disks (paid feature) or external database
For n8n persistence, add a disk:
- In Render Dashboard → Your Service → Settings
- Add a Disk
- Mount at
/home/node/.n8n - Size: 1GB should be sufficient
Required variables:
N8N_HOST=your-app.onrender.com
N8N_PROTOCOL=https
WEBHOOK_URL=https://your-app.onrender.com
N8N_ENCRYPTION_KEY=your-generated-keyOptional but recommended:
# For better performance
N8N_METRICS=true
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168 # 7 days
# For security
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=your-secure-passwordOption 1: Manual rebuild
# Rebuild and push
docker build -t your-dockerhub-username/insta-gist-n8n:latest .
docker push your-dockerhub-username/insta-gist-n8n:latest
# In Render: Manual Deploy → Clear build cache & deployOption 2: Automatic with render.yaml
# Just push to GitHub
git add .
git commit -m "Update Dockerfile"
git push
# Render will automatically rebuild and deploy- Check Render logs: Dashboard → Your Service → Logs
- Common issues:
- Missing environment variables
- Port mismatch (should be 5678)
- Build errors in Dockerfile
- Verify build completed successfully
- Check build logs in Render
- Try rebuilding with cache cleared
- Check n8n execution logs
- Verify OpenAI credentials are set
- Test with a known-good Instagram URL
- Free tier spins down after 15 min inactivity
- Upgrade to paid tier for production use
- Consider adding a health check ping to keep service warm
- Free tier: $0/mo (but sleeps after inactivity)
- Starter: $7/mo (always on, 512MB RAM)
- Standard: $25/mo (1GB RAM, better for high volume)
- Render Starter: $7/mo
- OpenAI API: ~$3-30/mo (depends on usage)
- Total: $10-40/mo
- Use Starter plan or higher (no sleep)
- Add persistent disk for n8n data
- Set N8N_ENCRYPTION_KEY
- Enable basic auth or set up proper authentication
- Set up custom domain (optional)
- Configure error notifications
- Set up monitoring/alerts
- Add rate limiting to webhook
- Implement caching for frequently accessed videos
- Set execution data retention policy
- Build and push your Docker image
- Deploy to Render.com
- Import the InstaGist workflow
- Add OpenAI credentials
- Test with a sample Instagram URL
- Consider upgrading to paid tier for production