# Lyna Cloud

The backend for your project: a managed SQL database, user sign-in, file storage, secrets, edge functions, an API, payments and reports, all managed from project settings.

Lyna Cloud gives your app a real backend, and you manage all of it from **Settings > Lyna Cloud** without leaving the editor.

Settings open on Lyna Cloud with the Database, Users, Storage, Secrets, Edge Functions, API, Payments and Observability pages in the sidebar.

## What you can do

- Set up Lyna Cloud, managed by Lyna, step by step, or connect a Supabase project you already own.
- Edit tables and rows, run SQL, apply migrations and restore backups.
- Let people sign up and sign in to your app, and manage their accounts.
- Upload files to buckets and serve them to your site.
- Keep API keys out of your code with secrets.
- Write, deploy and call edge functions.
- Try every REST, GraphQL, auth and storage request in the API studio.
- Connect your own Stripe account and query your payment data with SQL.
- Follow traffic, slow queries and errors in Observability.

## The Lyna Cloud pages

| Page                                                        | What it holds                                                                              |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [**Database**](/features/cloud/database)                    | Tables, SQL editor, migrations, backups, logs, security audit, advisor, keys and settings. |
| [**Users**](/features/cloud/users-and-auth)                 | Your app's users, sign-in methods, email templates and advanced auth settings.             |
| [**Storage**](/features/cloud/storage)                      | Buckets, folders and files.                                                                |
| [**Secrets**](/features/cloud/secrets)                      | App secrets in `.env` and edge function secrets.                                           |
| [**Edge Functions**](/features/cloud/edge-functions)        | Your functions, their code, logs and calls.                                                |
| [**API**](/features/cloud/api)                              | The API studio and your connection keys.                                                   |
| [**Payments**](/features/cloud/payments)                    | Your own Stripe account, connected to your database.                                       |
| [**Observability**](/features/cloud/logs-and-observability) | Reports on the database, the API, auth, functions and storage.                             |

## Set up a database

Every Lyna Cloud page runs on the project database. Until you add one, each page shows **Add a database first** with a **Set up a database** button.

1. ### Open the setup

   Open **Settings > Lyna Cloud > Database** and choose **Set up a database**. The **Set up database** window opens.
2. ### Pick where the data lives

   - **Lyna Cloud** (Recommended): Lyna creates and runs the database for you. The setup walks you through three steps: what Lyna Cloud includes (the database, sign-in, file storage that is private by default and shared through signed links, server functions, secrets, row level security on the tables Lyna creates, and a daily backup while the plan is active), the region (the one nearest you is picked and marked Recommended; it cannot be changed later), and a review. Then choose **Create Lyna Cloud**.
   - **Your Supabase project**: sign in with Supabase, choose one of your projects or create a new one, and the setup confirms what is connected.

   The Set up a database window on its question, with Lyna Cloud marked Recommended and Your Supabase project.
3. ### Wait for it to finish

   The setup shows each step as it runs: the database, sign-in, file storage, live updates and the API keys, then the keys saved to your project's environment. This usually takes a minute or two, and you can keep working. If something fails, the setup says so with **Retry**, or **Back** to pick another region. When it is ready, the setup says what is ready and the Database page shows your new database.

> [!NOTE]
>
> **Your app is wired for you**
>
> When the database is ready, Lyna writes the database endpoint and the publishable key to your project's `.env`. The code the AI writes reads them from there, so you never paste keys into your code.

> [!TIP]
>
> **From the chat**
>
> Ask the AI for something that saves data, such as a sign-up form or user accounts, and if the project has no database yet the chat offers the same choice: **Lyna Cloud** (Recommended), **Your Supabase project**, or **Continue without a database**. Picking one walks the same steps in the chat card itself, and once the database is ready the AI goes on with your request. Your own Supabase project works on every plan. Lyna Cloud comes with Pro: on Free, the chat offers **Your Supabase project** and **Continue without a database**. A project's paid features follow its owner's plan, so the editors of a Pro owner's project can set up Lyna Cloud too.

The database choice card in the chat, asking where this project should keep its data, with Lyna Cloud marked Recommended, the option to connect a project of your own, and Continue without a database.

> [!NOTE]
>
> **One Lyna Cloud database with Pro**
>
> Pro includes one Lyna Cloud database for the projects its owner owns, and each extra one is a monthly add-on. When every database is in use, the setup's review says **You have used your included Lyna Cloud database.** with the price of one more and an **Add a database** button for the owner (an editor reads that the owner can add one). Once it is added, choose **Create Lyna Cloud** again. Deleting a database frees its place; a paused database still counts. See [Subscription and usage](/features/account/subscription-and-usage#lyna-cloud-databases).

When the project already has a database, the chat does not ask: Lyna AI uses the one the project has and calls it by its name, **your Lyna Cloud** or **your Supabase project**.

## Managed or connected

|                 | Lyna Cloud                                      | Your Supabase project                                                            |
| --------------- | ----------------------------------------------- | -------------------------------------------------------------------------------- |
| Who creates it  | Lyna, in a few guided steps                     | You, in your Supabase account                                                    |
| How you connect | Nothing to do                                   | Sign in with Supabase (OAuth). No keys to copy.                                  |
| Leave it        | **Delete database** removes it and all its data | **Disconnect** unlinks it and keeps your data, or **Delete database** removes it |

If Lyna loses access to your Supabase account, the pages show a reconnect banner. Choose **Reconnect** and sign in again.

## Idle databases

A Lyna Cloud database of a project with no published site, that nobody uses for 30 days (no visits to its data, no work in the editor or with the AI), is archived: Lyna keeps a full copy of its data and its signed-up users, and stops the database. A project with a published site is never archived.

- **A warning first**: seven days before, the project's owner gets an email with a one-click **Keep my database** link. Using the database in that time keeps it too.
- **Keep always on**: in the database settings, the owner or an admin can keep it running for good.
- **It comes back on its own**: when you open the Lyna Cloud settings, choose **Restore the database**, or ask the AI for something that needs it, it comes back with its data and users in about 3 minutes. Its address and keys change, and Lyna writes the new ones to your project's `.env` for you.

Archiving a database never touches your project's code or pages. Some databases are always kept running: one that stores files, or uses edge functions, sign-in with an outside provider or its own email sender.

## Who can use it

- **Plan**: your own Supabase project, and its pages, file storage included, work on every plan. Lyna Cloud and its file storage come with the Pro plan of the project's owner, and so do payments. On Free, those pages show what they offer and a **See plans** button. See [Plans and credits](/introduction/plans-and-credits).
- **Role**: viewers can read the Lyna Cloud pages but cannot change anything, and keys stay hidden. Editors and above can make changes. See [Members and roles](/features/collaborate/members-and-roles).

## FAQ

### Do I need my own Supabase account?

No. Choose **Lyna Cloud** and Lyna runs it for you. Connect your own Supabase project only if you already have one, or want to manage it yourself as well.

### Can the AI use my database?

Yes. The AI can create tables, write queries and set up row level security when you ask. Some database changes ask for your approval first. See [Chat](/features/ai/chat).

### What happens to my data if I disconnect?

Disconnecting a Supabase project only unlinks it. Your data stays in your Supabase account, and you can connect it again later.

## Related

- [Database](/features/cloud/database): Tables, SQL, migrations and backups.
- [Users and auth](/features/cloud/users-and-auth): Sign-in methods and your app's users.
- [Secrets](/features/cloud/secrets): Keep keys out of your code.
- [Security best practices](/tips-and-tricks/security-best-practices): Protect your data with row level security.
