# Migrate from Vercel

> Move your Next.js app from Vercel to Ownkube as a Web deployment with a real server, add managed Postgres, copy env vars, cut over, no rewrite.

Moving from [Vercel](https://vercel.com/) to Ownkube is mostly deploying your Next.js app as a **Web** deployment with a real, long-running server, adding a managed Postgres database if you used a Vercel storage add-on, and copying your environment variables. This guide walks the cutover, including the database dump and restore.

If your project is a static-only site with no backend, it deploys the same way, just without the database step below.

For a side-by-side of the two platforms, see [Ownkube vs Vercel](/docs/compare/vercel).

## What moves

| On Vercel | On Ownkube |
|---|---|
| Next.js project (SSR / serverless functions) | A **Web** deployment running Next.js in standalone output mode |
| Vercel Postgres or another storage add-on | A managed **PostgreSQL** database |
| Vercel Cron | A **Job** deployment with a schedule |
| Environment Variables | Environment variables on the deployment |
| Production / Preview domains | A public hostname with automatic TLS, plus your [custom domain](/docs/guides/custom-domain) |

## Migrate your app

1. **Connect your repo**

   Connect your GitHub or GitLab account so Ownkube can build from the same repo. See [Registries](/docs/features/registries).

2. **Set Next.js to standalone output**

   Ownkube runs your app as a persistent server rather than per-route serverless functions. In `next.config.js`, set `output: 'standalone'` so the build produces a self-contained server Ownkube can run directly.

3. **Create a Web deployment**

   From your [dashboard](https://app.ownkube.io/dashboard), create a **Web** deployment, point it at your repo and branch, and set the port your app listens on (Next.js defaults to `3000`). Ownkube builds from source, or uses your `Dockerfile` if you have one.

4. **Copy your environment variables**

   Bring over the values from your Vercel project's Environment Variables. Add them as `KEY=value` pairs and flip **Secret** on the sensitive ones. See [Environment variables](/docs/guides/environment-variables).

## Migrate your database

If your app used Vercel Postgres or a similar storage add-on, bring the data over. Skip this section if your project has no database.

1. **Create a managed Postgres database**

   Add a **Database** (PostgreSQL) in the same [environment](/docs/features/environments) as your app. Ownkube generates credentials and injects `DATABASE_URL` into your app. See [Databases](/docs/features/databases).

2. **Dump from your Vercel storage add-on**

   Using the connection string from your Vercel storage add-on's dashboard, dump the data:

   ```bash
   pg_dump "$VERCEL_POSTGRES_URL" --no-owner --no-privileges -Fc -f dump.pgc
   ```

3. **Restore into Ownkube**

   Turn on [public access](/docs/features/databases#public-access) for the new database (temporarily), then restore into it with TLS verification on:

   ```bash
   pg_restore --no-owner --no-privileges \
     -d "postgresql://user:pass@db-yourname.ownkube.app:5432/app?sslmode=verify-full&sslnegotiation=direct" \
     dump.pgc
   ```

   Turn public access back off when the restore finishes. For production traffic, connect from inside the network.

Do a trial run into a development environment first, verify row counts and a few queries, then repeat the dump/restore during a short maintenance window for the real cutover so you don't lose writes.

## Cut over

1. **Verify on Ownkube.** Open the generated hostname, exercise the app, and confirm it renders, reads, and writes the migrated database.
2. **Move your domain.** Point your [custom domain](/docs/guides/custom-domain) at the Ownkube deployment. TLS is provisioned and renewed automatically.
3. **Decommission Vercel** once traffic is served from Ownkube and you've confirmed a clean window.

## Want your own cloud later?

You can start on Ownkube Compute and, if you ever want your own data boundary or your own bill, [connect an AWS account](/docs/guides/connect-aws) and run the same app in your own VPC with no second migration. See [Clusters](/docs/features/clusters).

- [Ownkube vs Vercel](/docs/compare/vercel)
- [Deploy a Next.js app](/docs/deploy/nextjs)
- [Pricing](/docs/configuration/pricing)

---

**Don't see a feature you need?** Email [support@ownkube.io](mailto:support@ownkube.io?subject=Feature%20request). Ownkube is shaped by the teams using it and we ship what our users ask for.
