Migrate from Vercel
Move Next.js backends, APIs, vercel.env secrets, crons and Postgres out of serverless timeouts.
On this page
Next.js backends and standalone Node or Python APIs usually move from Vercel to Gregale without code changes: Gregale builds Next.js in standalone mode or any Dockerfile, sets PORT, and passes configuration as environment variables. vercel.json does not carry over; this page maps Vercel's primitives to Gregale and walks through a move.
How Vercel maps to Gregale
| Vercel | Gregale |
|---|---|
| Project | App, deployed with gregale deploy |
| Serverless / Fluid Compute Function | Instance: a Firecracker microVM per instance. Idle apps pause after ~1s and park after the idle timeout (Scale to zero). |
Next.js build (next build) | Source build reads next build + next start and packs output: "standalone" automatically when needed (Deploy a Next.js app) |
Framework API routes (api/) and Node/Python services | Server process listening on 0.0.0.0 and PORT (Deploy a web framework) |
| Build & Output settings | hosting.start, hosting.health, and release.command in gregale.yaml (Deployment overrides) |
| Function duration caps | Long-running HTTP requests, streaming responses, and persistent workers run without serverless function cutoffs |
Edge / Redirect / Header rules in vercel.json | Edge rules (gregale gateway rate limits, headers, and path checks) and Edge caching |
| Environment Variables | Secrets (gregale env set) and environment variables |
| Vercel Postgres / Neon integration | Managed PostgreSQL, bound to the app as DATABASE_URL |
| Vercel Blob | Object storage (S3-compatible buckets with direct signed uploads) |
Vercel Cron (vercel.json crons) | Crons, which call an HTTP path on your app on a five-field schedule |
| Queue / background workarounds | Background worker service in a project, or Jobs |
| Persistent WebSockets / SSE | Supported on instances (gregale app my-api --websocket-enabled) or held at the edge with managed realtime (beta) |
| Preview Deployments per PR | Preview environments |
| Custom domains | Custom domains |
vercel logs | gregale logs my-api (Logs) |
| Instant Rollback / Rolling Releases | Automatic 1% → 10% → 50% → 100% canary rollouts with 5xx rollback, plus gregale rollback my-api --to v41 --restore-databases (Safe releases) |
| Spend Management | Hard monthly spend caps enabled by default on every paid plan (Cost controls) |
Translate vercel.json and framework settings
Keep the standard scripts in package.json (build: "next build", start: "next start"). A Vercel setup with a cron and health check:
// vercel.json
{
"crons": [
{
"path": "/api/internal/cleanup",
"schedule": "0 3 * * *"
}
]
}
becomes gregale.yaml:
# gregale.yaml
hosting:
health: /api/health
triggers:
- kind: cron
app: my-api
schedule: "0 3 * * *"
path: /api/internal/cleanup
Or create the cron via CLI with gregale cron create --app my-api --schedule "0 3 * * *" --path /api/internal/cleanup (Hobby and up). If you have standalone api/*.ts or api/*.py serverless handlers with no HTTP server entrypoint, wrap them into an Express/Hono or FastAPI router listening on 0.0.0.0:$PORT. Keep static marketing sites wherever you like if you only want to move your API and Next.js backend.
Check what Gregale detects from the repository root:
gregale deploy --dry-run
Copy the configuration and deploy
Pull your Vercel environment variables for the target environment into a KEY=VALUE file, then drop Vercel-injected variables (VERCEL, VERCEL_*, NX_*) and any POSTGRES_* / DATABASE_URL values you are replacing with managed PostgreSQL:
vercel env pull vercel.env --environment=production
grep -v -E '^(VERCEL|VERCEL_|POSTGRES_PRISMA_URL)=' vercel.env > gregale.env
Inspect gregale.env to make sure values are single-line without extra surrounding quotes (set multiline private keys with gregale env set --app my-api KEY=... after the first deploy). Then deploy and remove the local file:
gregale deploy --name my-api --secrets-file gregale.env
rm vercel.env gregale.env
If the deploy fails:
gregale app health my-api --errors
gregale logs my-api
The database and blob storage
Gregale has no one-step import from Vercel Marketplace Postgres providers:
-
Keep your external Postgres for now. Leave
DATABASE_URLingregale.env. Apps reach external hosts on ports 80 and 443 by default; on Pro and Scale, open PostgreSQL's port first withgregale app egress-ports add my-api 5432(see Networking). -
Move to managed PostgreSQL. Create a database and bind it:
bash gregale add postgres --app my-api gregale postgres attach my-api-postgres my-api --access migration --env MIGRATION_DATABASE_URLTake a
pg_dumpfrom your existing Postgres host and restore it through Connect from your laptop (which needs app tasks on your plan). Run schema migrations usingMIGRATION_DATABASE_URLas arelease.commandingregale.yaml;DATABASE_URLuses a transaction-mode connection pooler (Managed PostgreSQL). -
Replace Vercel Blob. Create an S3-compatible bucket with
gregale add bucket assets --app my-api --env productionand point uploads at signed URLs or zero-wake direct upload routes (Object storage).
Workers, crons, and multi-service apps
- Crons. Declared
triggersentries (kind: cron) ingregale.yamlorgregale cron createcall HTTP paths on your app at five-field cron schedules without keeping a VM warm (Crons). Protect internal paths with a shared secret header. - Background workers. Move long-running queue consumers or AI jobs that used to time out on serverless functions into a separate worker service inside a Compose file and deploy as a project. Services without
ports:run continuously as workers.
Switch traffic
Add your domain to the Gregale app and verify it as Custom domains describes, then update DNS. Once production traffic runs through Gregale with clean canary rollouts, remove the Vercel project or pause deployments.
Related articles
Vercel alternatives in 2026 compares the main platforms people move to from Vercel for backends.
Spotted a problem on this page? Tell us