---
title: 'Cockpit CMS'
url: 'https://niklas-stephan.de/en/wiki/self-hosted/cockpit-cms'
markdown: 'https://niklas-stephan.de/en/wiki/self-hosted/cockpit-cms.md'
lang: en
date: '2026-11-05'
description: 'Cockpit CMS Verified: as operated in 2022, the site generation before nCMS; config files as deployed then. Motivation and story: blog post The (almost) perfect website – concept. Architecture of the headless-CMS site generation stage of niklas-stephan.de: Agentejo Cockpit (headless CMS) for content…'
---

#  Cockpit CMS 

*Verified: as operated in 2022, the site generation before nCMS; config files as deployed then. Motivation and story: blog post [The (almost) perfect website – concept](https://niklas-stephan.de/en/blog/die-beinahe-perfekte-website-konzept).*

Architecture of the headless-CMS site generation stage of niklas-stephan.de: [Agentejo Cockpit](https://getcockpit.com/) (headless CMS) for content, Node-RED for the static build, served from a RAM disk.

![Site webshot](https://niklas-stephan.de/user/pages/wiki/02.self-hosted/cockpit-cms/webshot-scaled-1.webp)

## Tool stack

- **Cockpit (Agentejo)** – WCMS with clean back/frontend separation, media management and an integrated HTTP API; webhooks trigger builds.
- **Node-RED** – build pipeline (not used as IoT here, the flow engine is what matters).
- **Bootstrap 5** – frontend skeleton; no jQuery, vanilla JS.
- **VS Code** – editing of templates, CSS, JS; git for versioning.
- Supporting services: Nginx Reverse Proxy Manager, Let's Encrypt, Matomo, Docker/Docker-Compose.

## Content model and pipeline

Static HTML content is stored in Cockpit **singletons** (with attributes such as language and version); posts live in a **collection**, so one Cockpit instance can serve many sites. Images are managed in Cockpit with automatic thumbnails. The site is generated on demand:

1. Start of the deployment manually or via webhook (Cockpit fires a webhook on save).
2. Collect all static sources.
3. Collect all existing singletons and posts.
4. Dynamic generation of meta data.
5. Rendering of the individual pages.
6. Saving the pages on disk and in memory.

Generated files land in `/dev/shm` (RAM disk); the reverse proxy serves from there – no CDN was needed. The full build took 0.099 s on a shared server.

## Compose: Cockpit

```yaml
<span class="hljs-attr">services:</span>
  <span class="hljs-attr">cms-db:</span>
    <span class="hljs-attr">image:</span> <span class="hljs-string">'mongo:latest'</span>
    <span class="hljs-attr">restart:</span> <span class="hljs-string">always</span>
    <span class="hljs-attr">volumes:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">'./db:/data/db'</span>
    <span class="hljs-attr">networks:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">default</span>
    <span class="hljs-attr">logging:</span>
      <span class="hljs-attr">options:</span>
        <span class="hljs-attr">max-size:</span> <span class="hljs-string">"10m"</span>
        <span class="hljs-attr">max-file:</span> <span class="hljs-string">"3"</span>
  <span class="hljs-attr">cms:</span>
    <span class="hljs-attr">image:</span> <span class="hljs-string">agentejo/cockpit</span>
    <span class="hljs-attr">restart:</span> <span class="hljs-string">always</span>
    <span class="hljs-attr">volumes:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">'./cms/config.php:/var/www/html/config/config.php'</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">'./cms/defines.php:/var/www/html/config/defines.php'</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">'./storage:/var/www/html/storage'</span>
    <span class="hljs-attr">environment:</span>
        <span class="hljs-attr">COCKPIT_SESSION_NAME:</span> <span class="hljs-string">SESSION</span>
        <span class="hljs-attr">COCKPIT_SALT:</span> <span class="hljs-string">SALT</span>
        <span class="hljs-attr">COCKPIT_DATABASE_SERVER:</span> <span class="hljs-string">'mongodb://cms-db:27017'</span>
        <span class="hljs-attr">COCKPIT_DATABASE_NAME:</span> <span class="hljs-string">DBNAME</span>
    <span class="hljs-attr">depends_on:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">cms-db</span>
    <span class="hljs-attr">ports:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">"8080:80"</span>
    <span class="hljs-attr">networks:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">default</span>
    <span class="hljs-attr">logging:</span>
      <span class="hljs-attr">options:</span>
        <span class="hljs-attr">max-size:</span> <span class="hljs-string">"10m"</span>
        <span class="hljs-attr">max-file:</span> <span class="hljs-string">"3"</span>
<span class="hljs-attr">volumes:</span>
  <span class="hljs-attr">mongo-vol:</span> <span class="hljs-literal">null</span>
```

![Cockpit backend](https://niklas-stephan.de/user/pages/wiki/02.self-hosted/cockpit-cms/02-cockpit-2048x1230.webp)

## Compose: Node-RED build pipeline

```yaml
<span class="hljs-attr">services:</span>
  <span class="hljs-attr">node-red:</span>
    <span class="hljs-attr">image:</span> <span class="hljs-string">nodered/node-red:latest</span>
    <span class="hljs-attr">restart:</span> <span class="hljs-string">always</span>
    <span class="hljs-attr">environment:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">TZ=Europe/Berlin</span>
    <span class="hljs-attr">ports:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">"1880:1880"</span>
    <span class="hljs-attr">networks:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">default</span>
    <span class="hljs-attr">logging:</span>
      <span class="hljs-attr">options:</span>
        <span class="hljs-attr">max-size:</span> <span class="hljs-string">"10m"</span>
        <span class="hljs-attr">max-file:</span> <span class="hljs-string">"3"</span>
    <span class="hljs-attr">volumes:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">./data:/data</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">./templates:/templates</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">./static:/static</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">/etc/localtime:/etc/localtime:ro</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">/dev/shm/nsde:/ramdisk</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">./development:/development</span>
```

![VS Code as the editing hub](https://niklas-stephan.de/user/pages/wiki/02.self-hosted/cockpit-cms/03-vscode.webp)

## Successors

This stage was replaced by [ncms](https://niklas-stephan.de/en/wiki/self-hosted/ncms) (own Node-RED flat-file CMS, 2022–2024), and that by the current Grav stack (see [the website relaunch post](https://niklas-stephan.de/en/blog/website-relaunch-2026)).

 self-hostedcmswebretired

---

## Navigation

- Parent: [Self-hosted](https://niklas-stephan.de/en/wiki/self-hosted.md)
- Previous: [Calibre Web](https://niklas-stephan.de/en/wiki/self-hosted/calibre-web.md)
- Next: [Data Mesh Manager](https://niklas-stephan.de/en/wiki/self-hosted/data-mesh-manager.md)
