Quick Start
This quick start is intended for intermediate to advanced developers. For a gentler intro to Gatsby, head to our tutorial!
Use the Gatsby CLI
Video hosted on egghead.io.
Install the Gatsby CLI.
npm install -g gatsby-cliCreate a new site.
gatsby new gatsby-siteChange directories into site folder.
cd gatsby-siteStart development server.
gatsby developGatsby will start a hot-reloading development environment accessible by default at localhost:8000.
Try editing the JavaScript pages in src/pages. Saved changes will live reload in the browser.
Create a production build.
gatsby buildGatsby will perform an optimized production build for your site, generating static HTML and per-route JavaScript code bundles.
Serve the production build locally.
gatsby serveGatsby starts a local HTML server for testing your built site. Remember to build your site using gatsby build before using this command.
Access documentation for CLI commands.
To see detailed documentation for the CLI commands, run gatsby --help in the terminal.
For specific commands, run gatsby COMMAND_NAME --help e.g. gatsby new --help.
Edit this page on GitHub