Skip to main content

Strapi in a Container: Setting Up a Headless CMS on Your Lunch Break

Author
psilore
Lead developer and systems engineer. Passionate about retro computing, Linux environments, and automation frameworks.

Can you spin up a fully functioning headless CMS and configure a database in under an hour? I challenged myself to deploy Strapi.io on my lunch break, and the results were surprisingly smooth.

Strapi headless CMS banner
Strapi.io: The open-source, Javascript-based headless CMS.

The Lunch Break Challenge
#

I always love learning new things. To stretch my legs, I set a challenge: deploy a working content backend during a single lunch break.

Initially, I had built a simple Progressive Web App (PWA) called Swallow (you can view the concept archives at https://afterburner.io/projects/swallow/) utilizing a small, static dataset. I wanted to expand it and write a custom REST API from scratch.

But little did I know, the team at Strapi.io had already built an awesome, open-source headless CMS. I decided to skip the custom API coding for a moment and give Strapi a shot.

Spoiler: It is incredibly simple.


Quick-Start Checklist
#

Here is the high-level roadmap to get Strapi running inside a container:

1. Setup Docker
Configure your target VPS or local machine with Docker and Docker Compose.
2. Configure the Strapi Image
Set up your container configuration, environment variables, and mount storage volumes.
3. Launch and Develop
Spin up the container stack, define your content schema, and start query endpoints immediately.

Getting It Done
#

I headed over to the official Strapi Quick Start Documentation to grab the latest docker-compose configurations.

Exactly 38 minutes later, the container was running, the admin profile was created, and I was successfully fetching JSON content from my REST endpoints. Profit!


What’s your headless CMS choice?
#

Have you played around with Strapi, or do you prefer other headless options like Contentful, Sanity, or Decap CMS? Let me know in the comments below!