How to deploy a Next.js app without Vercel in 2026
Vercel is the default but it's not the only option. Step-by-step tutorial for deploying a Next.js app anywhere else — with environment variables, custom domain, image optimization, and Server Actions working out of the box.
Dmytro Chervonyi
Co-founder & CMO, livemy.app
Last updated
TABLE OF CONTENTS
item

AI Summary
Vercel built Next.js, which is why the deploy story there is the smoothest. It's not the only option. Next.js runs anywhere a Node.js server runs — Netlify, Cloudflare Pages (with the next-on-pages adapter), Railway, Render, livemy.app, your own VPS. The migration usually takes under 30 minutes for a real production app. This tutorial walks the complete step-by-step deploy on a non-Vercel host: extracting environment variables, configuring image optimization (Next.js Image needs an image loader outside Vercel), making Server Actions and API routes work (any Node.js runtime), setting up the custom domain with free SSL, and the five build errors that trip up most teams the first time. Plus the 3-minute flow to livemy.app at $20/month flat with no per-seat pricing or bandwidth overages.
What you need before starting
This tutorial assumes:
You have a working Next.js app locally (
npm run devshows the app onhttp://localhost:3000)The app is on GitHub (or you can push it there in 60 seconds)
Your local
.envhas the API keys / database URLs the app usesYou own a domain (or are happy with a subdomain on the host)
Total deploy time: about 15 minutes if everything goes right; 30–60 minutes if you hit one of the five common build errors covered below.
Why deploy Next.js outside Vercel
Three honest reasons.
Vercel Pro is per-seat. $20/seat/month plus usage on bandwidth, function invocations, and edge requests. A 5-person team is $100/month base before usage. A non-Vercel host with no per-seat math saves real money as the team grows.
Bandwidth overages on Vercel are spiky. 1 TB included on Pro, then $0.15/GB. A viral moment that pushes you to 5 TB costs $600 extra in that month. Flat-rate hosts like livemy.app don't meter bandwidth at all on the Maker plan.
Vendor lock-in is real for non-Vercel features. Vercel KV, Edge Config, ISR-on-demand revalidation — all Vercel-specific. The more you use, the harder it is to leave. Deploying on a neutral host from day one keeps your options open.
If any of those apply, the rest of this tutorial is the migration.
Step-by-step: deploy Next.js on livemy.app
Step 1: Push your Next.js app to GitHub
If you're starting from scratch, scaffold and push:
If your app already exists locally, just push it: git remote add origin git@github.com:you/my-app.git + git push -u origin main.
Step 2: Sign up at livemy.app, pick Maker
Go to livemy.app, click Start free. No credit card. Pick Maker ($20/month) for production hosting. The Free tier sleeps after 60 minutes of inactivity — fine for testing the deploy, not fine for a public site.
Step 3: Create a new project from the GitHub repo
In the dashboard: New project → Connect repo. Authorize the livemy.app GitHub app if it's your first connect. Pick your Next.js repo from the list.
livemy.app reads package.json, detects Next.js, sets the build command to next build and the output to .next. No configuration needed for typical apps.
Step 4: Set environment variables
Open your local .env (or .env.local) file. Copy every line.
In livemy.app, navigate to Project Settings → Environment Variables. Paste each variable as a key + value pair. Pay attention to the prefix convention:
NEXT_PUBLIC_*— exposed to the browser. Safe values only (public API URLs, feature flags). Never put a secret API key here.No prefix — server-side only. Use for database URLs, secret API keys, anything the browser shouldn't see.
Common environment variables for a Next.js app: DATABASE_URL, NEXTAUTH_SECRET, NEXTAUTH_URL, OPENAI_API_KEY, STRIPE_SECRET_KEY.
Step 5: Click Deploy
livemy.app runs npm install and next build. Typical time: 2 to 5 minutes for a small-to-medium Next.js app. Build log streams live in the dashboard.
When status flips to Live, you get a URL on your-app.livemy.site. Open it. Confirm the home page renders, navigation works, and any pages that hit the database respond correctly.
Step 6: Add your custom domain
Click Add custom domain in project settings. Paste your domain (e.g., myapp.com). livemy.app shows you the DNS records to add:
Apex domain (
myapp.com): A record pointing to livemy.app's IPwww subdomain: CNAME record pointing to
your-app.livemy.site
Add the records at your registrar (Cloudflare, Namecheap, GoDaddy, Porkbun — all support this in their DNS dashboard). Save.
DNS propagates in 1–10 minutes. SSL via free SSL certificate fires automatically within a few minutes of propagation. The browser padlock should appear without any manual cert configuration.
Step 7: Update NEXTAUTH_URL (if using NextAuth.js)
If your app uses NextAuth.js (now Auth.js), the NEXTAUTH_URL environment variable needs to match your custom domain. Update it in livemy.app's environment variables, redeploy.
Same for any auth provider's OAuth redirect URI (Google, GitHub, etc.) — update the redirect URI in each provider's dashboard to match the new domain.
Five build errors that trip up most teams
1. "Module not found" — missing dependency in package.json
Symptom. Build log says Module not found: Can't resolve 'X'.
Cause. The package is installed in node_modules locally but missing from package.json dependencies. Common after manually copying code from another project.
Fix. Run npm install X --save locally to add it. Commit the updated package.json and package-lock.json. Push. livemy.app redeploys automatically.
2. Environment variable used at build time isn't set
Symptom. Build fails with Error: ENV_VAR is not defined during next build.
Cause. Some Next.js code reads environment variables at build time (e.g., to inline a public API URL into the bundle). If the variable isn't set on the host before build, the build crashes.
Fix. Set every NEXT_PUBLIC_* variable in livemy.app's environment variables before the first build. Server-only variables can be set or missing; build-time public variables must be set.
3. Next.js Image component returns broken images
Symptom. The app loads, but every <Image> shows as broken or with a 404.
Cause. Vercel runs an image optimization API at the edge that next/image uses by default. On other hosts, the optimizer isn't built in.
Fix. Two options. Simplest: set unoptimized: true in next.config.js images config — works but loses optimization. Better: configure a third-party image CDN (Cloudinary, imgix, or Cloudflare Images) and point Next.js at it via images.loader in next.config.js. livemy.app auto-configures a basic image loader for Next.js projects on detection.
4. API routes work locally, 500 in production
Symptom. Hit an /api/* route in production, get a 500 error. Log says "Internal Server Error".
Cause. Usually a server-side environment variable missing on the host (database URL, API key the route depends on).
Fix. Check livemy.app's runtime logs (Dashboard → Project → Logs). The actual error message is usually clearer than the 500 response. Add any missing environment variables and redeploy.
5. Server Actions fail with "Action not found"
Symptom. A form using Server Actions submits but the server logs "Action not found" or similar.
Cause. Server Actions identifiers are hashed at build time. If the build runs in a different environment than the runtime, the hashes can mismatch — client expects one action ID, server has a different one.
Fix. Ensure your build and runtime use the same Node version. Set "engines": { "node": ">=18" } in package.json. Pin the Next.js version in package.json to avoid surprise updates.
Cost comparison for a 5-person team
Vercel Pro: $20/seat × 5 = $100/month base, plus usage on bandwidth + function invocations + edge requests. Real-world bills: $120–$200/month.
Netlify Credit Pro: $19/month + usage. Unlimited seats as of April 2026. Real-world bills: $25–$60/month.
livemy.app Maker: $20/month flat. Unlimited team members. No bandwidth metering. No edge request fees. $20/month, predictable.
Self-hosted on a $10 VPS: $10/month plus your time managing it.
FAQ
Can I really deploy any Next.js app outside Vercel?
Yes — Next.js is open source and runs anywhere Node.js runs. The Next.js team maintains documentation for self-hosting. Vercel-specific features (Edge Config, KV) need equivalents on other hosts, but the core framework is portable.
What about ISR (Incremental Static Regeneration)?
ISR works on any host that supports Next.js properly. On livemy.app, ISR runs out of the box because the build produces standard Next.js output and the runtime serves both static and dynamic routes. On hosts that don't fully support Next.js (some static-only hosts), ISR falls back to standard SSR.
Do Server Actions need anything special?
Just a Node.js runtime, which any modern host supports. The five-error section above covers the one quirk — build-vs-runtime version consistency.
How does the deploy compare to Vercel's preview deployments?
livemy.app, Netlify, Railway, and Render all support preview deployments per branch — push a branch, get a temporary URL. Vercel's edge in this area is the polish; functionally most hosts cover it.
What's the cheapest way to deploy Next.js?
For static-only Next.js (no server-side code, no API routes): Cloudflare Pages, free with unlimited bandwidth and custom domain. For full Next.js with server-side features: livemy.app Maker at $20/month flat, or self-host on a $5–10 VPS with Docker.
Can I migrate an existing Vercel project?
Yes. Connect the same GitHub repo to the new host, copy environment variables from Vercel's dashboard to the new host, swap the DNS record at your registrar. Most apps migrate in under 30 minutes. The longest part is usually verifying every page works as expected on the new host.
Deploy your Next.js app — 3 minutes, flat $20/month
If your Next.js app is on GitHub and you've got your .env values handy, you're three minutes away from a live URL on your own domain at $20/month flat.
→ Start free on livemy.app · No credit card · Auto-detect for Next.js including App Router, Server Actions, and Image optimization.
Stuck on one of the five build errors, or migrating an existing Vercel project? Email hello@livemy.app with the build log. Replies inside one business day.
Read next

Dmytro Chervonyi
,
Co-founder & CMO, livemy.app
Co-founder & CMO at livemy.app. 12 years as a CMO scaling SaaS from $0 to $10M+ ARR across marketing, sales, and infra products and tools. Now building the missing step between AI-built code and a live URL — for non-developers who’d rather ship than learn DevOps.


