DEV Community

Sh Raj
Sh Raj

Posted on

Self-Host a Notion Alternative for Free Using AppFlowy + Cloudflare

πŸš€ How to Self-Host a Notion Alternative for Free Using AppFlowy + Cloudflare

Tired of Notion's pricing or privacy concerns? Here's how you can self-host AppFlowy, a powerful open-source alternative to Notion, completely free using Cloudflare Tunnels and Cloudflare Pages/Workers.


🧠 What is AppFlowy?

AppFlowy is a privacy-first, open-source alternative to Notion built using Flutter and Rust. It lets you create rich text documents, kanban boards, and more β€” all offline, or you can host it yourself for full control.


πŸ› οΈ Tech Stack

Tool Purpose
AppFlowy Notion-like app
Docker Easy deployment
Cloudflare Tunnels Secure, public URLs without exposing ports
Cloudflare Pages/Workers Optional reverse proxy/CDN edge caching

βœ… Why Self-Host?

  • πŸ†“ Free & open source
  • πŸ”’ Full control over your data
  • 🌍 Access from anywhere (Cloudflare Tunnel)
  • ⚑ No server management required

🧰 Requirements

  • A machine to run AppFlowy (e.g., local PC or VPS)
  • Docker installed on your system
  • A Cloudflare account
  • A custom domain (optional, but recommended)

πŸ§‘β€πŸ³ Step-by-Step Guide


1. πŸš€ Clone and Set Up AppFlowy with Docker

git clone https://github.com/AppFlowy-IO/AppFlowy.git
cd AppFlowy
Enter fullscreen mode Exit fullscreen mode

Create a .env file (or use the example)

cp .env.example .env
Enter fullscreen mode Exit fullscreen mode

Set basic credentials:

USERNAME=admin
PASSWORD=yourpassword
Enter fullscreen mode Exit fullscreen mode

Start the App

docker-compose up -d
Enter fullscreen mode Exit fullscreen mode

By default, AppFlowy runs on http://localhost:3000.


2. πŸ”“ Expose It to the Web with Cloudflare Tunnel

Install Cloudflare Tunnel (cloudflared)

wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
Enter fullscreen mode Exit fullscreen mode

Login and connect your domain:

cloudflared tunnel login
Enter fullscreen mode Exit fullscreen mode

Create and run a tunnel:

cloudflared tunnel create appflowy-tunnel
cloudflared tunnel route dns yourdomain.com appflowy.yourdomain.com
Enter fullscreen mode Exit fullscreen mode

Now configure a tunnel for AppFlowy:

# config.yml
tunnel: appflowy-tunnel
credentials-file: /home/youruser/.cloudflared/appflowy-tunnel.json

ingress:
  - hostname: appflowy.yourdomain.com
    service: http://localhost:3000
  - service: http_status:404
Enter fullscreen mode Exit fullscreen mode

Run the tunnel:

cloudflared tunnel --config config.yml run appflowy-tunnel
Enter fullscreen mode Exit fullscreen mode

βœ… Your AppFlowy instance is now publicly accessible via https://appflowy.yourdomain.com.


3. 🌐 Optional: Add SSL, CDN & Caching with Cloudflare Pages/Workers

If you want more speed, you can:

  • Add caching rules in Cloudflare Dashboard
  • Use Cloudflare Workers as a reverse proxy
  • Use Cloudflare Access to secure it with Google Auth

πŸ” Secure Your Instance

  • Change your password regularly
  • Use Cloudflare Zero Trust for login protection
  • Optionally, restrict access via IP or email address

πŸ’Ύ Optional: Persistent Storage

Ensure that Docker saves user data to a volume:

services:
  appflowy:
    ...
    volumes:
      - appflowy_data:/appflowy/data

volumes:
  appflowy_data:
Enter fullscreen mode Exit fullscreen mode

This way, your content is preserved even if the container restarts.


πŸ§ͺ Test It

Go to https://appflowy.yourdomain.com and log in with your credentials. You’ll be able to:

  • Create documents
  • Build kanban boards
  • Use offline and sync when needed

πŸ”„ Auto-Restart on Reboot (Optional)

Install Docker Compose as a system service or use:

sudo crontab -e
# Add:
@reboot docker-compose -f /path/to/docker-compose.yml up -d && cloudflared tunnel run appflowy-tunnel
Enter fullscreen mode Exit fullscreen mode

πŸ’¬ Final Thoughts

AppFlowy is a brilliant choice if you love Notion's interface but want more control, privacy, and no cost. Hosting it using Cloudflare Tunnels makes it extremely easy, secure, and fast β€” all without any paid infrastructure.


πŸ“Ž Useful Links


🧠 Bonus Idea

Want multiple users and team sharing? Set up a PostgreSQL database and reverse proxy with Nginx, or integrate with your organization's SSO via Cloudflare Access.


If you found this helpful, consider ⭐ starring the repo or sharing this article with your friends. Happy hosting!

Top comments (0)

MongoDB Atlas runs apps anywhere. Try it now.

MongoDB Atlas runs apps anywhere. Try it now.

MongoDB Atlas lets you build and run modern apps anywhereβ€”across AWS, Azure, and Google Cloud. With availability in 115+ regions, deploy near users, meet compliance, and scale confidently worldwide.

Start Free

πŸ‘‹ Kindness is contagious

Delve into this thought-provoking piece, celebrated by the DEV Community. Coders from every walk are invited to share their insights and strengthen our collective intelligence.

A heartfelt β€œthank you” can transform someone’s dayβ€”leave yours in the comments!

On DEV, knowledge sharing paves our journey and forges strong connections. Found this helpful? A simple thanks to the author means so much.

Get Started