This repository provides an Ansible-based automation toolkit for deploying a self-hosted Supabase stack, Docker, a Caddy reverse proxy with caddy-security for OAuth2-protected access, and a full monitoring suite (Grafana, Prometheus, Loki, and their agents).
It is built for fast, repeatable, production-ready deployments on fresh Debian-based servers.
- Installs and configures Docker & Docker Compose.
- Deploys the entire Supabase ecosystem with Docker Compose.
- Generates all required configuration files (docker-compose.yml, kong.yml, .env) via Jinja2 templates.
- Allows templates customization to disable unused services or apply configuration changes dynamically.
A full observability solution including:
- Grafana (with provisioned dashboards & datasources)
- Prometheus
- Node Exporter
- cAdvisor
- Postgres Exporter
- Loki (logs)
- Promtail
- Installs and configure Caddy reverse proxy + caddy-security module.
- Provides automatic TLS/HTTPS for Supabase and Grafana endpoints.
- Protects Supabase dashboard with OAuth2 Single Sign-On (SSO), with support for three provider options: GitHub, GitLab, and Discord.
-
Debian-based systems
-
3 subdomains records, one for authentication and two for reverse proxying Supabase and Grafana.
-
Register Oauth2 application within one of the supported providers:
- GitHub
- GitLab
- Discord
https://github.com/ankaboot-source/ansible-supabase.git
cd ansible-supabaseBelow are the steps for each provider. After creating the app, you will receive:
- Client ID
- Client Secret
You will later place these values inside your env/supabase.yml.
- Go to: https://github.com/settings/developers
- Click "OAuth Apps" → "New OAuth app"
- Set Redirect URI : https://your-supabase-subdomain/oauth2/github/authorization-code-callback
- Set Home page URL : https://your-supabase-domain/project/default
- Go to: https://gitlab.com/-/profile/applications
- Click "Add new application"
- Set Redirect URI : https://your-supabase-subdomain/oauth2/gitlab/authorization-code-callback
- Enable openid, profile and email scopes
- Go to: https://discord.com/developers/applications
- Create a new application
- Set Redirect URI : https://your-supabase-subdomain/oauth2/discord/authorization-code-callback
- GitHub : https://docs.authcrunch.com/docs/authenticate/oauth/backend-oauth2-0007-github
- GitLab : https://docs.authcrunch.com/docs/authenticate/oauth/backend-oauth2-0009-gitlab
- Discord : https://docs.authcrunch.com/docs/authenticate/oauth/backend-oauth2-0013-discord
- Refer to caddy/README.md.
- Refer to monitor/README.md.
All roles configurations are within the following file, make sure to update variables tagged with #REQUIRED
Use the following script to install Ansible, Git and execute all roles:
sudo ./install.sh