Build a Startup Cheatsheet
Hosting and Deployment (Vercel, Cloud Providers)
Use this Build a Startup reference while you build software engineering projects, review code for technical interview prep, or polish examples for a software engineer resume.
What Hosting and Deployment Mean
Hosting is where your code runs — the servers, containers, or edge nodes that execute your application and serve responses.
Deployment is the process of getting your code from a repository onto those servers and making it live.
Modern hosting platforms collapse the gap between the two: pushing to GitHub triggers a build, runs checks, and deploys automatically. You should expect to deploy multiple times per day.
The Layers You Need to Host
| Layer | What it does | Common choices |
|---|---|---|
| Frontend | Serves HTML, CSS, JS; handles SSR | Vercel, Cloudflare Pages, Netlify |
| Backend API | Runs server code; handles database queries | Railway, Render, Fly.io, AWS |
| Database | Stores persistent data | Supabase, Neon, Railway, RDS |
| File storage | Images, uploads, attachments | AWS S3, Cloudflare R2, Supabase Storage |
| CDN | Serves static assets from edge locations near users | Cloudflare (free), Vercel edge |
| Domain / DNS | Maps your domain to your servers | Cloudflare, Namecheap, Vercel |
For most early-stage startups, Vercel (frontend) + Supabase (database + storage) covers everything. No separate backend server required if you use Next.js API routes.
Vercel
Vercel is the default hosting choice for Next.js. It was built by the creators of Next.js and has the best integration.
Free tier: Unlimited personal projects, 100 GB bandwidth, 6,000 build minutes/month, unlimited deploys.
Pro: $20/user/month — adds team features, more bandwidth, password protection, longer build times.
How it works:
- Connect a GitHub (or GitLab/Bitbucket) repository
- Every push to
maintriggers a production deploy - Every pull request gets a preview URL (e.g.,
your-app-pr-42.vercel.app) - Environment variables managed in the Vercel dashboard
Pros: - Zero-config deploy for Next.js — works automatically - Global edge network — static assets served from 100+ locations - Preview deployments for every PR — teammates can review before merge - Built-in image optimization, analytics, web vitals - Serverless functions for Next.js API routes — no server to manage
Cons: - Vendor lock-in to Vercel-specific features (Edge Runtime, OG Image, etc.) - Free tier function execution limit: 100 GB-hours - Expensive at scale — function invocations and bandwidth add up fast - 10-second function timeout on the free tier (60 seconds on Pro) — not suitable for long-running tasks
When NOT to use Vercel: You have WebSockets, long-running background jobs, or high function execution volumes at tight margins. In those cases, self-host on Railway or a VM.
npm i -g vercel
vercel login
vercel --prod # deploy from local (or just push to GitHub)Cloudflare Pages + Workers
Cloudflare Pages hosts frontend apps. Cloudflare Workers runs serverless JavaScript at the edge (in 200+ locations globally, with no cold starts).
Free tier: Unlimited requests, 100,000 Worker requests/day, 500 deployments/month.
Pros: - Truly free at significant scale - No cold starts (Workers run in V8 isolates, not containers) - Workers KV (global key-value store), D1 (SQLite at edge), R2 (object storage) all available - Cloudflare is also your CDN, DDoS protection, and DNS — one dashboard
Cons:
- Workers run in a limited runtime — no Node.js APIs (fs, net, some crypto); must use Web APIs
- Next.js support is limited (not all features work on Cloudflare's Edge Runtime)
- D1 (SQLite) is not a substitute for Postgres at any real scale
- Configuration can be complex
When to use: You want maximum global performance at lowest cost; you are building an edge-first app; you want to consolidate DNS, CDN, and compute in one provider.
Railway
Railway deploys any server — Node.js, Python, Go, Docker — with a simple push-to-deploy workflow. Best choice for a custom backend server alongside Vercel.
Free tier: $5 credit/month (roughly one small service).
Pricing: Usage-based; a small Node.js server costs ~$5–$10/month. Postgres on Railway is ~$5/month.
Pros: - Deploy any language or Docker image - Managed Postgres, Redis, and MySQL as add-ons - Persistent processes (WebSockets, cron jobs, background workers work) - Simple environment variable management - Nice dashboard; logs and metrics included
Cons: - No free persistent tier; you pay from day one after the credit - Less mature than Heroku or AWS for very complex setups
When to use: You need a custom Express/FastAPI/Go server, WebSockets, or background jobs, and you want simplicity over raw AWS.
Render
Render is similar to Railway — deploy web services, workers, cron jobs, and databases. Strong Heroku alternative.
Free tier: Static sites free; web services spin down after 15 minutes of inactivity on the free tier (cold starts on first request).
Pricing: Individual services from $7/month for always-on.
Pros: - Good free tier for prototyping - Managed Postgres, Redis - Background workers, cron jobs supported - Health checks and auto-restart
Cons: - Free tier spin-down causes cold starts (15+ second delays on first request) - Slightly more expensive than Railway for equivalent resources
Fly.io
Fly.io runs your Docker containers on VMs distributed globally. More powerful than Railway, more complex than Vercel.
Pricing: Pay-as-you-go — no free tier for new organizations (the old free allowance of 3 shared-CPU VMs was discontinued). A small shared-CPU machine runs a few dollars a month, and stopped machines bill only for storage.
When to use: You need distributed compute in specific regions (low-latency for users in Europe, Asia, etc.); you are comfortable with Docker and want VM-level control without managing AWS.
AWS / GCP / Azure
The major cloud providers. Relevant when:
- You have enterprise customers with compliance requirements (SOC 2, HIPAA, ISO 27001)
- You need specific services not available elsewhere (Rekognition, Bedrock, BigQuery)
- Your team already has cloud expertise
- You are managing infrastructure for a large, high-traffic product
For an MVP or early-stage startup, the overhead of AWS (IAM roles, VPCs, security groups, load balancers) is not worth it. Start simple and migrate when you have the scale or compliance reason to do so.
The AWS path when you need it: - Compute: EC2 (VMs), ECS/Fargate (containers), Lambda (serverless) - Database: RDS for Postgres, DynamoDB for NoSQL - Storage: S3 for files, CloudFront for CDN - Deploy: Elastic Beanstalk (simple) or EKS (Kubernetes, complex)
File Storage: S3 and Alternatives
For user-uploaded files (avatars, attachments, images):
| Option | Free tier | Price | Notes |
|---|---|---|---|
| Cloudflare R2 | 10 GB storage, 1M Class A ops | $0.015/GB/month | No egress fees — biggest advantage over S3 |
| AWS S3 | 5 GB, 12 months | $0.023/GB/month + egress | Industry standard; mature ecosystem |
| Supabase Storage | 1 GB | $0.021/GB/month | Easiest if you already use Supabase |
| Uploadthing | 2 GB | $10/month flat | Simplest integration for Next.js |
| Backblaze B2 | 10 GB | $0.006/GB/month | Cheapest; S3-compatible API |
Recommendation: Cloudflare R2 for new projects — no egress fees means costs are predictable. Supabase Storage if you want zero extra services.
Domain Names and DNS
- Register your domain at Namecheap, Porkbun, or Cloudflare Registrar (cost-price; no markup)
- Point DNS to Cloudflare — free CDN, DDoS protection, and SSL automatically
- Add your domain in your hosting provider (Vercel, Railway) and create the CNAME/A records in Cloudflare
SSL: Vercel and most modern hosts provision SSL certificates automatically via Let's Encrypt. You do not need to buy an SSL certificate.
Deployment Workflow (Recommended)
Local dev → Push to GitHub → CI runs (build + type check) → Preview deploy (Vercel PR URL) → Merge to main → Auto-deploy to production
Set this up on day one. Every change should go through a pull request with a preview URL before hitting production.
Environment variables:
- development — .env.local on your machine (never commit to git)
- preview — set in Vercel/Railway for PR preview environments
- production — set in Vercel/Railway dashboard
Never hardcode secrets in source code.
Infrastructure Cost at Different Stages
| Stage | Monthly infra cost | Stack |
|---|---|---|
| Zero users | $0–$10 | Vercel free + Supabase free |
| 100 users | $25–$50 | Vercel Pro + Supabase Pro |
| 1,000 users | $50–$150 | Vercel Pro + Supabase Pro + Railway |
| 10,000 users | $200–$500 | Depends heavily on usage patterns |
| 100,000 users | $500–$2,000+ | Optimize before scaling; consider AWS |
Most startups should not worry about infrastructure costs until they are generating meaningful revenue. Optimize when cost becomes a real problem, not before.