Note Formerly
docker-netlify-cms-standalone
. In early 2023 Netlify CMS was rebranded to Decap CMS under new ownership (see post).
Easy-to-use Docker image to self-host Decap CMS (without using Netlify).
Includes Decap CMS + an external authentication provider to allow auth with Github/Gitlab.
Why use Decap CMS? Decap CMS is a headless CMS that presents a clean UI for editing content (e.g. markdown files) stored in a Git repository. Easy to configure with a YAML config file - a simple and flexible way to add content to any site built with a static site generator.
You will need Docker installed on your system
docker run -d \
-p 80:80 \
-e ORIGINS='<your root url>' \
-e OAUTH_CLIENT_ID='<your_github_client_id>' \
-e OAUTH_CLIENT_SECRET='<your_github_client_secret>' \
-v ./my-local-conf.yml:/app/config.yml:ro \
--name decap-cms \
--restart=always \
itsmejoeeey/docker-decap-cms-standalone:latest
See also: "Supplying a valid config.yml
file"
Environment variables:
ORIGINS
: the root url Decap CMS will be accessible from (i.e.cms.example.com
). Can contain more than one (comma-separated). Can contain regex (e.g..*.example.com
).OAUTH_CLIENT_ID
andOAUTH_CLIENT_SECRET
: need to provide from Github (see below). Additionally:GIT_HOSTNAME
: for enterprise Github installations.
- Visit Github and go to
Settings > Developer settings > OAuth Apps
- Create a 'New OAuth App' with:
Homepage URL
= your application homepage (i.e.https://example.com
)Authorization callback URL
={origin}/callback
(i.e.https://cms.example.com/callback
)
docker run -d \
-p 80:80 \
-e ORIGINS='<your root url>' \
-e OAUTH_CLIENT_ID='<your_gitlab_client_id>' \
-e OAUTH_CLIENT_SECRET='<your_gitlab_client_secret>' \
-e GIT_HOSTNAME='https://gitlab.com' \
-e OAUTH_PROVIDER='gitlab' \
-e SCOPES='api' \
-e OAUTH_AUTHORIZE_PATH='/oauth/authorize' \
-e OAUTH_TOKEN_PATH='/oauth/token' \
-v ./my-local-conf.yml:/app/config.yml:ro \
--name decap-cms \
--restart=always \
itsmejoeeey/docker-decap-cms-standalone:latest
See also: "Supplying a valid config.yml
file"
Environment variables:
ORIGINS
: the root url Decap CMS will be accessible from (i.e.cms.example.com
). Can contain more than one (comma-separated). Can contain regex (e.g..*.example.com
).OAUTH_CLIENT_ID
andOAUTH_CLIENT_SECRET
: need to provide from Gitlab (see further instruction here).OAUTH_PROVIDER
,SCOPES
,OAUTH_AUTHORIZE_PATH
,OAUTH_TOKEN_PATH
: don't need to be changed. Additionally:GIT_HOSTNAME
: for enterprise Gitlab installations.
TODO: Elaborate more. See here for more information.
See the example file stored in the repo here.
-
Make sure to update
name
,repo
, andbranch
to match your backend provider. i.e.:name: [github|gitlab] repo: itsmejoeeey/test-blog-content branch: main
-
Make sure to update
base_url
to match the origin(s) you passed initially. i.e.:base_url: https://cms.example.com