Skip to content

Ansible toolkit to deploy a production-ready self-hosted Supabase stack (with Caddy OAuth2 and full monitoring)

License

Notifications You must be signed in to change notification settings

ankaboot-source/ansible-supabase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Supabase & Monitoring stack

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.

📑 Table of Contents


🚀 Features

Docker Role

  • Installs and configures Docker & Docker Compose.

Supabase Role

  • 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.

Monitor Role

A full observability solution including:

  • Grafana (with provisioned dashboards & datasources)
  • Prometheus
  • Node Exporter
  • cAdvisor
  • Postgres Exporter
  • Loki (logs)
  • Promtail

Caddy Role

  • 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.

🛠 Requirements

  • 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

📥 Installation

1. Clone the repository

https://github.com/ankaboot-source/ansible-supabase.git
cd ansible-supabase

2. Register OAuth2 Application

Below 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.

GitHub

  1. Go to: https://github.com/settings/developers
  2. Click "OAuth Apps" → "New OAuth app"
  3. Set Redirect URI : https://your-supabase-subdomain/oauth2/github/authorization-code-callback
  4. Set Home page URL : https://your-supabase-domain/project/default

GitLab

  1. Go to: https://gitlab.com/-/profile/applications
  2. Click "Add new application"
  3. Set Redirect URI : https://your-supabase-subdomain/oauth2/gitlab/authorization-code-callback
  4. Enable openid, profile and email scopes

Discord

  1. Go to: https://discord.com/developers/applications
  2. Create a new application
  3. Set Redirect URI : https://your-supabase-subdomain/oauth2/discord/authorization-code-callback

Sources:


3. Caddy SSO and DNS configuration

4. Monitor role configuration

5. Configure environment variables

All roles configurations are within the following file, make sure to update variables tagged with #REQUIRED

env/supabase.yml

6. Starting up the roles

Use the following script to install Ansible, Git and execute all roles:

sudo ./install.sh

About

Ansible toolkit to deploy a production-ready self-hosted Supabase stack (with Caddy OAuth2 and full monitoring)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published