Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ Our approach for client libraries is modular. Each sub-library is a standalone i
<tr>
<td>JavaScript (TypeScript)</td>
<td><a href="https://github.com/supabase/supabase-js" target="_blank" rel="noopener noreferrer">supabase-js</a></td>
<td><a href="https://github.com/supabase/postgrest-js" target="_blank" rel="noopener noreferrer">postgrest-js</a></td>
<td><a href="https://github.com/supabase/gotrue-js" target="_blank" rel="noopener noreferrer">gotrue-js</a></td>
<td><a href="https://github.com/supabase/realtime-js" target="_blank" rel="noopener noreferrer">realtime-js</a></td>
<td><a href="https://github.com/supabase/storage-js" target="_blank" rel="noopener noreferrer">storage-js</a></td>
<td><a href="https://github.com/supabase/functions-js" target="_blank" rel="noopener noreferrer">functions-js</a></td>
<td><a href="https://github.com/supabase/supabase-js/tree/master/packages/core/postgrest-js" target="_blank" rel="noopener noreferrer">postgrest-js</a></td>
<td><a href="https://github.com/supabase/supabase-js/tree/master/packages/core/auth-js" target="_blank" rel="noopener noreferrer">auth-js</a></td>
<td><a href="https://github.com/supabase/supabase-js/tree/master/packages/core/realtime-js" target="_blank" rel="noopener noreferrer">realtime-js</a></td>
<td><a href="https://github.com/supabase/supabase-js/tree/master/packages/core/storage-js" target="_blank" rel="noopener noreferrer">storage-js</a></td>
<td><a href="https://github.com/supabase/supabase-js/tree/master/packages/core/functions-js" target="_blank" rel="noopener noreferrer">functions-js</a></td>
</tr>
<tr>
<td>Flutter</td>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/realtime/getting_started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ conda install -c conda-forge supabase
### 2. Initialize the client

Get your project URL and key.
<$Partial path="api_settings.mdx" />
<$Partial path="api_settings.mdx" variables={{ "framework": "", "tab": "" }} />

<Tabs
scrollable
Expand Down
22 changes: 21 additions & 1 deletion apps/docs/content/guides/self-hosting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ subtitle: 'Install and run your own Supabase.'
hideToc: true
---

Self-hosted Supabase lets you run the entire Supabase stack on your own computer, server, or cloud infrastructure. This is different from:
Self-hosted Supabase lets you run the entire Supabase stack on your own computer, server, or cloud infrastructure.

This is different from:

- **Supabase CLI / Local Development**: A lightweight [local environment](/docs/guides/local-development) for development and testing only.
- **Managed Supabase** platform: If you want to try managed Supabase for free, visit [supabase.com/dashboard](/dashboard).
Expand Down Expand Up @@ -79,5 +81,23 @@ When you self-host, **you are responsible for**:

- Server provisioning and maintenance
- Security hardening and keeping OS and services updated
- Maintaining the Postgres database
- Backups and disaster recovery
- Monitoring and uptime

## Support and troubleshooting

For resolving common issues, see:

- [GitHub Discussions](https://github.com/orgs/supabase/discussions?discussions_q=is%3Aopen+label%3Aself-hosted) - Questions, feature requests, and workarounds
- [GitHub Issues](https://github.com/supabase/supabase/issues?q=is%3Aissue%20state%3Aopen%20label%3Aself-hosted) - Known issues

Self-hosted Supabase is community-supported. Get help and connect with other users:

- [Discord](https://discord.supabase.com) - Real-time chat and community support
{/* supa-mdx-lint-disable-next-line Rule003Spelling */}
- [Reddit](https://www.reddit.com/r/Supabase/) - Official Supabase subreddit

Share your self-hosting experience:

- [GitHub Discussions](https://github.com/orgs/supabase/discussions/39820) - "Self-hosting: What's working (and what's not)?"
66 changes: 24 additions & 42 deletions apps/docs/content/guides/self-hosting/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ You need the following installed on your system:

## System requirements

Baseline server requirements for running all Supabase components. These are suitable for development and small to medium production workloads:
Minimum requirements for running all Supabase components, suitable for development and small to medium production workloads:

| Resource | Minimum | Recommended |
|----------|---------|-------------|
| RAM | 4 GB | 8 GB+ |
| CPU | 2 cores | 4 cores+ |
| Disk | 50 GB SSD | 80 GB+ SSD |

If you don't need specific services, such as Analytics (Logflare), Realtime, Storage, Auth, or PostgREST, you can exclude them from `docker-compose.yml` to reduce resource requirements.
If you don't need specific services, such as Logflare (Analytics), Realtime, Storage, imgproxy, or Edge Runtime (Functions), you can remove the corresponding sections and dependencies from `docker-compose.yml` to reduce resource requirements.

## Installing Supabase

Expand Down Expand Up @@ -159,7 +159,7 @@ Use the key generator below to obtain and configure the following secure keys in
2. Copy the generated value and update `ANON_KEY` in the `.env` file.
3. Copy the generated value and update `SERVICE_ROLE_KEY` in the `.env` file.

The generated keys expire in 5 years. You can verify them at [jwt.io](https://jwt.io) using the JWT secret.
The generated keys expire in 5 years. You can verify them at [jwt.io](https://jwt.io) using the saved value of `JWT_SECRET`.

### Configure other keys, and important URLs

Expand Down Expand Up @@ -283,7 +283,7 @@ Each of the APIs is available through the same API gateway:

## Updating

We publish stable releases of the Docker Compose setup approximately once a month. To update, pull the latest changes from the repository and restart the services. If you want to run different versions of individual services, you can change the image tags in the Docker Compose file, but compatibility is not guaranteed. All Supabase images are available on [Docker Hub](https://hub.docker.com/u/supabase).
We publish stable releases of the Docker Compose setup approximately once a month. To update, apply the latest changes from the repository and restart the services. If you want to run different versions of individual services, you can change the image tags in the Docker Compose file, but compatibility is not guaranteed. All Supabase images are available on [Docker Hub](https://hub.docker.com/u/supabase).

To follow the changes and updates, refer to the self-hosted Supabase [changelog](https://github.com/supabase/supabase/blob/master/docker/CHANGELOG.md).

Expand All @@ -299,23 +299,29 @@ You'd like to update or rollback the Studio image. Follow the steps below:

## Uninstalling

<Admonition type="danger">

Be careful — the following destroys all data, including the database and storage volumes!

</Admonition>

To uninstall, stop Supabase (while in the same directory as your `docker-compose.yml` file):

```sh
# Stop docker and remove volumes:
docker compose down -v
```

<Admonition type="danger">

Be careful — the following destroys all data, including the database and storage volumes!
Optionally, ensure removal of all Postgres data:

</Admonition>
```sh
rm -rf volumes/db/data
```

Remove all Postgres data:
and all Storage data:

```sh
rm -rf volumes/db/data/
rm -rf volumes/storage
```

## Advanced topics
Expand All @@ -338,12 +344,12 @@ If the tools and communities already exist, with an MIT, Apache 2, or equivalent

- **[Studio](https://github.com/supabase/supabase/tree/master/apps/studio)** - A dashboard for managing your self-hosted Supabase project
- **[Kong](https://github.com/Kong/kong)** - Kong API gateway
- **[GoTrue](https://github.com/supabase/auth)** - JWT-based authentication API for user sign-ups, logins, and session management
- **[Auth](https://github.com/supabase/auth)** - JWT-based authentication API for user sign-ups, logins, and session management
- **[PostgREST](https://github.com/PostgREST/postgrest)** - Web server that turns your Postgres database directly into a RESTful API
- **[Realtime](https://github.com/supabase/realtime)** - Elixir server that listens to Postgres database changes and broadcasts them to subscribed clients
- **[Storage](https://github.com/supabase/storage)** - RESTful API for managing files in S3, with Postgres handling permissions
{/* supa-mdx-lint-disable-next-line Rule003Spelling */}
- **[ImgProxy](https://github.com/imgproxy/imgproxy)** - Fast and secure image processing server
- **[imgproxy](https://github.com/imgproxy/imgproxy)** - Fast and secure image processing server
- **[postgres-meta](https://github.com/supabase/postgres-meta)** - RESTful API for managing Postgres (fetch tables, add roles, run queries)
{/* supa-mdx-lint-disable-next-line Rule004ExcludeWords */}
- **[PostgreSQL](https://github.com/supabase/postgres)** - Object-relational database with over 30 years of active development
Expand All @@ -352,7 +358,7 @@ If the tools and communities already exist, with an MIT, Apache 2, or equivalent
- **[Vector](https://github.com/vectordotdev/vector)** - High-performance observability data pipeline for logs
- **[Supavisor](https://github.com/supabase/supavisor)** - Supabase's Postgres connection pooler

For the system to work cohesively, some services require additional configuration within the Postgres database. For example, the APIs and Auth system require several [default roles](/docs/guides/database/postgres/roles#supabase-roles).
Multiple services require specific configuration within the Postgres database. Refer to the documentation describing the [default roles](/docs/guides/database/postgres/roles#supabase-roles) to learn more.

You can find all the default extensions inside the [schema migration scripts repo](https://github.com/supabase/postgres/tree/develop/migrations). These scripts are mounted at `/docker-entrypoint-initdb.d` to run automatically when starting the database container.

Expand Down Expand Up @@ -455,18 +461,19 @@ By default, Postgres is only accessible through Supavisor. If you need direct ac

</Admonition>

Update `docker-compose.yml`:
Edit `docker-compose.yml`:

1. **Disable Supavisor** - Comment out or remove the entire `supavisor` service section
2. **Expose Postgres port** - Add the port mapping to the `db` service:
2. **Expose Postgres port** - Add the port mapping to the `db` service, it should look like the example below:

```yaml docker-compose.yml
db:
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
container_name: supabase-db
```

You can then connect to the database directly using a standard Postgres connection string:
After restarting, you can connect to the database directly using a standard Postgres connection string:

```sh
postgres://postgres:[POSTGRES_PASSWORD]@[your-server-ip]:5432/[POSTGRES_DB]
Expand All @@ -476,34 +483,9 @@ postgres://postgres:[POSTGRES_PASSWORD]@[your-server-ip]:5432/[POSTGRES_DB]

By default, Storage backend is set to `file`, which is to use local files as the storage backend. For macOS compatibility, you need to choose `VirtioFS` as the Docker container file sharing implementation (in Docker Desktop -> Preferences -> General).

#### Setting up logging with the Analytics server

Additional configuration is required for self-hosting the Analytics server. For the full setup instructions, see [Self Hosting Analytics](/docs/reference/self-hosting-analytics/introduction#getting-started).

### Upgrading Analytics

Due to the changes in the Analytics server, you will need to run the following commands to upgrade your Analytics server:

<Admonition type="caution">

All data in analytics will be deleted when you run the commands below.

</Admonition>

```sh
### Destroy analytics to transition to postgres self hosted solution without other data loss

# Enter the container and use your .env POSTGRES_PASSWORD value to login
docker exec -it $(docker ps | grep supabase-db | awk '{print $1}') psql -U supabase_admin --password
# Drop all the data in the _analytics schema
DROP PUBLICATION logflare_pub; DROP SCHEMA _analytics CASCADE; CREATE SCHEMA _analytics;\q
# Drop the analytics container
docker rm supabase-analytics
```

## Managing your secrets

Many components inside Supabase use secure secrets and passwords. These are listed in the self-hosting [env file](https://github.com/supabase/supabase/blob/master/docker/.env.example), but we strongly recommend using a secrets manager when deploying to production.
Many components inside Supabase use secure secrets and passwords. These are kept in the `.env` file, but we strongly recommend using a secrets manager when deploying to production.

Some suggested systems include:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ The above example creates a user entry that includes information about their nam

It can be accessed in a project's [Email Templates](/dashboard/project/_/auth/templates). Below is an example:

![image](/docs/img/troubleshooting/3eeb2435-dd1c-41bc-9557-44cabff38f59.png)
```html
<h2>Hello, {{ .Data.first_name }} {{ .Data.last_name }}!</h2>

<p>Follow this link to confirm your account:</p>
<p><a href="{{ .ConfirmationURL }}">Confirm your account</a></p>
```

If you need to update a user's meta-data, you can do so with the [`updateUser`](/docs/reference/javascript/auth-updateuser?example=update-the-users-metadata) function.

The meta-data can be used to store a users language preferences. You could then use "if statements" in the email template to set the response for a specific language:

```html
{{if eq .Data.langauge "en" }}
{{if eq .Data.language "en" }}
<h1>Welcome!</h1>
{{ else if eq .Data.langauge "pl" }}
{{ else if eq .Data.language "pl" }}
<h1>Witamy!</h1>
{{ else }}
<h1>chuS'ugh, tera' je (Klingon)</h1>
Expand Down
Loading
Loading