Decap CMS Git-Based Installation Setup
Decap CMS mounts into existing project by adding two files: admin/index.html and admin/config.yml. All admin interface loads on client — no server part. Git repository acts as database, commits as transactions.
Adding to Existing Project
For any static generator or Next.js project, place admin folder in static files directory:
# Next.js
public/admin/index.html
public/admin/config.yml
# Astro
public/admin/index.html
public/admin/config.yml
# Hugo
static/admin/index.html
static/admin/config.yml
# Eleventy
admin/index.html → copied passthrough
admin/config.yml → copied passthrough
For Eleventy, explicitly set passthrough:
// .eleventy.js
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy('admin')
}
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<title>Content Management</title>
</head>
<body>
<script src="https://unpkg.com/decap-cms@^3.1.2/dist/decap-cms.js"></script>
</body>
</html>
Fix version — not ^3.0.0, but specific 3.1.2.
Authentication Backends
GitHub + Netlify Identity — simplest if hosted on Netlify:
backend:
name: git-gateway
branch: main
publish_mode: editorial_workflow
Enable Identity and Git Gateway in Netlify settings.
GitHub OAuth without Netlify — for Vercel, VPS, GitHub Pages:
backend:
name: github
repo: myorg/my-site
branch: main
base_url: https://cms-oauth.mysite.com
OAuth proxy — small server accepting GitHub code, returning token. Ready implementation:
git clone https://github.com/vencax/netlify-cms-github-oauth-provider
cd netlify-cms-github-oauth-provider
cp .env.example .env
# Fill GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, REDIRECT_URL
npm install
node index.js
Deploy to Railway or as Docker. 20–30 minutes.
Editorial Workflow
Enable drafts and review process:
publish_mode: editorial_workflow
Kanban board appears: Draft → In Review → Ready. Each draft creates separate branch, merge to main on publish.
Local Testing
Decap supports local backend:
# Development only
backend:
name: proxy
proxy_url: http://localhost:8081/api/v1
npx decap-server
Now http://localhost:3000/admin works without GitHub auth.
Timeline
Basic setup with 2–3 collections and GitHub OAuth: 4–6 hours. Full setup with Editorial Workflow, Cloudinary: 1–2 days.







