Welcome to the Gatsby Tutorial! We’re excited you’re here.
Before you start building your first Gatsby site, you’ll need to familiarize yourself with some core web technologies and make sure that you have installed all required software tools.
By the end of this part of the Tutorial, you will:
The Tutorial is intended to be as approachable as possible for people who are new to Gatsby and React. With that said, if you are brand new to web development (welcome!), you might find it helpful to learn some fundamentals first.
Don't worry, you don't need to be an expert with these! A high-level understanding of the basics should be enough. You'll pick up a lot through the course of the Tutorial.
.map()
.node --version
, but not every highlighted box is a command! If something is a command it will be mentioned as something you have to run/execute.In addition to the ones listed above, Gatsby uses a few more technologies under the hood. The Tutorial will teach you everything you need to know about the following tools. But if you’re interested in getting a head start, here’s a bit more information:
The rest of this part of the Tutorial walks you through how to install the following tools:
Node.js is an environment that can run JavaScript code outside of a web browser. Gatsby is built with Node.js. To get up and running with Gatsby, you’ll need to have Node.js version 18 (or newer, but less than v21) installed on your computer.
npm is a package manager that comes bundled with Node.js. You’ll use the npm command line interface to add packages to your site (like Gatsby plugins) and to run command line tasks (like starting up your site).
Follow the installation instructions below, based on your computer’s operating system. (Click the header to expand the section.)
Mac instructionsTo install Gatsby and Node.js on a Mac, it is recommended to use Homebrew. A little set-up in the beginning can save you from some headaches later on!
How to install or verify Homebrew on your computer:If that fails, download it directly from Apple’s site, after signing-in with an Apple developer account.
If you don’t want to install it through Homebrew, download the latest Node.js version from the official Node.js website, double click on the downloaded file and go through the installation process.
Windows instructionsDownload and install the latest Node.js version from the official Node.js website
Linux instructionsInstall nvm (Node Version Manager) and needed dependencies. nvm is used to manage Node.js and all its associated versions.
When installing a package, if it asks for confirmation, type y
and press enter.
Select your distro:
If the Linux distribution you are using is not listed here, please find instructions on the web.
Ubuntu, Debian, and otherapt
based distros:
source ~/.bashrc
.)pacman
based distros:
dnf
based distros:
When nvm is installed, it does not default to a particular node version. You’ll need to install the version you want and give nvm instructions to use it. This example uses the version 16 release, but more recent version numbers can be used instead.
Confirm that this worked. The output should be a version number.
Once you have followed the installation steps and you have checked everything is installed properly, you can continue to the next step.
GitGit is a free and open source distributed version control system. It’s a tool that helps you save different versions of your code. It also helps teammates work together on the same codebase at the same time.
When you create a new Gatsby site, Gatsby uses Git behind the scenes to download and install the required files for your new site. You will also use Git to push your code to the cloud, so that you can deploy your site on the internet for others to see.
The steps to download and install Git depend on your operating system. Follow the guide for your system:
Gatsby CLIThe Gatsby command line interface (CLI) is a tool that lets you quickly create new Gatsby-powered sites and run commands for developing Gatsby sites.
The CLI is a published npm package, which means you can install it using npm.
Install the Gatsby CLI globally by running the command below. (Have an older version of the Gatsby CLI installed? This command will also update you to the latest version.)
Note: When you install Gatsby and run it for the first time, you’ll see a short message notifying you about anonymous usage data that is being collected for Gatsby commands. You can read more about how that data is pulled out and used in the telemetry doc.
Check that you have the correct version installed by running the command below. You should be on v3 or newer.
See the available commands:
Visual Studio CodeVisual Studio Code (also called VS Code, for short) is a popular code editor that you can use to write code for your project. If you don’t have a preferred code editor yet, visit the VS Code site and download the version appropriate for your platform.
It doesn’t matter what code editor you choose to use. Your site will end up looking the same, no matter what tool you use to write it. But the Gatsby documentation sometimes includes screenshots that were taken in VS Code, so using VS Code will make sure that your screen looks like the screenshots in the tutorial and docs.
Account CreationThe final step in this part of the Tutorial is to create accounts for the online platforms you will need to deploy your site online for others to see.
In this Tutorial, you will deploy your site using Netlify. To use Netlify, you will need to set up a GitHub account and a Netlify account. (Both accounts are free!)
Now that you have all the knowledge and tools you’ll need, you’re ready for the Tutorial!
Share Your Feedback!
Our goal is for this Tutorial to be helpful and easy to follow. We’d love to hear your feedback about what you liked or didn’t like about this part of the Tutorial.
Use the “Was this doc helpful to you?” form at the bottom of this page to let us know what worked well and what we can improve.
What’s coming next?In Part 1 of the Tutorial, you’ll create your first Gatsby site and deploy it online for everyone to see.
Continue to Part 1Start building today on
Netlify!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4