Skip to content

feat: add Coolify self-hosting guide and configuration#1613

Open
Babs90000 wants to merge 1 commit into
AppFlowy-IO:mainfrom
Babs90000:feature/coolify-setup
Open

feat: add Coolify self-hosting guide and configuration#1613
Babs90000 wants to merge 1 commit into
AppFlowy-IO:mainfrom
Babs90000:feature/coolify-setup

Conversation

@Babs90000
Copy link
Copy Markdown

@Babs90000 Babs90000 commented Apr 15, 2026

Description

This PR adds a dedicated deployment guide and the necessary configuration files to run AppFlowy Cloud on Coolify.

Coolify is an open-source, self-hosted Heroku/Netlify alternative that is becoming very popular. This addition makes AppFlowy Cloud much more accessible for users who want an easy deployment experience on their own servers.

Changes

  • Created a new directory deploy/coolify/ to keep the root clean. This folder contains:
    • README.md: A complete step-by-step guide in both English and French.
    • docker-compose.yml: Optimized configuration for Coolify services.
    • nginx-proxy.conf: Routing configuration, including the critical fix for /api/user/verify.
    • .env.example: Template for required environment variables.
  • Updated doc/DEPLOYMENT.md to link to this new community guide.

Why this is useful

Coolify users often struggle with the specific Nginx routing requirements for AppFlowy's auth flow. This pre-configured setup solves those issues out-of-the-box.

Verification

Tested and verified on Coolify v4.0.0-beta.463.

Summary by Sourcery

Add a self-hosted AppFlowy Cloud deployment setup for Coolify and link it from the main deployment documentation.

New Features:

  • Provide a Coolify deployment guide for AppFlowy Cloud with detailed setup instructions in English and French.
  • Add a Coolify-specific Docker Compose stack, Nginx reverse proxy configuration, and environment template for self-hosted deployments.
  • Document how to run the same Docker-based setup without Coolify, including optional bundled Postgres and Redis services for testing.

Documentation:

  • Update the main deployment documentation to reference the new community Coolify deployment guide.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 15, 2026

CLA assistant check
All committers have signed the CLA.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 15, 2026

Reviewer's Guide

Adds a new Coolify-based self-hosting deployment guide and configuration for AppFlowy Cloud, including Docker Compose, Nginx proxy routing (with a specific fix for /api/user/verify), and environment templates, and links it from the main deployment documentation.

Sequence diagram for /api/user/verify magic-link verification routing (sequence)

sequenceDiagram
  actor User
  participant Browser
  participant Traefik
  participant NginxProxy as Nginx_proxy
  participant AppFlowyCloud as appflowy_cloud

  User->>Browser: Click magic link from email
  Browser->>Traefik: GET https://appflowy.domain/api/user/verify/{token}
  Traefik->>NginxProxy: Forward request (HTTP)
  Note over NginxProxy: Location match: /api/user/verify/(.+) before /api/
  NginxProxy->>AppFlowyCloud: GET /api/user/verify/{token}
  AppFlowyCloud-->>NginxProxy: 302 redirect or 200 JSON
  NginxProxy-->>Traefik: Response
  Traefik-->>Browser: Response
  Browser-->>User: Session established in AppFlowy UI
Loading

Flow diagram for Coolify-based AppFlowy Cloud deployment steps (flow)

flowchart TD
  A[Start] --> B[Prepare Supabase auth DB<br>CREATE DATABASE appflowy_gotrue<br>GRANT on schemas to supabase_auth_admin]
  B --> C[Prepare AppFlowy DB<br>CREATE DATABASE appflowy_cloud<br>CREATE USER appflowy_user<br>CREATE EXTENSION vector]
  C --> D[Copy .env.example to .env<br>Fill environment variables]
  D --> E[Create Docker Compose service in Coolify]
  E --> F[Upload docker-compose.yml and nginx-proxy.conf<br>To service directory]
  F --> G[Set env vars in Coolify UI]
  G --> H[Deploy service stack]
  H --> I[Verify deployment<br>curl /api/server-info/auth-providers<br>Expect HTTP 200]
  I --> J[AppFlowy Cloud ready on Coolify]
Loading

File-Level Changes

Change Details Files
Introduce a full Coolify deployment guide for AppFlowy Cloud with bilingual documentation and operational guidance.
  • Add an English and French step-by-step Coolify deployment guide describing architecture, prerequisites, installation, troubleshooting, and non-Coolify usage
  • Document the critical Nginx routing behavior for /api/user/verify and related auth flow requirements
  • Provide guidance for optional all-in-one Docker Compose usage including Postgres/Redis and associated environment settings
deploy/coolify/README.md
Add Docker Compose configuration optimized for Coolify, wiring AppFlowy Cloud, GoTrue, MinIO, Nginx proxy, and the web frontend together.
  • Define gotrue service with Traefik/Coolify labels, Supabase/Postgres connection, JWT, SMTP, and webhook configuration for communicating with AppFlowy Cloud
  • Define minio service with persistent volume, credentials sourced from env, and shared networks
  • Define appflowy_cloud backend service with DB/Redis URIs, GoTrue/base URLs, MinIO S3 settings, SMTP, and performance-related env tuning
  • Define appflowy_proxy Nginx service exposing the app via Traefik and mounting the custom nginx-proxy.conf
  • Define appflowy_web frontend service consuming base URL and websocket env vars, all services joined on Coolify and project-specific networks with a shared volume for MinIO data
deploy/coolify/docker-compose.yml
Add an internal Nginx proxy configuration that correctly routes AppFlowy Cloud, GoTrue, and WebSocket traffic behind Coolify/Traefik.
  • Configure upstreams for appflowy_cloud and appflowy_web and a single HTTP server on port 80
  • Add dedicated /ws location for WebSocket upgrades to the cloud backend with long timeouts
  • Add high-priority regex location for GET /api/user/verify passthrough to the cloud backend, preceding the generic /api/ block
  • Route /api/ to AppFlowy Cloud, /gotrue/ to the GoTrue container, and all other paths to the frontend web service
deploy/coolify/nginx-proxy.conf
Expose the new Coolify deployment as a community guide from the main deployment documentation.
  • Add a “Community Deployment Guides” section to DEPLOYMENT.md with a link to the Coolify README
doc/DEPLOYMENT.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The docker-compose.yml is tightly bound to a specific Coolify instance (hard-coded domains like *.kdevs.io, resource UUIDs, external network names, and service IDs); consider replacing these with generic placeholders or environment-based variables so others can reuse the file without editing dozens of values.
  • In nginx-proxy.conf you proxy to http://gotrue:8081, but there is no upstream gotrue block defined like you did for cloud and web, which will cause nginx startup failures; add an upstream for the gotrue service.
  • There is a lot of duplicated configuration in docker-compose.yml (e.g., AF_* environment variables repeated across services and duplicate traefik.enable labels on gotrue); you could simplify by relying more on the shared .env file and removing redundant labels/vars to make the compose file easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The docker-compose.yml is tightly bound to a specific Coolify instance (hard-coded domains like `*.kdevs.io`, resource UUIDs, external network names, and service IDs); consider replacing these with generic placeholders or environment-based variables so others can reuse the file without editing dozens of values.
- In nginx-proxy.conf you proxy to `http://gotrue:8081`, but there is no `upstream gotrue` block defined like you did for `cloud` and `web`, which will cause nginx startup failures; add an upstream for the gotrue service.
- There is a lot of duplicated configuration in docker-compose.yml (e.g., AF_* environment variables repeated across services and duplicate `traefik.enable` labels on `gotrue`); you could simplify by relying more on the shared `.env` file and removing redundant labels/vars to make the compose file easier to maintain.

## Individual Comments

### Comment 1
<location path="deploy/coolify/docker-compose.yml" line_range="50" />
<code_context>
+      GOTRUE_JWT_SECRET: '${AF_JWT_SECRET}'
+      GOTRUE_JWT_EXP: '7200'
+      GOTRUE_DB_DRIVER: postgres
+      DATABASE_URL: 'postgres://supabase_auth_admin:${SUPABASE_AUTH_PASSWORD}@supabase-db-sk44w4s8sgsk4k4s040c4ooc:5432/appflowy_gotrue'
+      GOTRUE_SMTP_HOST: '${AF_SMTP_HOST}'
+      GOTRUE_SMTP_PORT: '${AF_SMTP_PORT}'
</code_context>
<issue_to_address>
**question (bug_risk):** Clarify and align the Postgres host with the networks/services defined in this compose file.

The `DATABASE_URL` host (`supabase-db-sk44w4s8sgsk4k4s040c4ooc`) doesn’t match any service or network alias in this compose file. If it’s an external container on a shared Docker network, please use and document a stable, reproducible hostname (e.g., `supabase-db` or a DNS name) instead of an environment‑specific identifier.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread deploy/coolify/docker-compose.yml Outdated
@Babs90000 Babs90000 force-pushed the feature/coolify-setup branch from f698ee7 to 1221f9d Compare April 15, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants