chore: add support, gotrue => auth, minor fixes, remove obscure analytics section (#41347)

This commit is contained in:
Andrey A. authored and GitHub committed 2025-12-16 11:14:15 -03:30
1 parent 2c5b71aeee
commit 25fdff20c9
3 files changed
+53 -51

No files matched your search

+21 -1
View File
@@ -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).
@@ -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)?"
@@ -40,7 +40,7 @@ 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 |
|----------|---------|-------------|
@@ -48,7 +48,7 @@ Baseline server requirements for running all Supabase components. These are suit
| 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
@@ -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
@@ -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).
@@ -299,6 +299,12 @@ 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
@@ -306,16 +312,16 @@ To uninstall, stop Supabase (while in the same directory as your `docker-compose
docker compose down -v
```
<Admonition type="danger">
Be careful — the following destroys all data, including the database and storage volumes!
</Admonition>
Remove all Postgres data:
Optionally, ensure removal of all Postgres data:
```sh
rm -rf volumes/db/data/
rm -rf volumes/db/data
```
and all Storage data:
```sh
rm -rf volumes/storage
```
## Advanced topics
@@ -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
@@ -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.
@@ -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]
@@ -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:
+6 -6
View File
@@ -19,11 +19,11 @@ This Docker Compose configuration includes the following services:
- **[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 PostgreSQL database directly into a RESTful API
- **[Realtime](https://github.com/supabase/realtime)** - Elixir server that listens to PostgreSQL database changes and broadcasts them over websockets
- **[Storage](https://github.com/supabase/storage)** - RESTful API for managing files in S3, with Postgres handling permissions
- **[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)
- **[PostgreSQL](https://github.com/supabase/postgres)** - Object-relational database with over 30 years of active development
- **[Edge Runtime](https://github.com/supabase/edge-runtime)** - Web server based on Deno runtime for running JavaScript, TypeScript, and WASM services
@@ -60,11 +60,11 @@ For troubleshooting common issues, see:
Self-hosted Supabase is community-supported. Get help and connect with other users:
- [Discord](https://discord.supabase.com) - Real-time chat and community support
- [Reddit](https://www.reddit.com/r/Supabase/) - Community forum
- [Reddit](https://www.reddit.com/r/Supabase/) - Official Supabase subreddit
Share your self-hosting experience and read what's working for other users:
Share your self-hosting experience:
- [GitHub Discussions](https://github.com/orgs/supabase/discussions/39820) - Self-hosting: What's working (and what's not)?)
- [GitHub Discussions](https://github.com/orgs/supabase/discussions/39820) - "Self-hosting: What's working (and what's not)?"
## Important Notes
@@ -80,7 +80,7 @@ Before deploying to production, you must:
- Review and adjust network security configuration (ACLs, etc.)
- Set up proper backup procedures
See the [security section](https://supabase.com/docs/guides/self-hosting/docker#securing-your-services) in the documentation.
See the [security section](https://supabase.com/docs/guides/self-hosting/docker#configuring-and-securing-supabase) in the documentation.
## License