Chapter 14.4โ˜• 14 min read

Deploy Angular to Vercel, Netlify, Firebase

Deploy se pehle check karo โ€” ghar saaf karo mehmaan aane se pehle

01Pre-Deploy Checklist

Pre-Deploy Checklist

  • Run ng build --configuration production
  • Check bundle size: ng build --stats-json + bundlephobia.com
  • Remove console.logs (or use environment check)
  • Set correct API URLs for production
  • Run tests: ng test --watch=false

"Deploy se pehle check karo โ€” ghar saaf karo mehmaan aane se pehle"

Common mistake: API still pointing to localhost!

02Deploy to Vercel

Deploy to Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

# Or connect GitHub repo โ†’ auto-deploy on push

Vercel config for Angular SSR (vercel.json):

{
  "builds": [{
    "src": "dist/project-name/server/server.mjs",
    "use": "@vercel/node"
  }],
  "routes": [{
    "src": "/(.*)",
    "dest": "dist/project-name/server/server.mjs"
  }]
}

"Vercel = easy deploy โ€” GitHub connect karo, push karo, auto deploy"

Free tier: 100GB bandwidth, perfect for portfolio.

03Deploy to Netlify

Deploy to Netlify

# Build command in Netlify dashboard:
ng build --configuration production

# Publish directory:
dist/project-name/browser

For SSR: use @netlify/angular adapter.

Connect GitHub repo in Netlify dashboard โ†’ configure build command + publish directory โ†’ deploy.

"Netlify = Vercel ka competitor โ€” similar process, slightly different config"

Free tier: 100GB bandwidth + 300 build minutes/month.

04Deploy to Firebase

Deploy to Firebase Hosting

# Install Firebase CLI
npm i -g firebase-tools

# Initialize hosting
firebase init hosting
# -> Select dist/project-name/browser

# Deploy
firebase deploy

Or use GitHub Actions for auto-deploy.

"Firebase = Google ka hosting โ€” Angular ke saath natural pairing"

Good if you are already using Firebase for backend (Firestore, Auth, Functions).

05Comparison

Deployment Comparison

FeatureVercelNetlifyFirebase
Free Tier100GB100GB10GB
SSR SupportBuilt-inAdapter neededCloud Functions
Ease of SetupEasyEasyMedium
Auto-DeployGit pushGit pushGitHub Actions
Preview DeployPer PRDeploy previewsManual

"Sab free mein start kar sakte ho โ€” pick one based on your backend"

For Hyderabad portfolio: Vercel recommended (easiest, fastest SSR).

Key Takeaways

  • Always build with --configuration production before deploying
  • Vercel: easiest SSR deployment with auto-deploy on Git push
  • Netlify: easy for static, needs adapter for SSR
  • Firebase: great pairing with Firebase backend services
  • Use environment files to swap API URLs between dev and prod
Course Search
Search across all chapters & stages
๐Ÿ“–

Search the course

Type any topic โ€” branching, stash, rebase, hooks โ€” and jump straight to that chapter.

merge branchesgit stashundo commitrebase