mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2026-03-24 12:56:59 +00:00
[GH-ISSUE #6711] [FR] more tutorials on how to self-host appflowy #2957
Labels
No labels
2024
2025
2026
acct mgmt
AI
automation
bug
calendar
ci
CJK
cloud
code-block
collaboration
copy-paste
database
data migration
data sync
deploy
desktop
develop
develop
documentation
duplicate
editor
editor-plugin
emoji
export
files
flutter-only
follow-up
formula
good first issue for devs
good first issue for experienced devs
grid
hacktoberfest
HACKTOBERFEST-ACCEPTED
help wanted
i18n
icons
images
importer
improvements
infra
install
integrations
IR
kanban board
login
look and joy
mentorship
mobile
mobile
needs design
new feature
new feature
non-coding
notes
notifications
onboarding
organization
P0+
permission
platform-linux
platform-mac
platform-windows
plugins
program
pull-request
Q1 25
Q1 26
Q2 24
Q2 25
Q3 24
Q3 25
Q4 24
Q4 25
react
regression
rust
rust
Rust-only
Rust-only
Rust-starter
Rust-starter
self-hosted
shortcuts
side panel
slash-menu
sync v2
table
tablet
task
tauri
templates
tests
themes
translation
v0.5.6
v0.5.8
v0.5.9
v0.6.0
v0.6.1
v0.6.4
v0.6.7
v0.6.8
v0.7.1
v0.7.4
v0.7.4
v0.7.5
v0.7.6
v0.7.7
v0.7.8
v0.8.0
v0.8.4
v0.8.5
v0.8.9
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AppFlowy-IO/AppFlowy#2957
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@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:
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!!
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:
@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, slowin 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.
@SunRain commented on GitHub (Mar 13, 2025):
same problem
@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.
@SunRain commented on GitHub (Mar 15, 2025):
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.
@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.
@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.
@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
@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?
@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
@annieappflowy commented on GitHub (Sep 5, 2025):
appflowy.com/docs <- written guide
https://www.youtube.com/@AppFlowyHQ <- video tutorials