---
title: 'Cockpit CMS'
url: 'https://www.niklas-stephan.de/en/wiki/projects/cockpit-cms'
markdown: 'https://www.niklas-stephan.de/en/wiki/projects/cockpit-cms.md'
lang: en
date: '2026-11-05'
description: 'Cockpit CMS As already outlined in the article \"The (almost) perfect website – part 1: requirements\", a multitude of factors come together in the design and implementation of a modern web presence. For all for whom a simple WordPress installation is not sufficient, or for those who want to learn …'
---

#  Cockpit CMS 

As already outlined in the article \\"The (almost) perfect website – part 1: requirements\\", a multitude of factors come together in the design and implementation of a modern web presence. For all for whom a simple WordPress installation is not sufficient, or for those who want to learn the possible alternatives, in this post I present my implementation with the help of the tools Cockpit, Node-RED and further helpers.

![](https://www.niklas-stephan.de/user/pages/wiki/projects/cockpit-cms/webshot-scaled-1.webp)

## What is the goal?

I wanted to achieve that my page(s) are loaded at the visitor far below 2 seconds and are displayed there nicely and up to date. Besides that I wanted to use modern techniques and tools for it. So much beforehand: I achieved most of that :-). In the selection of the tools I largely took solutions familiar to me, but with the headless CMS Cockpit also tried something new. But in order.

It is almost funny that in 2022 that is (again) the case, but Microsoft Visual Studio Code (VS Code) is actually almost the most important of these tools. Back to the roots and a clear no to the generators of chaotic and slow source code, as WordPress and Jimdo are. Besides that VS Code is far more than just an extended text editor, but also an open-source tool for the administration of whole container landscapes and of course excellent for debugging. Some time ago I also wrote the following application example for that: [Managing source code on GitHub with Visual Studio Code](https://www.niklas-stephan.de/en/wiki/projects/how-tos/github-pages).

Since the release of version 5 of the open-source frontend toolkit Bootstrap from Twitter, this is faster than ever before. One has finally rid oneself of the unnecessary overhead of the jQuery framework and now relies completely on native \\"vanilla\\" JavaScript. I of course did the same at the few self-written functions in the frontend. Bootstrap itself provides CSS classes, icons, components and much more, which save improbably much time and effort in the development of UI/UX.

![](https://www.niklas-stephan.de/user/pages/wiki/projects/cockpit-cms/02-cockpit-2048x1230.webp)

With the open-source web content management system (WCMS) Cockpit from Agentejo the clean separation of back and frontend succeeds. Besides the functionalities usual for a CMS for the maintenance and administration of web content and a media management, the integrated API makes the difference. Something more on that later.

The open-source project Node-RED originally initiated by IBM is perhaps currently the best implementation of an internet-of-things (IoT) low-code platform. Both the restriction \\"low-code\\" and the one on IoT, however, do not quite do justice to the tool. It is indeed developed for these scenarios, but can without toil also be used for quite a lot of code and for the mapping of all conceivable imaginable processes. An example follows.

Some further needed tools and helpers such as the Nginx Reverse Proxy Manager, Let's Encrypt SSL certificates, Matomo Analytics, Docker(-Compose) and further ones would distract here from the focus, which is why I initially leave them outside.

## Why?

The question about the why is simply to answer: Above all professionally I deal daily with the hurdles and difficulties in dealing with monolithic systems. On the other hand companies such as SAP propagate new headless approaches. That and my inner curiosity have driven me to simply make such a setup for myself in order to learn perhaps new risks, but above all possibilities. Or in short: because I want to be able to do it and it is not so difficult at all.

![](https://www.niklas-stephan.de/user/pages/wiki/projects/cockpit-cms/03-vscode.webp)

## How exactly?

The installation of Cockpit CMS and Node-RED in independent containers goes quickly from the hand and should be done in maximal 20 minutes. In the appendix, as an aid, my Docker Compose files.

Now it gets to the \\"meat\\". After the design of the layout and the implementation of the prototype with Bootstrap, I store all static HTML content out into Cockpit CMS in the form of so-called \\"singletons\\" there. These have the advantage that they can be provided with attributes such as language and version etc. Theoretically one could do that also with the CSS and JavaScript files, but then I somehow prefer to work on them in Visual Studio Code. Next we now create a so-called \\"collection\\" in Cockpit, which so to speak forms the frame around our posts. Thus e.g. with one Cockpit installation the content for many websites could be managed. Classy! Images, graphics and the like can also be comfortably managed with Cockpit and above all converted automatically as thumbnails from there. Even better! Access to the whole then occurs via web APIs on which I will go into further shortly. And something more: via so-called webhooks actions can also be started exactly the other way round from Cockpit. Thus I e.g. start automatically a deployment of the complete website at every saving or changing of the collection. Wow! Actually Cockpit was simply only my first Google hit in the search for a headless CMS, but just now I cannot find any more reason why I should switch or look at others.

And now Node-RED comes into play, since I have to make my contents available somehow under [niklas-stephan.de](http://niklas-stephan.de). Actually it is about generating static pages with the goal of maximal performance. In a Google search for \\"static site generators\\" Node-RED is guaranteed not to be found on the first page of the search results. For that there are countless other tools, which however again require an familiarization and mostly also the learning of an own syntax. Through my active activities in the environment of home automation Node-RED is now best known to me, and actually I just want to map a relatively simple process. And that looks as follows:

1. Start of the deployment manually or via webhook
2. Collecting all static sources
3. Collecting 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

Whoever wants to take the trouble to look briefly in the console log of this page sees that I have the time and duration logged at every deployment. There we then also see that the described process takes 0.099 seconds in total. And that on a server which besides that e.g. also mines Monero and provides my cloud environment. So actually already quite fast, but in order to put \\"one more\\" on top I place the generated files in the last step in `/dev/shm`, i.e. the memory of the server, from where the reverse proxy provides them at access. Thereby no CDN is needed for now, and my goal is reached. 🙂

## Appendix

`compose.yml` for Cockpit CMS:

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

`compose.yml` for Node-RED:

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

---

## Navigation

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