Moving from Vercel
Most projects move without a code change. Copy the environment variables, compare a preview side by side, then switch the domain with no downtime.
What carries over unchanged
vercel.json,vercel.tomlorvercel.ts: redirects, rewrites, headers,cleanUrls,trailingSlash,crons,functions,images,regions,fluid,git.deploymentEnabledandignoreCommand. See the vercel.json reference.- Framework adapters:
@sveltejs/adapter-vercel,@astrojs/vercel, Nitro’svercelpreset,@vercel/react-routerand@vercel/remix. - System variables your code reads:
VERCEL=1,VERCEL_ENV,VERCEL_URL,VERCEL_BRANCH_URL,VERCEL_PROJECT_PRODUCTION_URL,VERCEL_REGION,VERCEL_DEPLOYMENT_IDand theVERCEL_GIT_*variables. - Request headers:
x-vercel-forwarded-for,x-vercel-idand thex-vercel-ip-*location headers. - Packages:
@vercel/functions(waitUntil,geolocation,ipAddress),@vercel/analytics(reports to forkrail’s Web Analytics),@vercel/firewallrate limit checks,@vercel/og,@vercel/otel, and services you reach with your own key (Neon, Upstash, Edge Config).
Move a project
- 1Create the project
Import the repository in the dashboard (New project → Import) or deploy it once from your terminal. Use the same root directory as on Vercel for a monorepo.
cd ~/code/storefrontforkrail - 2Copy the environment variables
Paste your
.envinto the dashboard’s Environment variables page, or add them withforkrail env add. Leave outVERCEL_OIDC_TOKEN: it’s a 12-hour Vercel token.printf '%s' "$DATABASE_URL" | forkrail env add storefront DATABASE_URL --target production - 3Check a preview side by side
Deploy a preview and request the same pages on both: status codes, headers (
x-vercel-cache), streamed pages, images, forms, and an API call or two. The build log warns about any Vercel-only service your code uses (below). - 4Deploy production
Production is live at
https://<project>.<your domain>while Vercel keeps serving your real domain.forkrail --prod - 5Move the domain without a gap
Add the domain in forkrail and let it get a certificate before DNS moves (the
_acme-challengerecord, or automatically on Cloudflare). Lower the record’s TTL, then point it at forkrail. Keep the Vercel deployment until traffic has moved. See Domains.forkrail domains add shop.example.com storefrontforkrail domains ls storefront # wait for "issued"
Services that need a key of their own
Some Vercel services sign in with an OIDC token that only Vercel can issue to its own functions. On forkrail they build and deploy, then fail at their first call. The build looks for them and prints a warning with the fix:
| Package | Fix |
|---|---|
ai 5+ / @ai-sdk/gateway (AI Gateway) | Set AI_GATEWAY_API_KEY, or call a provider directly, such as @ai-sdk/amazon-bedrock with a project IAM role. |
@vercel/blob | Set BLOB_READ_WRITE_TOKEN, or move the files to S3. |
workflow (Workflow SDK) | Set WORKFLOW_TARGET_WORLD=@workflow/world-postgres with a Postgres URL. |
@vercel/flags-core, @flags-sdk/vercel | Set the FLAGS SDK key. |
@vercel/sandbox | Pass a VERCEL_TOKEN, team id and project id to Sandbox.create. |
@vercel/queue | Use a queue in your own account, such as SQS, with a project role. |
@vercel/kms, @vercel/oidc-aws-credentials-provider | Give the project an IAM role: forkrail project NAME --role ROLE. The AWS SDK picks it up with no keys. |
@vercel/passport | Sign-in in the app, or deployment protection for a team-only site. |
upgradeWebSocket() | WebSockets aren’t supported yet. Use a WebSocket service of its own. |
Also worth checking
*.vercel.appURLs in code or settings: OAuth redirect URIs, CORS lists,NEXTAUTH_URL.- Integration variables Vercel added for you (
KV_REST_API_*,POSTGRES_URL*,EDGE_CONFIG,UPSTASH_*,DATABASE_URL): bring them along. - Compression works as on Vercel: the router compresses text answers (Brotli or gzip) for clients that ask, and leaves alone any your app already compressed or marked
content-encoding: identity. - Next.js is in beta on forkrail. Read Frameworks before moving a Next.js site.