Deploying to Cloudflare Pages with Access¶
You are making the right choice. Deploying your internal wiki on Cloudflare Pages with Access (Zero Trust) is the "Cheat Code" for small teams. It gives you enterprise-grade security (SSO/Email Login) for $0/month.
Here is the step-by-step guide to deploying your MkDocs knowledge base securely.
Phase 1: Prepare your Repository (Local)¶
Before deploying, ensure your repo is ready for Cloudflare's build system.
- Add a
requirements.txtfile in your root folder. This tells Cloudflare which Python packages to install.
- Add a
runtime.txtfile (Optional but recommended).
- Push to GitHub.
Ensure your repo is Private on GitHub (e.g.,
github.com/neon-ogre/knowledge-base).
Phase 2: Connect Cloudflare Pages¶
- Log in to the Cloudflare Dashboard.
- Go to Workers & Pages > Create Application > Pages > Connect to Git.
- Select your GitHub account and the
knowledge-baserepository. - Configure the Build:
- Framework Preset: None (or select MkDocs if available, but "None" is safer).
- Build Command:
pip install -r requirements.txt && mkdocs build - Output Directory:
site - (Note: MkDocs outputs to
siteby default unless you changed it inmkdocs.yml). - Click Save and Deploy.
Cloudflare will now pull your code, install Python/MkDocs, build the HTML, and deploy it to knowledge-base.pages.dev. IT IS CURRENTLY PUBLIC. Do not share the link yet.
Phase 3: Lock it Down (Cloudflare Access)¶
This is where you make it private so only your team can see it.
- Go to Zero Trust on the Cloudflare Dashboard sidebar.
- Go to Access > Applications > Add an Application.
- Select Self-hosted.
- Configure the Application:
- Application Name: "Neon Ogre Wiki"
- Session Duration: "1 Month" (So you don't have to log in every day).
- Application Domain:
wiki.neonogre.com(or stick with the.pages.devsubdomain if you don't have a custom domain yet). - Click Next to define the Policy.
- Configure the Policy:
- Policy Name: "Team Only"
- Action: "Allow"
- Configure Rules:
- Include: Select Emails Ending In ->
@neonogre.com(or list specific emails if you use Gmail).
- Include: Select Emails Ending In ->
- Click Next and Add Application.
Phase 4: DNS Setup (If using custom domain)¶
If you used wiki.neonogre.com:
- Go back to Workers & Pages > Your Project > Custom Domains.
- Click Set up a custom domain.
- Enter
wiki.neonogre.com. - Cloudflare will automatically add the DNS record (CNAME) for you.
The Result¶
- You visit
wiki.neonogre.com. - You are blocked by a Cloudflare Login Screen.
- You type your email.
- You get a 6-digit code in your inbox.
- You enter it and—boom—you are in your private MkDocs wiki.
Bonus: The "Edit on GitHub" Link¶
In your mkdocs.yml, add this so your team can jump straight to the edit page from the wiki:
(Now every page in the wiki has a little pencil icon that opens the file in GitHub for quick edits).
Security Notes¶
- Zero Trust Authentication: Only approved email addresses can access
- No VPN Required: Access works from anywhere with email verification
- Free Tier: Suitable for small teams (up to 50 users on free plan)
- Session Management: 1-month sessions mean minimal login friction
Related Documentation¶
- Knowledge Base System - Overall architecture
- Folder Structure Standard - Content organization