Build your first Gatsby site
Last updated
Was this helpful?
Last updated
Was this helpful?
To get started on your first Gatsby site you need to be somewhat comfortable using the command line and have Node and Git installed. The Gatsby CLI tool lets you quickly create new Gatsby-powered sites and run commands for developing Gatsby sites. It is a published npm package.
The Gatsby CLI is available via npm and should be installed globally by running
To see the commands available to you with the Gatsby CLI, run gatsby --help
Now you are ready to use the Gatsby CLI tool to create your first Gatsby site. Using the tool, you can download what are called “” (out of the box partially built sites with some default configuration) to help you get moving faster on creating a certain type of site. The you’ll be using here is a starter with the bare essentials needed for a Gatsby site.
Install this starter anywhere in your file system by running the following in your command line:
Then navigate into the newly created directory
And finally running the develop command to fire up your new gatsby site
Open up a new tab in your browser and navigate to .
BAM! You’ve just created your first Gatsby site! 🌮
To build a production-ready build you can run
Gatsby will perform an optimized production build for your site, generating static HTML and per-route JavaScript code bundles.
If you would like to see a replica of the production site running locally, run
Gatsby starts a local HTML server for testing your built site. Remember to build your site using gatsby build
before using this command.