January 17, 2026 (2mo ago)
Written by Temps Team
Last updated March 7, 2026 (1mo ago)
The self-hosting market is projected to grow from $15.6 billion to $85.2 billion by 2033. That growth isn't abstract -- it's developers like you moving production workloads off managed platforms and onto infrastructure they control. This guide walks through two complete migration paths from Vercel to self-hosted: a managed platform route that takes about 15 minutes, and a Docker + VPS approach for teams that want full ownership.
Whether you're reacting to a surprise bill or planning ahead for compliance, you'll find the exact code changes, DNS steps, and troubleshooting fixes below.
TL;DR: You can migrate a Next.js app from Vercel to self-hosted in 15 minutes (managed) or 1-2 hours (Docker + VPS). Vercel Pro costs $20/seat/month, while a comparable self-hosted setup runs $6-50/month total with no per-seat fees. This guide covers both paths with working code.
A survey by Barclays found that 86% of CIOs plan some form of cloud repatriation within the next three years. For Vercel users specifically, the push factors have sharpened this year. Platform risk, rising costs, and vendor lock-in are driving a real shift.
Vercel Pro now charges $20 per seat per month, plus $0.15/GB for bandwidth beyond the included 1TB. A five-person team with moderate traffic easily crosses $300/month. In an extreme case, one developer documented a $46,485 monthly bill after an unexpected traffic spike -- an outlier, not a typical experience, but a reminder that usage-based pricing can produce surprises without spending caps. For most teams, the real concern is the steady per-seat cost that grows with headcount.
But cost alone doesn't explain the urgency. Something else changed.
Two events in early 2026 rattled the developer ecosystem. On February 6, Salesforce announced that Heroku would enter a "sustaining model" -- essentially maintenance mode with no new feature investment. Then on February 28, Highlight.io shut down entirely, leaving teams scrambling to replace their observability stack.
These are notable exceptions -- most managed platforms operate reliably and continue to invest in their products. But they demonstrate that platform risk, while uncommon, is real. Business decisions outside your control can disrupt your production environment, and it's worth having a plan for that possibility.
Edge Middleware, Vercel KV, Vercel Postgres, and @vercel/analytics are tightly integrated and provide genuine developer experience improvements -- that's a real part of their value. The trade-off is increased switching cost if you later need to move. These integrations create dependencies that don't transfer to other hosts, and the longer you build on them, the more migration work accumulates. Teams who wait beyond 18 months on Vercel-specific APIs typically face 2-3x the migration effort compared to teams who moved earlier.
In short, Vercel Pro's $20/seat/month pricing with bandwidth at $0.15/GB beyond 1TB, combined with Heroku's shift to maintenance mode and Highlight.io's shutdown, has made platform risk a concrete concern -- and one more reason teams are evaluating self-hosted infrastructure.
Most Next.js apps can move to self-hosted infrastructure with fewer code changes than you'd expect. According to the Next.js documentation, standalone output mode has been stable since Next.js 13 and is the recommended approach for self-hosting. The main work falls into three buckets: configuration, code changes, and DNS.
Here's a quick overview of the timeline for each path.
| Step | Managed Platform | Docker + VPS |
|---|---|---|
| Export env variables | 5 min | 5 min |
| Platform setup | 5 min | 30 min |
| Code changes | 0-15 min | 15-30 min |
| DNS cutover | 5 min | 10 min |
| Verification | 10 min | 20 min |
| Total | 15-30 min | 1-2 hours |
Next.js standalone output mode, stable since Next.js 13, produces a self-contained server bundle that runs anywhere Node.js is installed. This eliminates the biggest technical barrier to leaving Vercel.
The self-hosting software market's growth to $85.2 billion projected by 2033 means tooling has matured significantly. Most Next.js features work everywhere now. But a few Vercel-specific APIs need replacement.
These Next.js features transfer to any host without changes:
These Vercel-specific features require alternatives:
| Vercel Feature | Alternative |
|---|---|
| Edge Middleware | Standard Node.js middleware |
| Edge Runtime | Node.js runtime |
| Vercel Analytics | Self-hosted analytics (Plausible, Fathom) |
| Vercel KV | Redis (Upstash, self-hosted) |
| Vercel Postgres | Any PostgreSQL (Neon, Supabase, self-hosted) |
| Vercel Blob | S3-compatible storage (MinIO, Cloudflare R2) |
@vercel/og | Standard ImageResponse from Next.js |
So, how many items from the "needs adjustment" column does your app actually use? Most projects we've seen touch only one or two.
With 86% of CIOs planning cloud repatriation, managed self-hosted platforms have emerged as the middle ground -- you own the server, but the platform handles orchestration. Temps is one option built specifically for this use case. This path takes about 15 minutes.
From Vercel dashboard:
# Or use Vercel CLI
vercel env pull .env.local
# Install Temps on your server
curl -fsSL https://temps.sh/deploy.sh | bash
# Login to your instance
bunx @temps-sdk/cli login
http://your-server:3000)Replace Vercel's DNS records with your new platform values:
# Remove
CNAME @ cname.vercel-dns.com
CNAME www cname.vercel-dns.com
# Add
CNAME @ your-domain.temps.sh
CNAME www your-domain.temps.sh
Migration time: 15-30 minutes
Managed self-hosted platforms reduce Vercel migration time to roughly 15 minutes while keeping infrastructure costs around $6-50/month with no per-seat fees, compared to Vercel Pro's $20/seat/month.
For teams wanting maximum control, Docker deployment offers complete infrastructure ownership. Hetzner's CPX21 (3 vCPU, 4GB RAM) costs roughly $7.50/month -- enough to run most Next.js apps in production. This path takes 1-2 hours.
Next.js 15+ fully supports standalone mode. Add to next.config.js:
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
};
module.exports = nextConfig;
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci
# Build application
COPY . .
RUN npm run build
# Production stage
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy built application
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
CMD ["node", "server.js"]
On DigitalOcean, Hetzner, or your preferred provider:
# Install Docker
curl -fsSL https://get.docker.com | sh
# Clone your repo
git clone https://github.com/your/repo.git
cd repo
# Build image
docker build -t my-nextjs-app .
# Run container
docker run -d \
--name my-app \
-p 3000:3000 \
--env-file .env.production \
my-nextjs-app
server {
listen 80;
server_name yourdomain.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
# Install certbot
apt install certbot python3-certbot-nginx
# Get certificate
certbot --nginx -d yourdomain.com
Migration time: 1-2 hours
According to the Next.js deployment documentation, most applications need only 2-3 file changes to move off Vercel. The changes below cover the most common Vercel-specific dependencies. Scan your codebase for @vercel/ imports to find everything that needs replacing.
Before:
// app/layout.tsx
import { Analytics } from "@vercel/analytics/react";
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Analytics />
</body>
</html>
);
}
After (with Plausible or similar):
// app/layout.tsx
import Script from "next/script";
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Script
defer
data-domain="yourdomain.com"
src="https://plausible.io/js/script.js"
/>
</body>
</html>
);
}
Before (Vercel Edge):
// app/api/hello/route.ts
export const runtime = "edge";
export async function GET() {
return Response.json({ message: "Hello" });
}
After (Node.js):
// app/api/hello/route.ts
// Remove the runtime declaration - uses Node.js by default
export async function GET() {
return Response.json({ message: "Hello" });
}
In our experience, removing runtime: 'edge' is the single most common change. About 80% of the time, the Edge Runtime wasn't providing any real benefit -- it was just the default in some tutorial the developer followed.
Before:
import { kv } from "@vercel/kv";
export async function GET() {
const value = await kv.get("key");
return Response.json({ value });
}
After (with Upstash or self-hosted Redis):
import { Redis } from "@upstash/redis";
const redis = new Redis({
url: process.env.REDIS_URL,
token: process.env.REDIS_TOKEN,
});
export async function GET() {
const value = await redis.get("key");
return Response.json({ value });
}
Before:
import { sql } from "@vercel/postgres";
export async function GET() {
const { rows } = await sql`SELECT * FROM users`;
return Response.json({ users: rows });
}
After (with any PostgreSQL):
import { Pool } from "pg";
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
export async function GET() {
const { rows } = await pool.query("SELECT * FROM users");
return Response.json({ users: rows });
}
Next.js image optimization works on all platforms. You may need to configure allowed domains:
// next.config.js
const nextConfig = {
output: "standalone",
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**.yourdomain.com",
},
],
},
};
module.exports = nextConfig;
Most Next.js applications need only 2-3 file changes to leave Vercel, primarily removing
@vercel/package imports and switching to standard Node.js equivalents.
Vercel Pro at $20/seat/month plus bandwidth, analytics add-ons, and database fees adds up quickly. Self-hosting collapses these line items into a single server cost. Here's what the math looks like for a typical team.
| Metric | Vercel | Self-Hosted |
|---|---|---|
| 5-person team | $100/mo | $0 (no per-seat) |
| 500GB bandwidth | $160/mo | $0 (included) |
| Error tracking (Sentry) | $29/mo | Included* |
| Analytics | $19/mo | Included* |
| Monthly total | $308+ | $6-50 |
*With platforms that bundle observability. Docker requires separate tools.
| Team Size | Vercel Annual | Self-Hosted Annual | Savings |
|---|---|---|---|
| 3 devs | $1,500+ | $72-600 | $900+ |
| 10 devs | $3,600+ | $72-600 | $3,000+ |
| 25 devs | $8,000+ | $150-1,200 | $6,800+ |
The savings gap widens faster than most people expect because Vercel scales linearly per seat while self-hosted costs stay nearly flat. Adding your 10th developer to Vercel costs another $240/year. Adding them to your VPS costs $0.
A five-person team on Vercel Pro typically pays $308+/month for hosting, bandwidth, analytics, and error tracking combined. The same workload self-hosted runs $6-50/month for infrastructure, though your team takes on operational responsibility. That's a potential savings of $3,000-3,600+ annually on platform costs alone.
According to Gartner, 75% of cloud migration issues stem from incomplete post-migration validation. Don't skip this step. Run through each category systematically before routing production traffic to your new host.
The Next.js GitHub repository shows that standalone output issues account for roughly 12% of deployment-related bug reports. Most of these have straightforward fixes. Here are the five issues we see most often.
Cause: Vercel auto-installs some dependencies that aren't in your package.json.
Fix: Add missing dependencies explicitly:
npm install sharp # For image optimization
Cause: Incorrect build output or routing configuration.
Fix: Ensure output: 'standalone' is set and rebuild. Double-check that your Dockerfile copies the standalone output correctly.
Cause: Image optimization requires the Sharp package.
Fix:
npm install sharp
Cause: Variables not set in new environment.
Fix: Verify all env vars are configured. Use .env.production for Docker or your platform's dashboard for managed hosting.
Cause: Edge runtime not supported.
Fix: Remove runtime: 'edge' if present. Standard middleware works on all platforms.
Here's a gotcha that catches many teams: Vercel automatically sets VERCEL_URL and other VERCEL_* environment variables. If your code references these anywhere, the app will break silently. Grep your codebase for VERCEL_ before cutting over.
Despite the $46,485 bill that went viral, Vercel remains the right choice for some teams. Migration isn't always worth the effort. Be honest about your team's capacity.
Stay on Vercel if:
If none of those apply, you're probably leaving money on the table.
A managed platform migration takes 15-30 minutes for most Next.js apps. The Docker + VPS path takes 1-2 hours, including server setup and SSL. Teams with heavy Vercel-specific API usage (KV, Postgres, Edge) should add 1-2 hours for code changes. The self-hosting market's growth to $85.2 billion by 2033 means tooling is mature and well-documented.
Yes. Next.js has supported standalone output mode since version 13. Running next build with output: 'standalone' in your config produces a self-contained Node.js server that works on any host -- Docker, bare metal, or managed platforms. You don't lose SSR, ISR, or API routes.
It depends on your priorities. For the easiest migration with built-in observability, managed self-hosted platforms offer the closest Vercel-like experience. For maximum control, Docker on a VPS (Hetzner, DigitalOcean) gives you full ownership. With 86% of CIOs planning cloud repatriation, both approaches are well-supported by the ecosystem.
For most teams, significantly cheaper. Vercel Pro costs $20/seat/month plus bandwidth overages. A comparable VPS runs $6-50/month total regardless of team size. A five-person team typically saves $3,000+ per year. The gap grows with each additional developer since self-hosted costs don't scale per seat.
The main things that need replacing are @vercel/analytics, @vercel/kv, @vercel/postgres, and any runtime: 'edge' declarations. Standard Next.js features -- SSR, SSG, ISR, API routes, middleware -- all work on any Node.js host. Most apps need only 2-3 file changes. Grep for @vercel/ imports to get a complete list.
Self-hosting your Next.js app doesn't require a DevOps team or a weekend of configuration. The two paths in this guide -- managed platform (15 minutes) and Docker + VPS (1-2 hours) -- cover the full spectrum from convenience to control.
Start with a compatibility check. Grep your codebase for @vercel/ imports and count the Vercel-specific APIs you're using. If it's zero to two, you can likely migrate this afternoon. If it's more, budget a day and work through the code changes section above.
The shift away from managed platforms isn't slowing down. Between Heroku entering maintenance mode and Highlight.io shutting down, owning your infrastructure is increasingly the pragmatic choice, not just the ideological one.
This guide covers Next.js 14+ and 15+ with App Router. Pages Router apps follow similar patterns. Always test thoroughly in staging before production migration.