Deployment and hosting
تعیناتی اور میزبانی
42 min read
Three ways to see it
Deployment is moving code from your laptop to a machine that the public can reach. The choices in 2026 fall into three buckets. Platform-as-a-service (Vercel, Netlify, Render, Railway): you push to GitHub, they build and deploy automatically, you pay per usage. Virtual private servers (Hetzner, DigitalOcean, Linode): you rent a Linux box for a fixed monthly fee, install everything yourself, pay nothing extra for traffic. Local cloud (PTCL Smart Cloud, Cyber Internet Services): a Pakistani company hosts the VPS, often required for government workloads, generally costlier. Each bucket has a place. The right choice depends on traffic shape, latency requirements, and team skill.
Way one, PKR cost math for our Sialkot SME (estimated 5,000 monthly visitors, 50 GB bandwidth). Vercel hobby tier is free up to 100 GB bandwidth and 100,000 function invocations: this SME fits inside the free tier with room to spare; pro tier at USD 20 per developer per month kicks in at scale. Hetzner CX22 in Germany at 5 EUR per month gives 2 vCPU, 4 GB RAM, 40 GB SSD, 20 TB traffic; that is roughly PKR 1,600 per month and handles 100x this SME's traffic with one server. PTCL Smart Cloud equivalent: PKR 8,000 to 15,000 per month for similar specs, but inside Pakistan with PKR billing and Urdu support.
Way two, the deployment flow. The platform-as-a-service flow: connect your GitHub repo to Vercel, push to main, Vercel detects Next.js, runs npm install and npm build, deploys to a global CDN with a unique URL per pull request. Add a custom domain (sialkotleather.pk) by changing two DNS records at NIC.PK or wherever the domain is parked. Done in 30 minutes start to finish. The VPS flow: ssh into Hetzner, install Node.js, install nginx as a reverse proxy, install pm2 to keep your process alive, install Let's Encrypt for HTTPS, clone repo, build, start. Two hours the first time, ten minutes for subsequent projects.
Quick check
Quick check: what makes modern AI different from a rule-based program?
The why-tree
Why-tree level one: why a CDN matters? Because latency to Pakistan from a single server in Frankfurt is 120 ms. From a CDN edge in Mumbai or Karachi it is 20 ms. A page that paints in 800 ms feels fast; the same page from a single Frankfurt server with 30 assets to load takes 4 seconds and feels broken. Vercel, Cloudflare, and Bunny CDN all have South Asian edges.
Try this with Claude
AI-edge prompt to try with Claude: 'Write a step-by-step deployment guide for a Next.js + Postgres app on Hetzner CX22 from a fresh Ubuntu 24.04 LTS. Include nginx reverse proxy, Let''s Encrypt HTTPS, pm2 process manager, swap configuration, ufw firewall, fail2ban for SSH, automated daily pg_dump to Backblaze B2, and a GitHub Actions workflow that ssh-deploys on push to main. Estimate total PKR cost per year and total setup time.' Treat the answer as a checklist, not a script to paste blindly.
Sources
Sources and further reading. Vercel docs (vercel.com/docs). Hetzner docs (docs.hetzner.com). DigitalOcean tutorials (digitalocean.com/community). GitHub Actions docs (docs.github.com/en/actions). PTCL Smart Cloud service catalog. Let''s Encrypt and certbot docs. nginx documentation. The Twelve-Factor App methodology (12factor.net). Pakistan Software Export Board guidance on local hosting compliance.