How to set up a new Gatsby site

Posted by Cesare Ferrari

Holding a turn of the century coffee cup

Photo by Cathal Mac an Bheatha on Unsplash

This post explains how to set up a new Gatsby site.

Install Gatsby cli

Make sure gatsby-cli is installed.

Try the following command to verify the tool is installed:

gatsby --help

If it's not installed, you can issue this command to get the cli tool ready (you might have to use sudo):

npm install -g gatsby-cli

Create the new site

To create a new Gatsby site, issue this command:

gatsby new <site-name>


A new site can be created from a starter (an existing skeleton site). Available starters are listed here.

If you don't specify a starter, Gatsby will use the default starter.

Start development site

When the project is created, cd into the project directory and start the site with this command:

gatsby develop

The site will be available locally at: http://localhost:8000

← back to all posts