Back to Blog
    DevOps

    How to Deploy a Website: Vercel vs Netlify vs Cloudflare Pages (2026)

    Mortex TeamMarch 8, 202610 min read
    How to Deploy a Website: Vercel vs Netlify vs Cloudflare Pages (2026)

    You've built your website — now what? Deploying your site has never been easier thanks to modern hosting platforms. This guide compares the top 3 free deployment platforms and walks you through deploying your first project step by step.

    Cloud deployment and hosting

    🏆 Platform Comparison

    FeatureVercelNetlifyCloudflare Pages
    Free Tier100GB bandwidth100GB bandwidthUnlimited bandwidth
    Build Time6000 min/mo300 min/mo500 builds/mo
    Edge NetworkGlobal CDNGlobal CDN300+ PoPs
    Serverless Functions✅ Edge + Node✅ Netlify Functions✅ Workers
    Framework SupportNext.js (best)All frameworksAll frameworks
    Custom DomainFree SSLFree SSLFree SSL

    🚀 Deploy on Vercel (Step-by-Step)

    # 1. Install Vercel CLI
    npm install -g vercel
    
    # 2. Login
    vercel login
    
    # 3. Deploy from project root
    vercel
    
    # 4. Deploy to production
    vercel --prod
    
    # That's it! Your site is live at:
    # https://your-project.vercel.app

    🔷 Deploy on Netlify

    # 1. Install Netlify CLI
    npm install -g netlify-cli
    
    # 2. Login
    netlify login
    
    # 3. Initialize project
    netlify init
    
    # 4. Build and deploy
    npm run build
    netlify deploy --prod --dir=dist
    
    # Or connect GitHub repo for auto-deploy:
    # netlify.com → New Site → Import from Git

    ☁️ Deploy on Cloudflare Pages

    # Option 1: Via Dashboard
    # 1. Go to dash.cloudflare.com → Pages
    # 2. Connect GitHub/GitLab repo
    # 3. Set build command: npm run build
    # 4. Set output directory: dist
    # 5. Click Deploy!
    
    # Option 2: Via Wrangler CLI
    npm install -g wrangler
    wrangler login
    wrangler pages deploy dist/

    🌐 Custom Domain Setup

    # All 3 platforms follow similar steps:
    
    # 1. Add your domain in the dashboard
    #    e.g., www.mysite.com
    
    # 2. Update DNS records at your registrar:
    #    Type: CNAME
    #    Name: www
    #    Value: cname.vercel-dns.com (Vercel)
    #           your-site.netlify.app (Netlify)
    #           your-project.pages.dev (Cloudflare)
    
    # 3. Wait for SSL certificate (usually < 5 minutes)
    # 4. Enable "Force HTTPS" in settings

    ⚡ CI/CD — Auto-Deploy on Git Push

    All three platforms support automatic deployments when you push to GitHub:

    • Push to main → Production deploy
    • Push to feature branch → Preview deploy with unique URL
    • Pull Request → Preview link posted as comment
    🎯 Our Recommendation:
    • Vercel — Best for Next.js and React projects
    • Netlify — Best for static sites, forms, and simple backends
    • Cloudflare Pages — Best for unlimited bandwidth and global speed

    🔧 Environment Variables

    # All platforms support env vars in dashboard:
    # Settings → Environment Variables → Add
    
    # Example .env.local (never commit this!)
    VITE_API_URL=https://api.example.com
    VITE_STRIPE_KEY=pk_live_xxx
    DATABASE_URL=postgresql://user:pass@host/db
    
    # Access in code:
    const apiUrl = import.meta.env.VITE_API_URL;

    📊 Performance Tips

    • Enable image optimization (Vercel Image, Cloudflare Polish)
    • Use Cache-Control headers for static assets
    • Enable Brotli compression (all 3 support it)
    • Use lazy loading for images and routes
    • Minimize JavaScript bundle size with tree shaking