Skip to content

Connect a database

If your site stores or reads data, such as bookings, accounts, orders or uploads, connect it to a database. Your site’s Database tab connects Supabase, Neon or any other database you already use. You paste what your provider gives you, and we do the rest.

Only the workspace’s owners and admins can connect a database, and you can do it once your site has its first files.

Sites on Cloudzyro have no permanent disk. Files your site writes while it runs are temporary: they’re cleared each time a new version goes online, including when you restore an earlier version. That’s what lets every deploy start fresh and switch over without downtime.

So keep data in a database, not in files on the site. If we spot that a version saves data in its own files (for example a SQLite database or an uploads folder), we warn you after it goes live.

At the top, the tab says whether a database is connected. If we can tell from your site’s code which database settings it reads, such as SUPABASE_URL or DATABASE_URL, we list them under Your site’s code reads, each marked Set or Not set.

  1. Under Supabase, click Connect Supabase.

  2. Sign in to Supabase and allow access. Supabase asks you to let Cloudzyro read your projects, their API keys and connection settings. We use that once, to fill in your site’s settings, and can’t change anything in your Supabase account.

  3. Back in the console, choose the project for this site and click Use this project.

  4. If your site connects to the database directly, enter your Database password. Supabase never shares it, so use the one you chose when you made the project, or reset it in Supabase under Project Settings, Database.

  5. We test the connection and show what we’ll save. Click Save and deploy.

If your project is in another Supabase organisation, click Use another organisation or account.

This works for Supabase, Neon and most other databases.

  1. Copy the connection details from your provider:

    • Supabase: in your project, click Connect. Most sites built with AI use the project URL and anon key, which the App Frameworks tab shows as .env lines. If your site connects to the database directly, copy a connection string from the Connection String tab instead.
    • Neon: open your project, click Connect, turn on Show password and copy the connection string. Click Open Neon on the tab to go there.
    • Anything else: copy the connection string your provider shows, usually starting postgresql://, mysql://, mongodb+srv:// or rediss://.
  2. Under Paste a connection string, paste it into Connection string or .env lines exactly as your provider shows it.

  3. Click Check. We work out what each value is, name it the way your site’s code expects and test it. This can take a few seconds.

  4. If the string still says [YOUR-PASSWORD], enter your Database password and check again.

  5. Fix anything marked, then click Save and deploy.

If you paste a Supabase direct connection string, we switch it to one your site can use.

The details are saved as your site’s environment variables, named the way your code reads them. If your site already has a version, saving puts it online again so it uses them straight away. If it doesn’t, your site uses them from its first deploy.

To change or remove them later, connect again on the Database tab to replace them, or edit them on the Environment variables tab.

If the code also reads other settings that aren’t set yet, we say which, so you can paste those too.

Databases that only allow listed addresses

Section titled “Databases that only allow listed addresses”

If your database only lets in addresses you’ve listed, add 173.234.137.161, where your site runs. Our connection test may be turned away in that case: click Save anyway once you’ve added the address.