- GitHub account (https://github.com)
- Render account (https://render.com) - Sign up with GitHub
- Vercel account (https://vercel.com) - Sign up with GitHub
# Initialize git if not done
cd instagram-clone
git remote add origin https://github.com/YOUR_USERNAME/instagram-clone.git
git branch -M main
git push -u origin mainOn Render.com:
-
Click "New +" → "PostgreSQL"
-
Fill in:
- Name:
instagram-postgres - Database:
instagram_clone - Username:
postgres - Click "Create Database"
- Name:
-
COPY AND SAVE the connection string (looks like):
postgresql://postgres:PASSWORD@server.render.com:5432/instagram_clone -
Click "New +" → "Redis"
-
Fill in:
- Name:
instagram-redis - Click "Create Redis"
- Name:
-
COPY AND SAVE the redis URL (looks like):
redis://default:PASSWORD@server.render.com:12345
On Render.com:
-
Click "New +" → "Web Service"
-
Select your
instagram-clonerepository -
Fill in:
- Name:
instagram-backend - Environment: Node
- Build Command:
cd backend && npm install && npm run build - Start Command:
cd backend && npm start
- Name:
-
Scroll down to "Environment" and add these variables:
NODE_ENV=production
PORT=5000
DB_HOST=<hostname-from-postgresql-connection-string>
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=<password-from-postgresql-connection-string>
DB_NAME=instagram_clone
REDIS_HOST=<hostname-from-redis-url>
REDIS_PORT=<port-from-redis-url>
REDIS_PASSWORD=<password-from-redis-url>
JWT_ACCESS_SECRET=mysupersecretaccesskey12345678
JWT_REFRESH_SECRET=mysupersecretrefreshkey12345678
FRONTEND_URL=https://your-vercel-project.vercel.app
- Click "Create Web Service"
- WAIT for deployment (5-10 minutes) - Watch the logs
- Once deployed, COPY the URL (e.g.,
https://instagram-backend.render.com)
On Render (Backend Service):
- Click on your
instagram-backendservice - Click "Shell" tab at top
- Paste and run:
npm run migration:run
- Wait for it to complete (should say "Migrations executed successfully")
On Vercel.com:
-
Click "Add New..." → "Project"
-
Select your
instagram-clonerepository -
Click "Import"
-
Fill in:
- Project Name:
instagram-clone(or any name) - Framework Preset: Vite
- Root Directory:
frontend - Build Command:
npm run build - Output Directory:
dist
- Project Name:
-
Add Environment Variables:
VITE_API_URL=https://instagram-backend.render.com/api/v1 VITE_SOCKET_URL=https://instagram-backend.render.com VITE_ENV=production -
Click "Deploy"
-
WAIT for deployment (2-5 minutes)
-
Once done, you'll see a Deployment URL (e.g.,
https://instagram-clone-abc123.vercel.app)
- Open your Vercel URL in browser
- Click "Sign Up"
- Create account with test email
- Verify email (check console logs if needed)
- Create a post
- Like/comment on posts
- Follow users
Frontend: https://your-vercel-project.vercel.app
Backend API: https://instagram-backend.render.com
API Docs: https://instagram-backend.render.com/api-docs
✅ 1 backend service (0.5GB RAM, auto-sleep after 15 min) ✅ 1 PostgreSQL database (256MB) ✅ 1 Redis instance ✅ Unlimited frontend deployments ✅ SSL/HTTPS included ✅ Custom domain support (paid) ✅ Automatic deployments from GitHub
Total Cost: $0/month
Cause: Free tier sleeps after 15 minutes Fix: Use free monitoring (UptimeRobot)
1. Go to https://uptimerobot.com
2. Add monitor: https://instagram-backend.render.com/health
3. Check every 5 minutes (keeps it awake)
Fix:
- Double-check variable names (case-sensitive!)
- Make sure DB_PASSWORD doesn't have special characters
- If it does, wrap in quotes:
"pa$$word"
Fix:
- Check VITE_API_URL in Vercel environment
- Make sure backend service is running (check Render dashboard)
- Try accessing
https://instagram-backend.render.com/healthdirectly
Fix:
- Open backend Shell in Render
- Run:
npm run migration:run - Wait for completion
Send this URL to friends:
https://your-vercel-project.vercel.app
- Check Render dashboard for resource usage
- Check Vercel analytics for frontend performance
- Monitor database size (256MB limit on free)
1. Vercel: Settings → Domains → Add custom domain
2. Render: Environment settings → Custom domain
3. Point your domain DNS to their nameservers
- Render automatically backs up PostgreSQL daily
- No action needed, included in free tier
- UptimeRobot: https://uptimerobot.com
- Monitors health endpoint
- Alerts if service goes down
- Keeps service awake (bonus!)
| Limit | Free Tier | When to Upgrade |
|---|---|---|
| RAM | 0.5GB | > 100 concurrent users |
| Database | 256MB | > 50k records |
| Bandwidth | 100GB/month | > 10k daily users |
| Auto-sleep | Yes (15 min) | Need always-on service |
Cheapest upgrades:
- Render Pro: $7/month per service
- Railway: $5/month base (pay-as-you-go)
- DigitalOcean: $12/month (all-in-one)
NODE_ENV=production
PORT=5000
DB_HOST=server.render.com
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=<your-postgres-password>
DB_NAME=instagram_clone
REDIS_HOST=server.render.com
REDIS_PORT=12345
REDIS_PASSWORD=<your-redis-password>
JWT_ACCESS_SECRET=<any-random-string>
JWT_REFRESH_SECRET=<any-random-string>
FRONTEND_URL=https://your-vercel-url
VITE_API_URL=https://instagram-backend.render.com/api/v1
VITE_SOCKET_URL=https://instagram-backend.render.com
VITE_ENV=production
PostgreSQL from Render:
postgresql://postgres:mypassword@dpg-abc123.render.com:5432/instagram_clone
↑ ↑ ↑
password host database
Extract:
DB_HOST:dpg-abc123.render.comDB_PASSWORD:mypasswordDB_PORT:5432DB_NAME:instagram_clone
Redis from Render:
redis://default:mypassword@grp-abc123.render.com:12345
↑ ↑ ↑
password host port
Extract:
REDIS_HOST:grp-abc123.render.comREDIS_PASSWORD:mypasswordREDIS_PORT:12345
- Create GitHub account and push code
- Create Render account
- Create PostgreSQL database
- Create Redis instance
- Deploy backend service
- Note backend URL
- Add environment variables to backend
- Wait for backend to deploy (5-10 min)
- Run migrations via Shell
- Create Vercel account
- Deploy frontend from GitHub
- Add VITE_API_URL environment variable
- Wait for frontend to deploy (2-5 min)
- Test signup, post, like, follow
- Share URL with friends!
If something doesn't work:
-
Check logs:
- Render: Click service → "Logs" tab
- Vercel: Click deployment → "Logs" tab
-
Common errors:
- "Connection refused" → Backend not running
- "404 Not Found" → Wrong API URL
- "No Such File" → Wrong build command
-
Get help:
- Render docs: https://render.com/docs
- Vercel docs: https://vercel.com/docs
- GitHub issues in your repo
Once deployed and working:
- WebSocket real-time updates
- Direct messaging
- Stories (24h expiry)
- Search functionality
- Explore/trending page
- Add image optimization
- Enable caching headers
- Use Cloudinary for image storage
- Move to paid Render/Railway/DigitalOcean
- Add monitoring and alerts
- Enable auto-scaling
✅ Deployed for FREE ✅ In ~30 minutes ✅ Using Render + Vercel ✅ No credit card needed ✅ Always-free tier included
Your app is now LIVE on the internet! 🎉
Share your deployed URL:
Frontend: https://your-vercel-project.vercel.app
API Docs: https://instagram-backend.render.com/api-docs
Enjoy your Instagram clone!