How do I put my vibe coded app online with a database?

Published By the Rehome team

The short answer

Use a hosted Postgres database, give your app its address through an environment variable called DATABASE_URL, and run your app's migrations before you open it to people. Don't ship a SQLite file or an in-memory store: online, it gets wiped or can't be shared. Rehome creates Postgres for your app and connects it when you deploy.

“Vibe coded” apps often start with data stored in the simplest place that works on one computer: a local file, a SQLite database, or the browser’s own storage. That’s fine on your laptop. Online, it breaks in quiet ways.

Why the database matters online

  • Hosts restart your app. On many hosts the app’s disk is thrown away on every deploy or restart, and a SQLite file goes with it.
  • More than one copy can run. If the host runs two copies of your app, each has its own file, and users see different data.
  • Browser storage is per person. Data saved in localStorage never reaches anyone else, so it can’t hold accounts or shared content.

A hosted database fixes all three: it lives outside your app, survives deploys and is shared by every copy.

Steps

  1. Find where your app stores data. Ask Claude: “Where does this app store data, and what would be lost if the server restarted?”
  2. Pick Postgres. It’s the common choice, and almost every host and AI assistant handles it well.
  3. Create the database with your host or a database provider, and copy its connection address.
  4. Use an environment variable. Ask Claude to read the address from DATABASE_URL rather than writing it in the code.
  5. Create the tables. If your app has migrations (Prisma, Drizzle, Supabase SQL files), run them against the new database. If it doesn’t, ask Claude to add a setup script.
  6. Move existing data, if any. For a few rows, a quick script works. For Postgres to Postgres, use pg_dump and pg_restore.
  7. Keep the database private. Only your server should talk to it. If your front end talks to the database directly (as Supabase apps do), make sure row-level security is on.

Free database options and their catches

Free databases are common, but read the limits. As of November 2026, Supabase’s free plan pauses a project after 7 days without activity and allows 2 active projects. Railway’s free plan includes $1 of usage a month. Lovable Cloud charges database usage to a credit balance. None of these are bad choices; just know what happens when the free allowance runs out.

How Rehome does it

When you say “deploy” in Claude, Rehome looks for database code in your project. If it finds some, it creates a Postgres database for that app and gives the app its address as DATABASE_URL. You don’t create accounts, copy addresses or paste connection strings.

  • The free plan includes a 500 MB database and 1 GB of files. Starter has 2 GB, Pro 10 GB.
  • Nothing is paused or deleted when your app is quiet.
  • It’s standard Postgres, so you can export it whenever you like.
  • Apps written for Supabase (supabase-js) get a Supabase-compatible backend, so their code runs unchanged.

If your app was built in Lovable, see how to migrate off Lovable: Rehome moves the database, users and files in one step.

Questions

Which database should I use for an AI-built app?

Postgres is the safest default. It's what Supabase, Neon, Railway and most hosts offer, AI assistants write good code for it, and you can export it with standard tools if you move.

My app uses SQLite. Can I keep it?

Only on a host that gives your app a disk that survives restarts, and only with one copy of the app running. On most modern hosts, switching to Postgres is safer. Ask Claude to move the app to Postgres using a DATABASE_URL environment variable.

What happens to my data if I change hosts?

With standard Postgres you export it with pg_dump and restore it with pg_restore on the new host. Rehome's databases are standard Postgres, so you can take your data with you.