- 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.
- AppFlowy Web is a Single Page Application (SPA) that calls the endpoints in
appflowy_cloud
, and is assumed to be served on a different origin that the one used for AppFlowy Cloud (eg. if you are hostingappflowy cloud
onappflowy.home.com
,appflowy_web
may be hosted onweb.appflowy.home.com
). The source code and deployment guide can be found in this repository. - To prevent CORS issues, you will need to add your AppFlowy Web origin. By default, we allow requests from
localhost:3000
, using, the configuration below:Replacemap $http_origin $cors_origin { # AppFlowy Web origin "~^http://localhost:3000$" $http_origin; default "null"; }
http://localhost:3000
with your AppFlowy Web origin.
- 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.