Skip to content

Contentful Wasting your Time? Try Cockpit

Posted in Server

So I tried to get up and running with Contentful recently, and oh what a nightmare. Created my space, the content type. The content model and content. Now time to consume? Well not quite. Couldn’t consume the way I wanted. Switched to Cockpit, and was up and running in less than 15 minutes. Here’s how to get up and running with Cockpit seamlessly.

After a month with Contentful

My problem with Contentful was simple. I’ve created many entries to a content type. I want to retrieve all the entries of the content type.

Is this supposed to be what does the job?

the cdaClient is imported from

From the docs, at least that’s how I understood it, except the above was retrieving every single content of a space for me. I’m probably doing something wrong, however, that’s as a result of how ambiguous their documentation is.

Or perhaps, I might be the dumb guy. Whatever the case, dumb guys use dumb tools, right?

I tried wrapping my head around Contentful within about a month timeframe. I would come back again and again to Contentful, re-read the docs, to see if I wasn’t missing anything.

Nothing fruitful.

Let’s see how Cockpit fit right into my needs and made my life easier.

My Needs

In building PackageToMe, I wanted a simple, really simple CMS, sitting outside the application, which I could even use for static parts of the site, like the TOC, About and Safety pages.

PackageToMe uses the MEAN stack, thus storing such content in MongoDB is possible. However, I wanted something seamless, not sitting with the actual application, that I could go in swiftly to make changes to static content as and when needed, without having to rebuild the frontend part, or spin up collections in MongoDB which would come with its related authentication etc.

In addition, I wanted a central API CMS I could use for other sites of mine, and not necessarily tied to a specific website.

And oh, had support for Markdown too.

Setting up Cockpit

The above can be your nginx conf for proxying Cockpit.

And your /etc/nginx/snippets/wordpress.conf could look like this:

Why is it called wordpress.conf? Well because it’s the same configuration file I’m using for the WordPress setups that are being used for the Cockpit. Really?

Yeah, Cockpit is PHP, for the most part.

Then download Cockpit, extract and relocate folder to somewhere of your choice.

  • Download: wget https://github.com/agentejo/cockpit/archive/master.zip
  • Extract: unzip cockpit-master
  • Copy: cp cockpit-master/* /var/www/cockpit (assuming /var/www/cockpit already exists)
  • Then make sure that the storage folder , and all of its subfolders have write-access permission.

If all checks out, reload nginx service nginx reload and point to cockpit.example.co/installto install and then off your go.

Here’s mine in action after installation:

Lemme know how your setup goes in the comments below, and have fun.

Contentful is overkill for what it’s probably intended to do. Too many moving parts. If you need something basic but functional, Cockpit might be for you, just like it is for me.

See you in the next one.