NotionProxy is a free, open-source tool that enables you to serve your Notion website through your custom domain using Cloudflare Workers, providing URL rewriting and fast edge performance without any hosting costs.
- Add your domain to Cloudflare. Make sure to click 'Manually enter DNS records". Also make sure that DNS doesn't have
Arecords for your domain and noCNAMEalias forwww - Follow the steps to update your domain's nameservers to Cloudflare's. Steps may vary depending on which domain service you used to buy it. Changing the nameservers will ensure that any DNS routing goes through Cloudflare rather than your domain service. This step may take a few hours, but usually it works within 10 minutes.
- Create a new worker on Cloudflare. This is found under Workers Routes > Manage Workers > Create > Start with Hello World. Give it a meaningful name, e.g.
yourdomain-com-notion-proxy. - Keep the default example worker code, we will overwrite it anyway during deploy (see below)
Tip
A bit outdated but detailed description on how to add your domain to Cloudflare and create a worker is here.
Search for "Step 1: Set up your Cloudflare account".
Use the provided script to quickly set up your customized domain:
./initialize-new-domain.sh <new-domain> <notion-subdomain> <main-page-id> <cloudflare-worker-name>Example:
./initialize-new-domain.sh mynewdomain.com my-notion-123 abc123def456ghi789jkl012mno345pq yourdomain-com-notion-proxyParameters:
new-domain: Your custom domain (e.g., example.com)notion-subdomain: The subdomain part of your Notion URL (e.g., if your Notion URL is https://my-notion-123.notion.site, use 'my-notion-123')main-page-id: The Notion page ID for your main/home pagecloudflare-worker-name: The name for your Cloudflare Worker (e.g., yourdomain-com-notion-proxy), the part before any periods
- Navigate to your new domain folder
- Run
npm install - Update
src/site-config.tswith your specific metadata - Deploy with
npm run deploy
- The URL rewriting happens at the edge, ensuring fast performance
- All Notion pages are accessible via their page IDs automatically