[GH-ISSUE #6711] [FR] more tutorials on how to self-host appflowy #2957

Closed
opened 2026-03-23 21:26:28 +00:00 by mirror · 11 comments
Owner

Originally created by @annieappflowy on GitHub (Nov 4, 2024).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/6711

Description

I've been trying to get appflowy selfhosted on my new ubuntu home server for a week. I'm kinda new to all of this and have adhd so it's a work in progress...there doesn't seem to be a walkthrough or any video tutorials on self hosting appflowy and my brain is fried. I seems to have errors in every container, no matter how i change everything. I would really appreciate a walkthrough/tutorial if anyone can point me in the right direction? AI and I have fallen out multiple times over this lol

Impact

New appflowy self-hosters

Additional Context

No response

Originally created by @annieappflowy on GitHub (Nov 4, 2024). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/6711 ### Description I've been trying to get appflowy selfhosted on my new ubuntu home server for a week. I'm kinda new to all of this and have adhd so it's a work in progress...there doesn't seem to be a walkthrough or any video tutorials on self hosting appflowy and my brain is fried. I seems to have errors in every container, no matter how i change everything. I would really appreciate a walkthrough/tutorial if anyone can point me in the right direction? AI and I have fallen out multiple times over this lol ### Impact New appflowy self-hosters ### Additional Context _No response_
mirror 2026-03-23 21:26:28 +00:00
Author
Owner

@casainho commented on GitHub (Nov 6, 2024):

I am selfhosting using an old PC running Linux Ubuntu 24.04.

I use Nginx as a reverse proxy to give me the HTTPS to appflowy cloud app (I also have other apps on my selfhost, so I use the Nginx to give the HTTPS to all them).

Then I just configure appflowy cloud as the official instructions.

My Nginx reverse proxy docker compose file:

version: '3.8'
services:
  nginx_reverse_proxy:
    hostname: nginx_reverse_proxy
    image: 'jc21/nginx-proxy-manager:2.12.1'
    restart: unless-stopped
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80'  # Public HTTP Port
      - '443:443'  # Public HTTPS Porta
      - '81:81'  # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP

    environment:
      # Set the SQLite DB file location to a path on the host
      DB_SQLITE_FILE: "/data/database.sqlite"  # Path inside the container

    volumes:
      - /mnt/server_usb_disk_1gb/nginx_reverse_proxy_server/data:/data  # Map the ./data directory on the host to /data in the container
      - /mnt/server_usb_disk_1gb/nginx_reverse_proxy_server/letsencrypt:/etc/letsencrypt  # Existing mapping for Let's Encrypt

    networks:
      - network_reverse_proxy

networks:
  network_reverse_proxy:
    external: true

Access: http://localhost:81/

Email: admin@example.com
Password: changeme

Here my settings for Nginx reverse proxy NPM UI, specific for Appflowy cloud selfhosting:

Nginx reverse proxy

Websockets Support must be enabled!!

image

image

image

Where 192.168.2.2 is the IP of the computer running the selfhosting and 8800 is the port I decided to use for Appflowy cloud.

Advanced --> Custom Nginx Configuration:

location / {
        proxy_pass http://192.168.2.2:8800;
    }

    location /api/websocket {
        proxy_pass http://192.168.2.2:8800;

        proxy_set_header Host $host;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
<!-- gh-comment-id:2459434218 --> @casainho commented on GitHub (Nov 6, 2024): I am selfhosting using an old PC running Linux Ubuntu 24.04. I use Nginx as a reverse proxy to give me the HTTPS to appflowy cloud app (I also have other apps on my selfhost, so I use the Nginx to give the HTTPS to all them). Then I just configure appflowy cloud as the official instructions. My Nginx reverse proxy docker compose file: ```yaml version: '3.8' services: nginx_reverse_proxy: hostname: nginx_reverse_proxy image: 'jc21/nginx-proxy-manager:2.12.1' restart: unless-stopped ports: # These ports are in format <host-port>:<container-port> - '80:80' # Public HTTP Port - '443:443' # Public HTTPS Porta - '81:81' # Admin Web Port # Add any other Stream port you want to expose # - '21:21' # FTP environment: # Set the SQLite DB file location to a path on the host DB_SQLITE_FILE: "/data/database.sqlite" # Path inside the container volumes: - /mnt/server_usb_disk_1gb/nginx_reverse_proxy_server/data:/data # Map the ./data directory on the host to /data in the container - /mnt/server_usb_disk_1gb/nginx_reverse_proxy_server/letsencrypt:/etc/letsencrypt # Existing mapping for Let's Encrypt networks: - network_reverse_proxy networks: network_reverse_proxy: external: true ``` Access: http://localhost:81/ Email: admin@example.com Password: changeme Here my settings for Nginx reverse proxy NPM UI, specific for Appflowy cloud selfhosting: # Nginx reverse proxy Websockets Support must be enabled!! ![image](https://github.com/user-attachments/assets/36fad1f8-14b6-4f91-9cd4-8d69c51eb33d) ![image](https://github.com/user-attachments/assets/6caf3787-e342-4f2d-874d-5f6599691816) ![image](https://github.com/user-attachments/assets/8b218b70-d6d7-446c-9911-265c0291c89a) Where 192.168.2.2 is the IP of the computer running the selfhosting and 8800 is the port I decided to use for Appflowy cloud. Advanced --> Custom Nginx Configuration: ``` location / { proxy_pass http://192.168.2.2:8800; } location /api/websocket { proxy_pass http://192.168.2.2:8800; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } ```
Author
Owner

@ste-phil commented on GitHub (Nov 27, 2024):

@casainho Are you not encountering any container errors when following the official instructions?

I'm running into a lot of postgres and environment variable errors after following exact setup from here

in appflowy-cloud container:
l_client_cert: None, ssl_client_key: None, statement_cache_capacity: 100, application_name: None, log_settings: LogSettings { statements_level: Debug, slow_statements_level: Warn, slow

in appflowy-cloud-gotrue container:
2024-11-27 14:36:08 {"level":"fatal","msg":"running db migrations: error executing migrations/00_init_auth_schema.up.sql, sql: -- auth.users definition\n\nCREATE TABLE IF NOT EXISTS auth.users (\n\tinstance_id uuid NULL,\n\tid uuid NOT NULL UNIQUE,\n\taud varchar(255) NULL,\n\t\"role\" varchar(255) NULL,\n\temail varchar(255) NULL UNIQUE,\n\tencrypted_password varchar(255) NULL,\n\tconfirmed_at timestamptz NULL,\n\tinvited_at timestamptz NULL,\n\tconfirmation_token varchar(255) NULL,\n\tconfirmation_sent_at timestamptz NULL,\n\trecovery_token varchar(255) NULL,\n\trecovery_sent_at timestamptz NULL,\n\temail_change_token varchar(255) NULL,\n\temail_change varchar(255) NULL,\n\temail_change_sent_at timestamptz NULL,\n\tlast_sign_in_at timestamptz NULL,\n\traw_app_meta_data jsonb NULL,\n\traw_user_meta_data jsonb NULL,\n\tis_super_admin bool NULL,\n\tcreated_at timestamptz NULL,\n\tupdated_at timestamptz NULL,\n\tCONSTRAINT users_pkey PRIMARY KEY (id)\n);\nCREATE INDEX IF NOT EXISTS users_instance_id_email_idx ON auth.users USING btree (instance_id, email);\nCREATE INDEX IF NOT EXISTS users_instance_id_idx ON auth.users USING btree (instance_id);\ncomment on table auth.users is 'Auth: Stores user login data within a secure schema.';\n\n-- auth.refresh_tokens definition\n\nCREATE TABLE IF NOT EXISTS auth.refresh_tokens (\n\tinstance_id uuid NULL,\n\tid bigserial NOT NULL,\n\t\"token\" varchar(255) NULL,\n\tuser_id varchar(255) NULL,\n\trevoked bool NULL,\n\tcreated_at timestamptz NULL,\n\tupdated_at timestamptz NULL,\n\tCONSTRAINT refresh_tokens_pkey PRIMARY KEY (id)\n);\nCREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id);\nCREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id);\nCREATE INDEX IF NOT EXISTS refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token);\ncomment on table auth.refresh_tokens is 'Auth: Store of tokens used to refresh JWT tokens once they expire.';\n\n-- auth.instances definition\n\nCREATE TABLE IF NOT EXISTS auth.instances (\n\tid uuid NOT NULL,\n\tuuid uuid NULL,\n\traw_base_config text NULL,\n\tcreated_at timestamptz NULL,\n\tupdated_at timestamptz NULL,\n\tCONSTRAINT instances_pkey PRIMARY KEY (id)\n);\ncomment on table auth.instances is 'Auth: Manages users across multiple sites.';\n\n-- auth.audit_log_entries definition\n\nCREATE TABLE IF NOT EXISTS auth.audit_log_entries (\n\tinstance_id uuid NULL,\n\tid uuid NOT NULL,\n\tpayload json NULL,\n\tcreated_at timestamptz NULL,\n\tCONSTRAINT audit_log_entries_pkey PRIMARY KEY (id)\n);\nCREATE INDEX IF NOT EXISTS audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id);\ncomment on table auth.audit_log_entries is 'Auth: Audit trail for user actions.';\n\n-- auth.schema_migrations definition\n\nCREATE TABLE IF NOT EXISTS auth.schema_migrations (\n\t\"version\" varchar(255) NOT NULL,\n\tCONSTRAINT schema_migrations_pkey PRIMARY KEY (\"version\")\n);\ncomment on table auth.schema_migrations is 'Auth: Manages updates to the auth system.';\n\t\t\n-- Gets the User ID from the request cookie\ncreate or replace function auth.uid() returns uuid as $$\n select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid;\n$$ language sql stable;\n\n-- Gets the User ID from the request cookie\ncreate or replace function auth.role() returns text as $$\n select nullif(current_setting('request.jwt.claim.role', true), '')::text;\n$$ language sql stable;\n: ERROR: schema \"auth\" does not exist (SQLSTATE 3F000)","time":"2024-11-27T13:36:08Z"}

and there are many more in my other containers.

<!-- gh-comment-id:2503905340 --> @ste-phil commented on GitHub (Nov 27, 2024): @casainho Are you not encountering any container errors when following the official instructions? I'm running into a lot of postgres and environment variable errors after following exact setup from [here ](https://github.com/AppFlowy-IO/AppFlowy-Cloud/blob/main/doc/DEPLOYMENT.md ) in appflowy-cloud container: `l_client_cert: None, ssl_client_key: None, statement_cache_capacity: 100, application_name: None, log_settings: LogSettings { statements_level: Debug, slow_statements_level: Warn, slow` in appflowy-cloud-gotrue container: `2024-11-27 14:36:08 {"level":"fatal","msg":"running db migrations: error executing migrations/00_init_auth_schema.up.sql, sql: -- auth.users definition\n\nCREATE TABLE IF NOT EXISTS auth.users (\n\tinstance_id uuid NULL,\n\tid uuid NOT NULL UNIQUE,\n\taud varchar(255) NULL,\n\t\"role\" varchar(255) NULL,\n\temail varchar(255) NULL UNIQUE,\n\tencrypted_password varchar(255) NULL,\n\tconfirmed_at timestamptz NULL,\n\tinvited_at timestamptz NULL,\n\tconfirmation_token varchar(255) NULL,\n\tconfirmation_sent_at timestamptz NULL,\n\trecovery_token varchar(255) NULL,\n\trecovery_sent_at timestamptz NULL,\n\temail_change_token varchar(255) NULL,\n\temail_change varchar(255) NULL,\n\temail_change_sent_at timestamptz NULL,\n\tlast_sign_in_at timestamptz NULL,\n\traw_app_meta_data jsonb NULL,\n\traw_user_meta_data jsonb NULL,\n\tis_super_admin bool NULL,\n\tcreated_at timestamptz NULL,\n\tupdated_at timestamptz NULL,\n\tCONSTRAINT users_pkey PRIMARY KEY (id)\n);\nCREATE INDEX IF NOT EXISTS users_instance_id_email_idx ON auth.users USING btree (instance_id, email);\nCREATE INDEX IF NOT EXISTS users_instance_id_idx ON auth.users USING btree (instance_id);\ncomment on table auth.users is 'Auth: Stores user login data within a secure schema.';\n\n-- auth.refresh_tokens definition\n\nCREATE TABLE IF NOT EXISTS auth.refresh_tokens (\n\tinstance_id uuid NULL,\n\tid bigserial NOT NULL,\n\t\"token\" varchar(255) NULL,\n\tuser_id varchar(255) NULL,\n\trevoked bool NULL,\n\tcreated_at timestamptz NULL,\n\tupdated_at timestamptz NULL,\n\tCONSTRAINT refresh_tokens_pkey PRIMARY KEY (id)\n);\nCREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id);\nCREATE INDEX IF NOT EXISTS refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id);\nCREATE INDEX IF NOT EXISTS refresh_tokens_token_idx ON auth.refresh_tokens USING btree (token);\ncomment on table auth.refresh_tokens is 'Auth: Store of tokens used to refresh JWT tokens once they expire.';\n\n-- auth.instances definition\n\nCREATE TABLE IF NOT EXISTS auth.instances (\n\tid uuid NOT NULL,\n\tuuid uuid NULL,\n\traw_base_config text NULL,\n\tcreated_at timestamptz NULL,\n\tupdated_at timestamptz NULL,\n\tCONSTRAINT instances_pkey PRIMARY KEY (id)\n);\ncomment on table auth.instances is 'Auth: Manages users across multiple sites.';\n\n-- auth.audit_log_entries definition\n\nCREATE TABLE IF NOT EXISTS auth.audit_log_entries (\n\tinstance_id uuid NULL,\n\tid uuid NOT NULL,\n\tpayload json NULL,\n\tcreated_at timestamptz NULL,\n\tCONSTRAINT audit_log_entries_pkey PRIMARY KEY (id)\n);\nCREATE INDEX IF NOT EXISTS audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id);\ncomment on table auth.audit_log_entries is 'Auth: Audit trail for user actions.';\n\n-- auth.schema_migrations definition\n\nCREATE TABLE IF NOT EXISTS auth.schema_migrations (\n\t\"version\" varchar(255) NOT NULL,\n\tCONSTRAINT schema_migrations_pkey PRIMARY KEY (\"version\")\n);\ncomment on table auth.schema_migrations is 'Auth: Manages updates to the auth system.';\n\t\t\n-- Gets the User ID from the request cookie\ncreate or replace function auth.uid() returns uuid as $$\n select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid;\n$$ language sql stable;\n\n-- Gets the User ID from the request cookie\ncreate or replace function auth.role() returns text as $$\n select nullif(current_setting('request.jwt.claim.role', true), '')::text;\n$$ language sql stable;\n: ERROR: schema \"auth\" does not exist (SQLSTATE 3F000)","time":"2024-11-27T13:36:08Z"}` and there are many more in my other containers.
Author
Owner

@SunRain commented on GitHub (Mar 13, 2025):

00_init_auth_schema.up.sql

same problem

<!-- gh-comment-id:2721668528 --> @SunRain commented on GitHub (Mar 13, 2025): > 00_init_auth_schema.up.sql same problem
Author
Owner

@khorshuheng commented on GitHub (Mar 13, 2025):

@SunRain First, make sure that you have pulled the latest images and docker compose. There has been quite a bit of changes over the months.

Secondly, if everything is up to date, and there's still issues with creating schema, that means the migration script that was mounted to postgres container failed to execute. One common reason, if you are running this on Windows Subsystem for Linux, is that the file has somehow been saved in windows format and unable to run in the linux container.

<!-- gh-comment-id:2721686578 --> @khorshuheng commented on GitHub (Mar 13, 2025): @SunRain First, make sure that you have pulled the latest images and docker compose. There has been quite a bit of changes over the months. Secondly, if everything is up to date, and there's still issues with creating schema, that means the migration script that was mounted to postgres container failed to execute. One common reason, if you are running this on Windows Subsystem for Linux, is that the file has somehow been saved in windows format and unable to run in the linux container.
Author
Owner

@SunRain commented on GitHub (Mar 15, 2025):

@SunRain First, make sure that you have pulled the latest images and docker compose. There has been quite a bit of changes over the months.

Secondly, if everything is up to date, and there's still issues with creating schema, that means the migration script that was mounted to postgres container failed to execute. One common reason, if you are running this on Windows Subsystem for Linux, is that the file has somehow been saved in windows format and unable to run in the linux container.

The issue was that the migrations/before/supabase_auth.sh script was not executed properly in my Postgres Docker container. The problem was resolved after executing this script.

<!-- gh-comment-id:2726369166 --> @SunRain commented on GitHub (Mar 15, 2025): > [@SunRain](https://github.com/SunRain) First, make sure that you have pulled the latest images and docker compose. There has been quite a bit of changes over the months. > > Secondly, if everything is up to date, and there's still issues with creating schema, that means the migration script that was mounted to postgres container failed to execute. One common reason, if you are running this on Windows Subsystem for Linux, is that the file has somehow been saved in windows format and unable to run in the linux container. The issue was that the migrations/before/supabase_auth.sh script was not executed properly in my Postgres Docker container. The problem was resolved after executing this script.
Author
Owner

@liuhudosn commented on GitHub (Mar 18, 2025):

PS E:\AppFlowy-Cloud> docker compose up -d
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "APPFLOWY_S3_PRESIGNED_URL_ENDPOINT" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AI_OPENAI_API_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-18T10:36:48+08:00" level=warning msg="The "AI_OPENAI_API_KEY" variable is not set. Defaulting to a blank string."
[+] Running 11/11
✔ Network appflowy-cloud_default Created 0.0s
✔ Container appflowy-cloud-nginx-1 Started 1.3s
✔ Container appflowy-cloud-postgres-1 Healthy 6.8s
✔ Container appflowy-cloud-redis-1 Started 0.9s
✔ Container appflowy-cloud-minio-1 Started 1.1s
✔ Container appflowy-cloud-ai-1 Started 7.6s
✔ Container appflowy-cloud-appflowy_worker-1 Started 7.2s
Container appflowy-cloud-gotrue-1 Error 7.6s
✔ Container appflowy-cloud-appflowy_cloud-1 Created 0.1s
✔ Container appflowy-cloud-appflowy_web-1 Created 0.1s
✔ Container appflowy-cloud-admin_frontend-1 Created 0.1s
dependency failed to start: container appflowy-cloud-gotrue-1 is unhealthy

I've tried countless times to fix this, but it always results in an error. I'm desperately seeking help from someone who knows what they're doing.

<!-- gh-comment-id:2731495166 --> @liuhudosn commented on GitHub (Mar 18, 2025): PS E:\AppFlowy-Cloud> docker compose up -d time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"APPFLOWY_S3_PRESIGNED_URL_ENDPOINT\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AI_OPENAI_API_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-18T10:36:48+08:00" level=warning msg="The \"AI_OPENAI_API_KEY\" variable is not set. Defaulting to a blank string." [+] Running 11/11 ✔ Network appflowy-cloud_default Created 0.0s ✔ Container appflowy-cloud-nginx-1 Started 1.3s ✔ Container appflowy-cloud-postgres-1 Healthy 6.8s ✔ Container appflowy-cloud-redis-1 Started 0.9s ✔ Container appflowy-cloud-minio-1 Started 1.1s ✔ Container appflowy-cloud-ai-1 Started 7.6s ✔ Container appflowy-cloud-appflowy_worker-1 Started 7.2s ✘ **Container appflowy-cloud-gotrue-1 Error** 7.6s ✔ Container appflowy-cloud-appflowy_cloud-1 Created 0.1s ✔ Container appflowy-cloud-appflowy_web-1 Created 0.1s ✔ Container appflowy-cloud-admin_frontend-1 Created 0.1s **dependency failed to start: container appflowy-cloud-gotrue-1 is unhealthy** I've tried countless times to fix this, but it always results in an error. I'm desperately seeking help from someone who knows what they're doing.
Author
Owner

@khorshuheng commented on GitHub (Mar 18, 2025):

Did you copy deploy.env to .env, as per the documentation? From the error message it seems like some of the environment variables have not been populated.

Also, is the docker images on the latest version? i.e. did you run docker compose pull? If you are using the latest version of docker compose file but an older version of gotrue image, this could happen due to some change in health check which we did some time ago.

Check the logs of gotrue service too, if it keep crashing.

<!-- gh-comment-id:2731533482 --> @khorshuheng commented on GitHub (Mar 18, 2025): Did you copy deploy.env to .env, as per the documentation? From the error message it seems like some of the environment variables have not been populated. Also, is the docker images on the latest version? i.e. did you run docker compose pull? If you are using the latest version of docker compose file but an older version of gotrue image, this could happen due to some change in health check which we did some time ago. Check the logs of gotrue service too, if it keep crashing.
Author
Owner

@liuhudosn commented on GitHub (Mar 18, 2025):

The GoTrue logs clearly indicate that GoTrue is trying to connect to a database named appflowy, but this database does not exist. I have configured environment variables for the postgres service in docker-compose.yml. It's possible that GoTrue is starting too quickly and attempting to connect before the Postgres database appflowy is fully created, causing the connection to fail. I modified the healthcheck as follows:

Original:

code

test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}" ]
Modified:

code

test: ["CMD-SHELL", "pg_isready -U liuhudson -d appflowy"]
However, it is still reporting an error. @khorshuheng

<!-- gh-comment-id:2732251598 --> @liuhudosn commented on GitHub (Mar 18, 2025): The GoTrue logs clearly indicate that GoTrue is trying to connect to a database named appflowy, but this database does not exist. I have configured environment variables for the postgres service in docker-compose.yml. It's possible that GoTrue is starting too quickly and attempting to connect before the Postgres database appflowy is fully created, causing the connection to fail. I modified the healthcheck as follows: Original: code test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}" ] Modified: code test: ["CMD-SHELL", "pg_isready -U liuhudson -d appflowy"] However, it is still reporting an error. @khorshuheng
Author
Owner

@khorshuheng commented on GitHub (Mar 18, 2025):

@liuhudosn If you have setup the environmental variable correctly, the appflowy database should have been created (https://github.com/AppFlowy-IO/AppFlowy-Cloud/blob/main/docker-compose.yml#L32). Can you go into the postgres container, and check if the database indeed exists?

<!-- gh-comment-id:2732281853 --> @khorshuheng commented on GitHub (Mar 18, 2025): @liuhudosn If you have setup the environmental variable correctly, the appflowy database should have been created (https://github.com/AppFlowy-IO/AppFlowy-Cloud/blob/main/docker-compose.yml#L32). Can you go into the postgres container, and check if the database indeed exists?
Author
Owner

@liuhudosn commented on GitHub (Mar 19, 2025):

PS E:\AppFlowy-Cloud> docker compose up -d
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_HOST" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "MINIO_PORT" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AWS_SECRET" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "APPFLOWY_S3_PRESIGNED_URL_ENDPOINT" variable is not set. Defaulting to a blank string."
time="2025-03-20T01:55:56+08:00" level=warning msg="The "AI_OPENAI_API_KEY" variable is not set. Defaulting to a blank string."
[+] Running 13/13
✔ Network appflowy-cloud_default Created 0.0s
✔ Volume "appflowy-cloud_postgres_data" Created 0.0s
✔ Volume "appflowy-cloud_minio_data" Created 0.0s
✔ Container appflowy-cloud-postgres-1 Healthy 6.4s
✔ Container appflowy-cloud-redis-1 Started 0.9s
✔ Container appflowy-cloud-nginx-1 Started 0.9s
✔ Container appflowy-cloud-minio-1 Started 0.9s
✘ Container appflowy-cloud-gotrue-1 Error 8.6s
✔ Container appflowy-cloud-ai-1 Started 7.1s
✔ Container appflowy-cloud-appflowy_worker-1 Started 6.7s
✔ Container appflowy-cloud-appflowy_cloud-1 Created 0.0s
✔ Container appflowy-cloud-admin_frontend-1 Created 0.1s
✔ Container appflowy-cloud-appflowy_web-1 Created 0.1s
dependency failed to start: container appflowy-cloud-gotrue-1 is unhealthy

<!-- gh-comment-id:2737561725 --> @liuhudosn commented on GitHub (Mar 19, 2025): PS E:\AppFlowy-Cloud> docker compose up -d time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_HOST\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"MINIO_PORT\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_ACCESS_KEY\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AWS_SECRET\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"APPFLOWY_S3_PRESIGNED_URL_ENDPOINT\" variable is not set. Defaulting to a blank string." time="2025-03-20T01:55:56+08:00" level=warning msg="The \"AI_OPENAI_API_KEY\" variable is not set. Defaulting to a blank string." [+] Running 13/13 ✔ Network appflowy-cloud_default Created 0.0s ✔ Volume "appflowy-cloud_postgres_data" Created 0.0s ✔ Volume "appflowy-cloud_minio_data" Created 0.0s ✔ Container appflowy-cloud-postgres-1 Healthy 6.4s ✔ Container appflowy-cloud-redis-1 Started 0.9s ✔ Container appflowy-cloud-nginx-1 Started 0.9s ✔ Container appflowy-cloud-minio-1 Started 0.9s ✘ Container appflowy-cloud-gotrue-1 Error 8.6s ✔ Container appflowy-cloud-ai-1 Started 7.1s ✔ Container appflowy-cloud-appflowy_worker-1 Started 6.7s ✔ Container appflowy-cloud-appflowy_cloud-1 Created 0.0s ✔ Container appflowy-cloud-admin_frontend-1 Created 0.1s ✔ Container appflowy-cloud-appflowy_web-1 Created 0.1s dependency failed to start: container appflowy-cloud-gotrue-1 is unhealthy
Author
Owner

@annieappflowy commented on GitHub (Sep 5, 2025):

appflowy.com/docs <- written guide
https://www.youtube.com/@AppFlowyHQ <- video tutorials

<!-- gh-comment-id:3257270858 --> @annieappflowy commented on GitHub (Sep 5, 2025): appflowy.com/docs <- written guide https://www.youtube.com/@AppFlowyHQ <- video tutorials
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#2957
No description provided.