Introduction
In this step-by-step tutorial, we will setup strapi headless CMS
Some of the advantages of using Strapi:
- You can define a content type and many custom fields.
- You get ready-made REST APIs for all those content types
- Every data is available through REST APIs
- All basic CRUD operations are available to you by just defining a content type.
- And the most important step is the security. It provides authentication layer build-in. You don’t have to worry about writing code for authentication.
Lets start.
Pre-requisites
You need to have following installed:
- node.js
- docker
First run MongoDB
I will use docker for running MongoDB, and use following docker-compose.yml file
version: '3.3'
services:
mongodb:
image: mongo:4
ports:
- "27017:27017"
volumes:
- ./mongo:/data/dbAnd, run mongodb by following command:
docker-compose up -dInstall Strapi with Mongodb
Lets create a Strapi project, and call it api
npx create-strapi-app apiFollowing are the screenshots for next steps, (choosing mongodb installation and others).
Choose your installation type: Custom
Choose Mongodb
Mongodb Configuration
Run Strapi Project in Development mode
npm run developIt will run the server on http://localhost:1337/
Open it in your browser.
Register yourself as admin.
Once you open the url: http://localhost:1337/, you will see admin panel. Now you can configure your backend, and can create new content types.













