Get started with Contentful

Create a space, add sample content, and deploy a Gatsby site in minutes, all through the Gatsby CLI. See how Contentful works with the latest web technologies to power content.

Learn about the site your are creating below, or get started right away in the CLI

See how Contentful works with Gatsby and the latest web technologies

The sample blog in the Contentful guide is a static site built with Gatsby.js and can be deployed to any static site hosting provider.

Gatsby starter tech stack

Explore how the sample website is built with Contentful

The content of the site is structured so that it is easy to reuse, and can work with any layout you can dream up.

Contentful data flow

Ready to start? Set-up and deploy a website through the Gatsby CLI

Install the Gatsby CLI tool

Install the Gatsby CLI tool by running npm install -g gatsby-cli.

Steps that the guide will take you through:

Install the Gatsby CLI tool

Installing the Gatsby CLI tool will enable you to run the required commands to get started.

Run the starter command to prepare a local directory

The second step create a local directory with a code base ready to use with Gatsby.

Create your Content model and first entries

The third step asks for credentials and sets up your content model which is the structure for your content and populates your newly created space with content entries and assets. This step uses the Content Management API.

Run the website in development mode on your machine

The last step runs the app, which is now set up to pull content from your newly created space! This step uses the Content Delivery API.

Develop the Starter Gatsby Blog

You are now done creating your own Contentful-powered website! New builds of the site will pull the most recent state of your content from Contentful. Now, it's time to develop it! Select your preferred hosting service to see the CLI deployment commands.

Gatsby CLI Commands

  1. Install the Gatsby CLI tool

    npm install -g gatsby-cli
  2.  gatsby new contentful-starter https://github.com/contentful/starter-gatsby-blog
  3.  cd contentful-starter
     npm run setup
  4. npm run dev

Deploy with NetlifyView deployment instructions for Heroku

Gatsby integrates easily with Netlify and can be deployed from the command line by running these commands.

  1. npm run netlify:login
  2. npm run netlify:deploy

Next steps

Congratulations! You've completed the Contentful guide. Keep exploring below: