> ## Documentation Index
> Fetch the complete documentation index at: https://langbear.runbear.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Setup and run your LangBear app.

LangBear primarily supports [Supabase](https://supabase.io/) as a database provider.

## Create and configure a new LangBear app with Supabase

First, navigate to [Supabase](https://supabase.io/) and create a new project on Supabase.
You'll need to create an account if you don't already have one.

Then create a new LangBear app with the `--database` flag set to `supabase`.

```bash theme={null}
$ npx create-langbear-app my-app --database supabase
> Enter your Supabase URL: <your-supabase-url>
> Enter your Supabase key: <your-supabase-key>
```

The `create-langbear-app` command will set up your Supabase project with the tables LangBear needs.

## Configure an existing LangBear app with Supabase

If you already have a LangBear app and want to switch to Supabase, open `langbear.json` and set the `database` property to `supabase`.

```json theme={null}
{
  // ...
  "database": "supabase"
  // ...
}
```

Open `.env` and set the `SUPABASE_URL` and `SUPABASE_KEY` variables.

```
SUPABASE_URL=<your-supabase-url>
SUPABASE_KEY=<your-supabase-key>

NEXT_PUBLIC_SUPABASE_URL=<your-supabase-url>
```

## Start your app

Start your app with `npm run dev` and open [http://localhost:3030](http://localhost:3030) in your browser.

```bash theme={null}
$ npm run dev
```

### Custom ports

LangBear application uses port 3030 by default. You can use the `PORT` environment variable to customize the port LangBear application runs on. For example, use this command to run in port 3333:

```bash theme={null}
PORT=3333 npm run dev
```

In the next section, we'll learn how to deploy the LangBear app to Vercel.
