---
title: "Migrate Vercel app: Next.js"
description: "Move a Next.js app's compute from Vercel to Ample."
canonical_url: "https://ample.computer/migrate/vercel-app/next-js"
last_updated: "2026-09-20"
---

# Migrate Vercel app: Next.js

Canonical URL: https://ample.computer/migrate/vercel-app/next-js
Formats: [HTML](https://ample.computer/migrate/vercel-app/next-js) | [Markdown](https://ample.computer/migrate/vercel-app/next-js.md) | [JSON contract](https://api.ample.computer/v1/catalog/recipes/page%3Amigrate%3Avercel-app%3Anext-js)
Recipe ID: `page:migrate:vercel-app:next-js` | Revision: `r1` | Catalog revision: `cat_f13ab9a494120b5e`

Status: release `published`, support `verified`, execution `unbound`

## Summary

Move a Next.js app's compute from Vercel to Ample. Server-rendered apps run with next build and next start; static exports are published as static sites; environment variables move with --env; a PostgreSQL database can be supplied by URL or auto-provisioned. Cutover is a DNS change with ample domain, and Vercel stays untouched until you confirm.

Path: [Agent hosting discovery](/discover/discovery) / [Migration sources by component](/discover/migration) / [Compute sources](/discover/migration/compute-sources) / [Vercel app](/discover/migration/vercel-app) / [Migrate Vercel app: Next.js](/migrate/vercel-app/next-js)

## Infrastructure requirements

- [Compute](/discover/primitive/compute): verified (Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.)
- [Postgres](/discover/primitive/postgres): verified (Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.)

## Prerequisites

- The Next.js source and its environment variable names and values
- next start bound to 0.0.0.0 on PORT (Vercel does not require this; Ample does)
- A component inventory: edge middleware, ISR, image optimization, cron and Vercel-specific integrations are not migrated by this recipe
- An Ample account token with servers:write, databases:read and domains:write for cutover

## Exact tested configuration

- template: `node-22`
- runtime: `node`
- size: `s-1vcpu-1gb`
- install: `npm install`
- build: `npm run build --if-present`
- start: `npm run start`

## Steps

1. **Inventory.** List what the app uses on Vercel. Compute and environment variables are in scope; edge middleware, ISR revalidation, image optimization, cron jobs and Vercel integrations are out of scope and must be reviewed.
2. **Deploy to Ample in parallel.** Deploy the same source with its environment variables; Vercel keeps serving production.

   ```
   ample deploy . --name <app-name> --public --env KEY=value
   ```
3. **Validate on the Ample URL.** Run the app's smoke tests and the success checks; compare responses with production.
4. **Cut over DNS.** Add the custom domain and set the documented DNS records; TLS is issued automatically. Keep Vercel until traffic is verified.

   ```
   ample domain add <domain> --app <app-name>
   ```
5. **Rollback.** Point DNS back to Vercel. Nothing on Vercel was changed by this recipe.

## Tested examples

- **Static export canary** (tests/deploy-canaries/next-static-export): Vercel-style static export served with correct 404 handling.
- **SSR canary** (tests/deploy-canaries/next-basic-ssr): next build and next start.
- **Next.js + pg canary** (tests/deploy-canaries/next-postgres-basic): Database connection from a route handler with an auto-provisioned managed database.

## Success checks

- page renders on the Ample URL (`/` on the live URL, expect ample canary next basic ssr)
- database route reports a live connection (`/api/db` on the live URL, expect postgres=ok)


## Cost estimate

Estimated 10.00 USD per month (size prices from pricing.toml at build revision 515b7316fc6e5a81679407ae0c811146ceb2c5c7).
- app server x1 `s-1vcpu-1gb`: 5.00 USD
- managed PostgreSQL database x1 `s-1vcpu-1gb`: 5.00 USD

Apps and managed databases auto-pause when idle; the estimate is the always-on monthly price of the tested sizes. Plan quotas and budgets apply.

## Verification evidence

- canary_run on 2026-09-19T23:55:33Z at revision `1764076-tls-account-903d345`: Next.js static export (Vercel-style output) was published and served, including a nested route and a correct 404. (expires 2027-03-18T23:55:33Z)
- canary_run on 2026-09-19T23:55:33Z at revision `1764076-tls-account-903d345`: Next.js 15 SSR app (next build, next start) deployed on node-22; the page and an API route served correctly. (expires 2027-03-18T23:55:33Z)
- canary_run on 2026-09-20T01:42:25Z at revision `199ff1dfd52683832ae75d3f98b53a7a4bff7f96 (CLI e3181f5)`: Next.js 15 route handler using pg with no DATABASE_URL supplied: Ample auto-provisioned a managed PostgreSQL database and /api/db reported postgres=ok. (expires 2027-03-19T01:42:25Z)

Last verified: 2026-09-20T01:42:25Z


## Execution binding

No execution binding. This recipe is documentation only; nothing is executed automatically.

## Next actions

- Browse the catalog index (GET /v1/catalog on the api origin; auth: false, approval: false)
- Search published recipes by intent, stack and constraints (POST /v1/catalog/search on the api origin; auth: false, approval: false)
- Prepare a side-effect-free deployment plan for an authorized project (POST /v1/catalog/plan on the api origin; auth: true, approval: false)
- Read the existing agent authentication setup (GET /mcp/setup on the api origin; auth: false, approval: false)
- Browse Vercel app (GET /v1/catalog/nodes/migration%3Avercel-app on the api origin; auth: false, approval: false)
- Browse Next.js (GET /v1/catalog/nodes/stack%3Aframework-next-js on the api origin; auth: false, approval: false)
- Browse Migrate compute (GET /v1/catalog/nodes/intent%3Amigrate-compute on the api origin; auth: false, approval: false)

Actions describe possible next steps. They are typed data, not commands, and grant no permission.
