Deploying AppFlowy
Introduction
AppFlowy is an open-source alternative to Notion, built with Flutter and Rust. It’s a powerful workspace and productivity platform that allows you to organize your notes, tasks, wikis, and databases in one place. AppFlowy emphasizes data privacy, customization, and extensibility, making it an excellent choice for individuals and teams who want control over their productivity tools.
AppFlowy features:
- Rich Text Editor: Create beautiful documents with markdown support
- Kanban Boards: Organize tasks and projects visually
- Calendar Views: Schedule and track events
- Database Management: Build custom databases with multiple views
- Offline-First: Work seamlessly without an internet connection
- Self-Hosted: Full control over your data and privacy
- Customizable: Theme and extend with plugins
This comprehensive guide walks you through deploying AppFlowy on Klutch.sh using Docker, including detailed installation steps, sample configurations, and production-ready best practices for persistent storage.
Prerequisites
Before you begin, ensure you have the following:
- A Klutch.sh account
- A GitHub account with a repository for your AppFlowy project
- Docker installed locally for testing (optional but recommended)
- Basic understanding of Docker and containerization concepts
Installation and Setup
Step 1: Create Your Project Directory
First, create a new directory for your AppFlowy deployment project:
mkdir appflowy-klutchcd appflowy-klutchgit initStep 2: Create the Dockerfile
Create a Dockerfile in your project root directory. This will define your AppFlowy container configuration:
FROM ghcr.io/appflowy-io/appflowy_web:latest
# Set working directoryWORKDIR /app
# Optional: Add custom configuration# COPY ./config /app/config
# Expose the default AppFlowy portEXPOSE 8080
# The base image already has the CMD configured# CMD is typically: ["./appflowy_web"]Note: AppFlowy provides official Docker images that are pre-configured and ready to use. The example above uses the web version of AppFlowy.
Step 3: (Optional) Create a Configuration File
You can create a configuration file for AppFlowy settings. Create a file named appflowy.conf:
# appflowy.conf - AppFlowy configuration
# Server settingsHOST=0.0.0.0PORT=8080
# Database settings (if using external database)# DATABASE_URL=postgresql://user:password@host:port/dbname
# Storage settingsSTORAGE_PATH=/app/dataIf you create a configuration file, add a COPY command in your Dockerfile to include it:
COPY ./appflowy.conf /app/appflowy.confStep 4: Create Environment Variables File (Optional)
Create a .env.example file to document the environment variables your deployment might need:
# .env.example - Environment variables template
# Application settingsAPPFLOWY_ENV=productionAPPFLOWY_PORT=8080
# SecurityAPPFLOWY_SECRET_KEY=your-secret-key-here
# Optional: Database configuration# DATABASE_URL=postgresql://username:password@host:port/databaseImportant: Never commit actual secrets to your repository. This file is just a template.
Step 5: Test Locally (Optional)
Before deploying to Klutch.sh, you can test your AppFlowy setup locally:
# Build the Docker imagedocker build -t my-appflowy .
# Run the containerdocker run -d \ --name appflowy-test \ -p 8080:8080 \ -v appflowy-data:/app/data \ my-appflowy
# Check if it's runningdocker ps
# View logsdocker logs appflowy-test
# Access AppFlowy at http://localhost:8080
# Stop and remove the test container when donedocker stop appflowy-testdocker rm appflowy-testStep 6: Push to GitHub
Commit your Dockerfile and configuration files to your GitHub repository:
git add Dockerfile appflowy.conf .env.examplegit commit -m "Add AppFlowy Docker configuration"git remote add origin https://github.com/yourusername/appflowy-klutch.gitgit push -u origin mainDeploying Without a Dockerfile
Klutch.sh uses Nixpacks to automatically detect and build your application. However, since AppFlowy is primarily distributed as pre-built Docker images, we recommend using the Dockerfile approach for AppFlowy deployments to ensure you’re using the official, tested images.
If you want to build from source:
- Clone the AppFlowy repository and push it to GitHub
- Log in to Klutch.sh
- Create a new project
- Create a new app:
- Select your GitHub repository and branch
- Select HTTP as the traffic type
- Set the internal port to 8080
- Add environment variables as needed
Note: If you need to customize the start or build command, you can set environment variables like START_COMMAND or BUILD_COMMAND for Nixpacks.
Deploying With a Dockerfile (Recommended)
Klutch.sh will automatically detect a Dockerfile in your repository’s root directory. This is the recommended approach for AppFlowy deployments.
Follow these steps to deploy AppFlowy on Klutch.sh with persistent storage:
-
Log in to Klutch.sh
Navigate to klutch.sh/app and sign in to your account.
-
Create a New Project
Go to Create Project and give your project a meaningful name (e.g., “AppFlowy Workspace”).
-
Create a New App
Navigate to Create App and configure the following settings:
-
Select Your Repository
- Choose GitHub as your Git source
- Select the repository containing your Dockerfile
- Choose the branch you want to deploy (usually
mainormaster)
-
Configure Traffic Type
- Traffic Type: Select HTTP (AppFlowy web interface uses HTTP/HTTPS)
- Internal Port: Set to
8080(the port your container listens on)
-
Set Environment Variables
Add the following environment variables for your AppFlowy configuration:
APPFLOWY_ENV: Set toproductionAPPFLOWY_SECRET_KEY: A strong secret key for security (use a secure password generator)- Add any other custom environment variables your setup requires
Security Note: Always use strong, unique secret keys for production deployments.
-
Attach a Persistent Volume
This is critical for ensuring your workspace data persists across deployments and restarts:
- In the Volumes section, click “Add Volume”
- Mount Path: Enter
/app/data(this is where AppFlowy stores workspace data) - Size: Choose an appropriate size based on your expected data volume (e.g., 5GB, 10GB, or more)
Important: AppFlowy requires persistent storage to maintain your notes, databases, and other workspace data between container restarts.
-
Configure Additional Settings
- Region: Select the region closest to your users for optimal latency
- Compute Resources: Choose CPU and memory based on your workload (minimum 512MB RAM recommended)
- Instances: Start with 1 instance (you can scale up later based on usage)
-
Deploy Your Application
Click “Create” to start the deployment. Klutch.sh will:
- Automatically detect your Dockerfile in the repository root
- Build the Docker image
- Attach the persistent volume
- Start your AppFlowy container
- Assign a URL for external access
-
Access Your AppFlowy Instance
Once deployment is complete, you’ll receive a URL like
example-app.klutch.sh. Navigate to this URL in your browser to access your AppFlowy workspace.
Getting Started with AppFlowy
Once your AppFlowy instance is deployed and running, you can start using it:
Creating Your First Workspace
- Open your deployed AppFlowy URL (
example-app.klutch.sh) in a browser - Create your account or workspace
- Start creating documents, databases, and organizing your content
Sample Document Structure
Here’s a basic document structure you can create in AppFlowy:
Project Management Workspace
📁 Projects ├── 📄 Project Alpha │ ├── Overview │ ├── Tasks (Kanban Board) │ └── Timeline (Calendar) ├── 📄 Project Beta └── 📊 Resource DatabaseUsing AppFlowy Features
Creating a Document:
- Click “New Page” or ”+”
- Choose “Document” as the page type
- Start writing with rich text formatting and markdown support
Creating a Database:
- Click “New Page” or ”+”
- Choose “Database” or “Board” for Kanban view
- Add properties and customize views
Keyboard Shortcuts:
Ctrl/Cmd + N: New pageCtrl/Cmd + K: Quick search/: Trigger command menuCtrl/Cmd + /: Toggle sidebar
Production Best Practices
Security Recommendations
- Use Strong Secrets: Never use default or weak secret keys in production. Generate strong, random keys using a password manager or cryptographic tools.
- Environment Variables: Store all sensitive credentials as environment variables in Klutch.sh, never in your Dockerfile or repository.
- HTTPS: Klutch.sh provides HTTPS by default, ensuring encrypted connections to your AppFlowy instance.
- Regular Backups: Implement a backup strategy for your persistent volume data.
- Access Control: Consider implementing authentication layers or IP restrictions for sensitive workspaces.
Performance Optimization
- Resource Monitoring: Monitor your AppFlowy instance’s CPU and memory usage through Klutch.sh dashboard.
- Volume Size: Allocate sufficient storage for your expected data growth.
- Scaling: If you experience high traffic, consider scaling up compute resources or adding more instances.
- Caching: Configure appropriate caching headers for static assets.
Data Management
- Persistent Volumes: Always use persistent volumes for production deployments to prevent data loss.
- Regular Maintenance: Periodically check disk usage and clean up unnecessary data.
- Database Backups: If using an external database, implement automated backup schedules.
Monitoring
Monitor your AppFlowy deployment for:
- Response times and page load speeds
- CPU and memory utilization
- Disk space usage on persistent volumes
- Application errors and logs (viewable in Klutch.sh dashboard)
- User activity and concurrent connections
Troubleshooting
Cannot Access AppFlowy
- Verify that your deployment is running in the Klutch.sh dashboard
- Check that the internal port is set to 8080
- Ensure HTTP is selected as the traffic type
- Review deployment logs for any startup errors
Data Not Persisting
- Verify that the persistent volume is correctly attached at
/app/data - Check that the volume has sufficient space allocated
- Ensure the volume mount path matches AppFlowy’s data directory
Performance Issues
- Review resource utilization in the Klutch.sh dashboard
- Consider increasing CPU and memory allocation
- Check if disk I/O is a bottleneck (upgrade volume if needed)
- Optimize large documents or databases
Configuration Problems
- Verify all environment variables are set correctly in Klutch.sh
- Check Docker logs for configuration errors
- Ensure the Dockerfile is correctly formatted and builds locally
Additional Resources
- Klutch.sh Documentation
- Official AppFlowy Documentation
- AppFlowy GitHub Repository
- Klutch.sh Volumes Guide
- Klutch.sh Networking Guide
- Klutch.sh Quick Start Guide
Conclusion
Deploying AppFlowy to Klutch.sh with Docker provides a robust, self-hosted productivity solution with full control over your data. By following this guide, you’ve set up a production-ready AppFlowy instance with persistent storage, proper security configurations, and the ability to scale as your needs grow. Your workspace is now ready to support your productivity and collaboration needs with the privacy and customization benefits of self-hosting.