- AppFlowy-Cloud is designed to be easily self deployed for self managed cloud storage
- The following document will walk you through the steps to deploy your own AppFlowy-Cloud
- Minimum 2GB Ram (4GB Recommended)
- Ports 80/443 available
- Because AppFlowy-Cloud will have to be running persistently (or at least whenever users need access), it's probably a good idea to run it on a non-end user device. It is best if you already have a home server (check software requirements), but if you don't, you can also deploy it on a cloud compute service as host server such as
Ensure you have Docker Compose(v2) installed on your host server. Follow the official guidelines for a reliable setup:
Docker Compose is included with Docker Engine:
- Docker Engine: We suggest adhering to the instructions provided by Docker for installing Docker Engine.
For older versions of Docker Engine that do not include Docker Compose:
- Docker Compose: Install it as per the official documentation.
Once you have it installed, you can check by running the command:
docker compose version
# Docker Compose version 2.23.3
Note: docker-compose
(with the hyphen) may not be supported. You are advised to use docker compose
(without hyphen)
instead.
🚀🚀🚀 Quick Try: Step-by-Step Guide
For an in-depth, step-by-step guide on self-hosting AppFlowy Cloud on AWS EC2, particularly for demonstration purposes, please consult our detailed documentation: Self-Hosting AppFlowy Cloud on AWS EC2 - Step by Step Guide
Note: This guide is tailored for demonstration purposes using the AWS EC2 free tier. For more customized deployment options, please follow the subsequent steps outlined below.
- Clone this repository into your host server and
cd
into it
git clone https://github.com/AppFlowy-IO/AppFlowy-Cloud
cd AppFlowy-Cloud
- This is perhaps the most important part of the deployment process, please read carefully.
- It is required that there is a
.env
file in the root directory of the repository. - To get started, copy the template
deploy.env
as.env
using the following shell commands:
cp deploy.env .env
- Kindly read through the comments for each option
- Modify the values in
.env
according to your needs. Minimally, you will have to update $FQDN to match your host server's domain, unless you are deploying on localhost.
If you would like to use one of the identity providers to log in, refer to the Authentication documentation.
If you would like to use magic link to log in, you will need to set up env variables related to SMTP.
If neither of the above are configured, then the only was to sign in is via the admin portal (the home page), using the admin email and password. After logging in as an admin, you can add users and set their passwords. The new user will be able to login to the admin portal using this credential.
- The following command will build and start AppFlowy-Cloud.
docker compose up -d
- Please check that all the services are running
docker ps -a
We have provided optional services in the file docker-compose-extra.yml
.
You do not need them for a fully functional installation of AppFlowy Cloud, but they could be helpful for various
admin/debug tasks.
We include all services in the file docker-compose.yml
. It is easier to start all services and remove orphan containers warning message.
pgadmin
(Web UI to visualize the provided postgres database)portainer
/portainer_init
(Web UI to provide some monitoring and ease of container management)tunnel
(Cloudflare tunnel to provide a secure way to connect AppFlowy to Cloudflare without a publicly routable IP address)
docker compose --file docker-compose-extras.yml up -d
When using the
docker compose up -d
command without specifying a tag, Docker Compose will pull thelatest
tag for theappflowy_cloud
andadmin_frontend
images from Docker Hub by default. If you've set theAPPFLOWY_CLOUD_VERSION
or theAPPFLOWY_ADMIN_FRONTEND_VERSION
environment variable, it will pull the specified version instead.
- Check that services are running correctly
docker ps -a
- If you find a particular service not working properly, you can inspect the logs:
# Getting logs for a particular docker compose service
# You can obtain its name by running `docker ps -a`
docker logs <NAME>
# e.g. docker logs appflowy-cloud-admin_frontend-1
- It is very common to reconfigure and restart. To do so, simply edit the
.env
and rundocker compose up -d
again
- To upgrade to the latest version, use
docker compose pull
andgit pull
to fetch the latest changes for images, docker compose files, and the configuration files. - Then, run
docker compose up -d
to start the services. - Alternatively, you can use a specific image tag instead of
latest
, and checkout the corresponding tag for the repository. - Sometimes there might be additional steps required for upgrade. Refer to the upgrade notes for more information.
-
AppFlowy Web is provided as part of the docker compose setup, and should work out of the box. It is accessible via
/app
or/
. -
For existing self hosters who upgraded their setup to include AppFlowy Web in the docker compose,
/
might redirect them to/web
instead of/app
. This is because the home page/
used to be occupied by the admin console, and redirects to/web
by default. The browser cache might need to be cleared to see the new behavior. Alternatively, just access the AppFlowy Web directly via/app
. -
In order for login flow to succeed, we need to make sure that the necessary headers for redirect url can be passed to AppFlowy Cloud. If you are using only the Nginx service running within the official docker compose setup, then this is already taken care of and no further steps are required. Otherwise, if you have an external Nginx in front of the service, then make sure that you have the following:
proxy_pass_request_headers on; underscores_in_headers on;
-
You can also deploy AppFlowy Web on another domain, using tools such as Vercel, instead of using the existing docker compose setup. You can follow the guide here.
-
If AppFlowy Web is served on a separate domain, you will need to modify the nginx conf to prevent CORS issues. By default, we allow requests from
localhost:3000
, using, the configuration below:map $http_origin $cors_origin { # AppFlowy Web origin "~^http://localhost:3000$" $http_origin; default "null"; }
Replace
http://localhost:3000
with your AppFlowy Web origin. -
If you wish to build you own AppFlowy Web docker image, then run the following commands from the root directory of this repository:
docker build --build-arg VERSION=v<insert version here> docker/web -f docker/web/Dockerfile -t appflowy-web
The available versions can be found on AppFlowy Web repository.
- After Deployment, you should see that AppFlowy-Cloud is serving 2 ports
443
(https)80
(http)- Your host server need to expose either of these ports.
- To use your own SSL certificates for https, replace
certificate.crt
andprivate_key.key
with your own innginx/ssl/
directory. Please note that the certificates in the repository are for demonstration purpose only and will need to be replaced by a certificate that is trusted by your devices. For example, you can use Let's Encrypt, or CloudFlare Origin CA, if the AppFlowy Cloud endpoint is placed behind a cloudflare proxy.
The default url is using the postgres in docker compose, in service appflowy_cloud
and gotrue
respectively.
However it is possible to use an external postgres, as long as it is accessible by the services.
- You need to change the following settings:
POSTGRES_HOST=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432
POSTGRES_DB=postgres
- You would need to run the
supabase_auth.sh
frommigrations/before
in your hosted postgres. Make sure that the environmental variables referenced by the script (eg. $SUPABASE_PASSWORD) have been exported before running the script.
If your deployed AppFlowy-Cloud is publicly available and you do not want any other users to access it, you can disable sign up
by setting the GOTRUE_DISABLE_SIGNUP
environment variable to true
.
The default configuration assumes that TLS is used for SMTP, typically on port 465. If you are using STARTTLS, such as when
using port 587, please change APPFLOWY_MAILER_SMTP_TLS_KIND
to opportunistic
.
Sign in via magic link will not be possible. Inviting users to workspace and accepting invitation will have to be performed via the admin portal as opposed to links provided in emails.
I already have an Nginx server running on my host server. How do I configure it to work with AppFlowy-Cloud?
- First, remove the
nginx
service from thedocker-compose.yml
file. - Update the docker compose file such that the ports for
appflowy_cloud
,gotrue
, andadmin_frontend
are mapped to different ports on the host server. If possible, use firewall to make sure that these ports are not accessible from the internet. - Update
proxy_pass
innginx/nginx.conf
to point to the above ports. Then adapt this configuration for your existing Nginx configuration.
- Refer to the AppFlowy Web section in the deployment steps. Make sure that the necessary headers are present.