Migrate to Comwit Cloud
These guides move an existing app onto Comwit Cloud: your app runs on the brrrd runtime (Next/V8 isolates) and its database lives on Louhi (libSQL). They are written as runbooks — concrete file edits and commands — so a coding agent can execute the migration for you.
Pick your starting point
Section titled “Pick your starting point”| You are on… | Follow |
|---|---|
| A Next.js app (any host, no Cloudflare coupling) | From Next.js (15 & 16) |
| A Next.js app on Cloudflare Workers/Pages using D1 | From Cloudflare Workers + D1 |
If you have Cloudflare and D1, use the Cloudflare guide — it includes the database move. If you are on Cloudflare but use an external database (not D1), follow the Next.js guide for the runtime and just point your existing database connection string at your app’s environment.
The shape of every migration
Section titled “The shape of every migration”Whatever you are coming from, the migration is the same four moves:
- Build for brrrd — add
@brrrd/adapterto your Next config and build. The adapter emits a deployable package (dist/brrrd). - Provision a database — create a Louhi database with
comwit databases create(skip if your app has no database, or keeps an external one). - Point your app at it — for D1 apps, swap the database client to libSQL;
set
DATABASE_URL/DATABASE_AUTH_TOKEN. - Deploy —
comwit apps createthencomwit deploy --package ./dist/brrrd, optionally binding a custom hostname.
Before you start
Section titled “Before you start”- Install and sign in to the
comwitCLI — see Install the CLI & sign in. - Know your project id (
comwit projects list). Everything is created under a project. - Node + your package manager (the examples use
pnpm; npm/yarn work too).
What you get afterward
Section titled “What you get afterward”- App served on the brrrd runtime, reachable on a Comwit hostname (or your own domain — see Custom hostnames and Connect a domain to an app).
- A libSQL database on Louhi with rotatable tokens (Manage a database).
- Deploys you can automate from CI (CI/CD).