- Create GitHub account → https://github.com
- Create Render account → https://render.com (sign up with GitHub)
- Create Vercel account → https://vercel.com (sign up with GitHub)
cd instagram-clone
git remote add origin https://github.com/YOUR_USERNAME/instagram-clone.git
git branch -M main
git push -u origin mainChecklist:
- Replaced
YOUR_USERNAMEwith actual GitHub username - No errors during push
- Code is now on GitHub (verify at github.com)
On Render.com dashboard:
- Click "New +" → "PostgreSQL"
- Fill in:
- Name:
instagram-postgres - Database:
instagram_clone - Username:
postgres
- Name:
- Click "Create Database"
- WAIT for database to be created (green status)
- Click on database
- Copy connection string:
postgresql://postgres:PASSWORD@HOST:5432/instagram_clone - SAVE connection string somewhere safe
Extract from connection string:
- Extract PASSWORD → save as
DB_PASSWORD - Extract HOST → save as
DB_HOST - Example:
postgresql://postgres:abc123@dpg-xyz.render.com:5432/instagram_clone- PASSWORD =
abc123 - HOST =
dpg-xyz.render.com
- PASSWORD =
On Render.com dashboard:
- Click "New +" → "Redis"
- Fill in:
- Name:
instagram-redis - Region: (closest to you)
- Name:
- Click "Create Redis"
- WAIT for Redis to be created (green status)
- Click on Redis instance
- Copy internal URL:
redis://default:PASSWORD@HOST:PORT - SAVE this URL
Extract from Redis URL:
- Extract PASSWORD → save as
REDIS_PASSWORD - Extract HOST → save as
REDIS_HOST - Extract PORT → save as
REDIS_PORT - Example:
redis://default:xyz789@grp-abc.render.com:6379- PASSWORD =
xyz789 - HOST =
grp-abc.render.com - PORT =
6379
- PASSWORD =
On Render.com dashboard:
-
Click "New +" → "Web Service"
-
Select your
instagram-clonerepository -
Configure:
- Name:
instagram-backend - Environment: Node
- Region: (same as database)
- Build Command:
cd backend && npm install && npm run build - Start Command:
cd backend && npm start
- Name:
-
Scroll down to "Environment"
-
Add all these variables (click "Add Environment Variable" for each):
| Key | Value | Source |
|---|---|---|
NODE_ENV |
production |
Type this |
PORT |
5000 |
Type this |
DB_HOST |
(your DB_HOST) | From Step 2 |
DB_PORT |
5432 |
Type this |
DB_USERNAME |
postgres |
Type this |
DB_PASSWORD |
(your DB_PASSWORD) | From Step 2 |
DB_NAME |
instagram_clone |
Type this |
REDIS_HOST |
(your REDIS_HOST) | From Step 3 |
REDIS_PORT |
(your REDIS_PORT) | From Step 3 |
REDIS_PASSWORD |
(your REDIS_PASSWORD) | From Step 3 |
JWT_ACCESS_SECRET |
my_super_secret_key_123 |
Type any string |
JWT_REFRESH_SECRET |
my_super_secret_refresh_123 |
Type any string |
FRONTEND_URL |
https://instagram-clone-YOURNAME.vercel.app |
Will update later |
- Click "Create Web Service"
- WAIT - Service is deploying (watch logs)
- Should take 5-10 minutes
- Look for "Build successful" message
- Service status turns green
- Copy the service URL (e.g.,
https://instagram-backend.render.com) - SAVE this URL
On Render (your backend service):
- Click on
instagram-backendservice - Click "Shell" tab at top
- Paste this command:
npm run migration:run
- Press Enter
- WAIT for completion
- Look for message: "Migrations executed successfully"
- Note any errors (screenshot if needed)
If error occurs:
-
Check database connection
-
Verify DB_PASSWORD has no special characters
-
Restart service and try again
-
Migrations completed successfully
On Render (your backend service):
- Click "Environment"
- Find
FRONTEND_URL - Update to your actual Vercel URL (will get after Step 8)
- For now, you can use placeholder or come back to this
- Click "Save"
On Vercel.com:
-
Click "Add New" → "Project"
-
Select your
instagram-clonerepository -
Click "Import"
-
Configure:
- 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 (click "Add" for each):
| Key | Value |
|---|---|
VITE_API_URL |
https://instagram-backend.render.com/api/v1 |
VITE_SOCKET_URL |
https://instagram-backend.render.com |
VITE_ENV |
production |
- Click "Deploy"
- WAIT - Frontend is deploying (2-5 minutes)
- When done, click "Visit" to see your live app
- Copy the URL (e.g.,
https://instagram-clone-abc123.vercel.app) - SAVE this URL
Back on Render (your backend service):
- Click "Environment"
- Find
FRONTEND_URL - Update value to:
https://instagram-clone-abc123.vercel.app(your Vercel URL) - Click "Save"
- Service auto-redeploys with new settings
- WAIT for green status
Open your frontend URL in browser:
- Frontend loads without errors
- Click "Sign Up"
- Fill in form:
- Email:
test@example.com - Password:
TestPass123! - Username:
testuser123 - Full Name:
Test User
- Email:
- Click "Sign Up"
- If email verification prompt appears:
- Check backend logs for OTP
- Or use
000000for testing
- Successfully logged in
- Navigate to home page
- Test features:
- Create post (if image upload ready)
- View feed
- Search for users
- Follow a user
Success checklist:
- Signup works
- Login works
- Basic features work
- No major errors in console
Free Render services sleep after 15 min inactivity. To keep them alive:
- Go to https://uptimerobot.com
- Click "Sign Up" (free)
- Click "Add New Monitor"
- Fill in:
- Monitor Type: HTTP(s)
- URL:
https://instagram-backend.render.com/health - Friendly Name: Instagram Backend
- Check Interval: 5 minutes
- Click "Create Monitor"
- Done! Service is monitored and kept awake
Your URLs:
Frontend: https://instagram-clone-YOURNAME.vercel.app
Backend: https://instagram-backend.render.com
API Docs: https://instagram-backend.render.com/api-docs
Health: https://instagram-backend.render.com/health
Share with friends:
https://instagram-clone-YOURNAME.vercel.app
| Step | Time | Status |
|---|---|---|
| 1. GitHub | 5 min | ✅ |
| 2. PostgreSQL | 5 min | ✅ |
| 3. Redis | 5 min | ✅ |
| 4. Backend | 15 min | ✅ |
| 5. Migrations | 2 min | ✅ |
| 6. Update URL | 1 min | ✅ |
| 7. Frontend | 10 min | ✅ |
| 8. Update URL | 1 min | ✅ |
| 9. Testing | 5 min | ✅ |
| 10. UptimeRobot | 2 min | ✅ |
| TOTAL | ~45 min | ✅ DONE |
Problem: Backend deployment fails
- Check logs (Render → Service → Logs)
- Check environment variables (typos?)
- Try restarting service
Problem: Migrations fail
- Run in Shell:
npm run migration:run - Check database connection string
- Verify DB_PASSWORD doesn't have special chars
Problem: Frontend can't connect to API
- Check VITE_API_URL in Vercel
- Make sure backend service is running
- Try:
https://instagram-backend.render.com/health
Problem: Services keep sleeping
- Set up UptimeRobot (Step 10)
- Or upgrade to paid plan
- All steps completed
- Frontend loads
- Signup works
- Backend running (green status)
- Database migrations successful
- No major errors
Ready to share your app! 🚀