{"catalogRevision":"cat_726f873af6f566cc","recipeId":"page:migrate:netlify-web-app:next-js","recipeRevision":"r1","canonicalPath":"/migrate/netlify-web-app/next-js","label":"Migrate Netlify web app: Next.js","title":"How to move a Next.js app from Netlify to Ample","family":"Migration guide","summary":"Move Next.js compute from Netlify web app to Ample, one component at a time. Destination verified on Ample: the app built, started and answered on its public HTTPS URL with encrypted configuration delivered. Source procedure: Copy environment variables from Site configuration (or `netlify env:list`) into an env file kept out of the repository. Move separately: Netlify Functions and Edge Functions become routes in the app or a separate Ample service; `_redirects`/`_headers` rules, Forms and Identity move into the app or its framework. Cutover: Add the custom domain with `ample domain add`, set the documented DNS records, keep the Netlify site until verified, then remove the domain from Netlify. Rollback: keep the source untouched until you confirm; nothing at the source is changed or deleted by this guide.","representativeQueries":["Migrate Netlify web app: Next.js","Where can I host Next.js built with Next.js?","I need a component-scoped export/import or reconfiguration procedure for Next.js, with compatibility checks, verification and rollback."],"breadcrumbIds":["discovery","migration","migration:compute-sources","migration:netlify-web-app","page:migrate:netlify-web-app:next-js"],"breadcrumbs":[{"id":"discovery","label":"Agent hosting discovery","canonicalPath":"/discover/discovery","kind":"root"},{"id":"migration","label":"Migration sources by component","canonicalPath":"/discover/migration","kind":"facet"},{"id":"migration:compute-sources","label":"Compute sources","canonicalPath":"/discover/migration/compute-sources","kind":"group"},{"id":"migration:netlify-web-app","label":"Netlify web app","canonicalPath":"/discover/migration/netlify-web-app","kind":"atom"},{"id":"page:migrate:netlify-web-app:next-js","label":"Migrate Netlify web app: Next.js","canonicalPath":"/migrate/netlify-web-app/next-js","kind":"recipe"}],"parentIds":["migration:netlify-web-app","stack:framework-next-js","intent:migrate-compute"],"parents":[{"id":"migration:netlify-web-app","label":"Netlify web app","canonicalPath":"/discover/migration/netlify-web-app","kind":"atom"},{"id":"stack:framework-next-js","label":"Next.js","canonicalPath":"/discover/stack/framework-next-js","kind":"atom"},{"id":"intent:migrate-compute","label":"Migrate compute","canonicalPath":"/discover/intent/migrate-compute","kind":"atom"}],"resourceRequirements":["primitive:compute","primitive:postgres"],"infrastructureRequirements":[{"primitiveId":"primitive:compute","label":"Compute","canonicalPath":"/discover/primitive/compute","status":"verified","summary":"Apps run in isolated x86_64 Firecracker microVMs; sizes are the priced VM sizes."},{"primitiveId":"primitive:postgres","label":"Postgres","canonicalPath":"/discover/primitive/postgres","status":"verified","summary":"Managed PostgreSQL 16 with pgvector runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied."}],"framework":"Next.js","workload":"Next.js","migrationSource":"Netlify web app","releaseStatus":"published","supportStatus":"verified","executionStatus":"unbound","docsOnly":true,"prerequisites":["Authorized access to the Netlify web app source and its export tooling","An inventory of every component in scope and out of scope","A validated backup or copy before any cutover","An Ample account token with servers:write, databases:read"],"testedConfiguration":{"template":"node-22","runtime":"node","size":"s-1vcpu-1gb","install":"npm install","build":"npm run build --if-present","start":"npm run start"},"inputSchema":null,"outputSchema":null,"workflowSteps":[{"title":"Inventory the source","body":"List what Netlify web app provides beyond the component you are moving. Plan these separately: Netlify Functions and Edge Functions become routes in the app or a separate Ample service; `_redirects`/`_headers` rules, Forms and Identity move into the app or its framework."},{"title":"Source step 1","body":"Copy environment variables from Site configuration (or `netlify env:list`) into an env file kept out of the repository"},{"title":"Source step 2","body":"Translate `netlify.toml` build settings (command, publish directory) into the repository's own build script; Ample runs the detected build"},{"title":"Source step 3","body":"List Netlify-only features in use: functions, edge functions, forms, identity, redirects and headers rules"},{"title":"Deploy on Ample in parallel","body":"next build then next start -H 0.0.0.0 -p $PORT on the node-22 template. Pass the exported variables with --env; keep the source running.","command":"ample deploy . --name <app-name> --public --env-file .env.production"},{"title":"Validate before cutover","body":"Run the app's own checks and, for data, compare counts and checksums; the example checks are the pattern self-tests (/p/configuration-secrets, /p/relational-records)."},{"title":"Cut over","body":"Add the custom domain with `ample domain add`, set the documented DNS records, keep the Netlify site until verified, then remove the domain from Netlify."},{"title":"Rollback","body":"Point DNS or configuration back to the source. The source was never modified; deletion is a separate, user-executed step after validation."}],"examples":[{"title":"Next.js pattern fixture (destination)","description":"Verified destination basis: Next.js compute.","sourceRef":"tests/deploy-canaries/next-js-patterns"}],"successChecks":[{"description":"destination app responds on its public URL","kind":"http_get","path":"/","expect":"ample canary next js patterns"},{"description":"configuration-secrets check from the destination example","kind":"http_get","path":"/p/configuration-secrets","expect":"see the pattern fixture checks"},{"description":"relational-records check from the destination example","kind":"http_get","path":"/p/relational-records","expect":"see the pattern fixture checks"},{"description":"data or object counts and checksums match the source","kind":"manual","expect":"operator comparison before cutover"}],"limitations":["A step-by-step guide: each stage is an ordinary `ample deploy`, `ample database` or `ample bucket` command you run.","The destination side was verified on Ample with the pattern fixture; the source-side steps use Netlify web app's standard tooling.","Plan separately: Netlify Functions and Edge Functions become routes in the app or a separate Ample service; `_redirects`/`_headers` rules, Forms and Identity move into the app or its framework.","Verified on the node-22 template at s-1vcpu-1gb.","Managed PostgreSQL 16 with pgvector. Back up and restore with pg_dump and pg_restore."],"costEstimate":{"currency":"USD","monthlyAmount":10.0,"authoritative":true,"basis":"size prices from pricing.toml (loaded by the API) at build revision 3a3dfe06151688a20d397caac2aa66e562c23eb0","components":[{"name":"app server","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0},{"name":"managed PostgreSQL database","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0}],"note":"Upper-bound monthly price of the tested sizes at the destination."},"evidenceSummary":[{"kind":"canary_run","summary":"Destination side verified: the Next.js pattern fixture deployed on Ample (next build then next start -H 0.0.0.0 -p $PORT on the node-22 template) and its checks passed (the app built, started and answered on its public HTTPS URL with encrypted configuration delivered). The source-side export from Netlify web app uses the vendor's standard tooling.","observedAt":"2026-11-05T22:38:23Z","implementationRevision":"da3e37255e5a","expiresAt":"2027-05-04T22:38:23Z","scope":{"checks":["/p/configuration-secrets","/p/relational-records"],"destinationOnly":true,"template":"node-22"}}],"lastVerifiedAt":"2026-11-05T22:38:23Z","mcpBinding":null,"unknowns":[],"formats":{"html":"https://ample.computer/migrate/netlify-web-app/next-js","markdown":"https://ample.computer/migrate/netlify-web-app/next-js.md","json":"https://api.ample.computer/v1/catalog/recipes/page%3Amigrate%3Anetlify-web-app%3Anext-js"},"nextActions":[{"actionId":"browse-catalog","label":"Browse the catalog index","operationId":"catalog_index","method":"GET","relativePath":"/v1/catalog","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"search-recipes","label":"Search published recipes by intent, stack and constraints","operationId":"search_recipes","method":"POST","relativePath":"/v1/catalog/search","origin":"api","parameters":{"body":{"limit":5,"query":"Migrate Netlify web app: Next.js"}},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"plan:page:migrate:netlify-web-app:next-js","label":"Prepare a side-effect-free deployment plan for an authorized project","operationId":"plan_deployment","method":"POST","relativePath":"/v1/catalog/plan","origin":"api","parameters":{"body":{"inputs":{},"projectId":"<workspace or server id you own>","recipeId":"page:migrate:netlify-web-app:next-js","recipeRevision":"r1"}},"requiresAuthentication":true,"requiresApproval":false},{"actionId":"auth-setup","label":"Read the existing agent authentication setup","operationId":"existing_auth_setup","method":"GET","relativePath":"/mcp/setup","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:migration:netlify-web-app","label":"Browse Netlify web app","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/migration%3Anetlify-web-app","origin":"api","parameters":{"nodeId":"migration:netlify-web-app"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:stack:framework-next-js","label":"Browse Next.js","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/stack%3Aframework-next-js","origin":"api","parameters":{"nodeId":"stack:framework-next-js"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:intent:migrate-compute","label":"Browse Migrate compute","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/intent%3Amigrate-compute","origin":"api","parameters":{"nodeId":"intent:migrate-compute"},"requiresAuthentication":false,"requiresApproval":false}]}