Overview

Gatsby is an open-source framework for building websites and applications, primarily known for its capabilities as a static site generator (SSG). Developed on React, it compiles components and data into static HTML, CSS, and JavaScript files during a build process. This approach facilitates highly performant websites that can be served directly from content delivery networks (CDNs), reducing server-side processing and improving load times for end-users. Gatsby is particularly suited for projects that require rapid content delivery, strong SEO performance, and robust security by minimizing server-side vulnerabilities.

The framework utilizes GraphQL as its data layer, allowing developers to pull data from virtually any source—including Content Management Systems (CMS) like WordPress or headless CMSs such as Contentful, databases, APIs, or local files—and unify it into a single data graph. This feature simplifies content aggregation and management, making Gatsby a strong choice for sites that draw content from multiple disparate systems. Developers define their data requirements using GraphQL queries within their React components, and Gatsby fetches and optimizes this data during the build process.

While Gatsby's initial strength was purely static site generation, it has evolved to support server-side rendering (SSR) and deferred static generation (DSG) through Gatsby Cloud. These features enable the creation of more dynamic experiences and allow for faster build times on large sites by selectively rendering pages at request time or deferring non-critical page generation. This hybrid approach helps balance the benefits of static delivery with the flexibility needed for dynamic content. Gatsby is commonly adopted by web development teams familiar with the React ecosystem who prioritize site performance, maintainability, and scalable content integration for blogs, company websites, e-commerce storefronts, and web portals.

One of Gatsby's central tenets is performance optimization. It automates many best practices, such as image optimization, code splitting, and preloading resources, to ensure fast page loads out of the box. The framework generates a progressive web app (PWA) manifest by default, contributing to an enhanced user experience, especially on mobile devices. The developer experience is characterized by a component-driven architecture and a plugin ecosystem that extends functionality for data sourcing, image processing, and styling. However, developers should note that Gatsby's build process can be resource-intensive and time-consuming for very large websites with thousands of pages, a factor that influences the choice between Gatsby and other SSGs like Next.js static exports or Astro's server-side rendering.

Key features

  • React-based templating: Build user interfaces and pages using standard React components, leveraging the React ecosystem for UI development.
  • GraphQL data layer: Unified data fetching from diverse sources (CMS, APIs, databases, local files) using GraphQL queries.
  • Static Site Generation (SSG): Pre-renders entire websites to static HTML, CSS, and JavaScript at build time for optimal performance and security.
  • Image optimization: Automates responsive image generation, lazy loading, and intelligent image processing for improved visual performance.
  • Plugin ecosystem: Extensible architecture with numerous plugins for data sourcing, styling, performance optimizations, and integration with third-party services.
  • Performance optimizations: Implements web performance best practices by default, including code splitting, prefetching, and asset optimization.
  • Progressive Web App (PWA) support: Generates PWA functionality out-of-the-box, enabling offline capabilities and improved mobile user experiences.
  • Hybrid rendering modes: Supports Server-Side Rendering (SSR) and Deferred Static Generation (DSG) via Gatsby Cloud for dynamic content and faster build times on large sites.

Pricing

Gatsby Cloud offers various plans for hosting, builds, and collaboration, with the following tiers as of May 2026:

Plan Builds/Month Bandwidth/Month Price Notes
Free 100 100 GB Free Includes a single site, development builds, and basic analytics.
Professional 500 500 GB $19/month Includes multiple sites, incremental builds, and advanced analytics. Pricing scales with additional usage.
Enterprise Custom Custom Custom For large organizations requiring custom support, advanced features, and dedicated resources.

For detailed and up-to-date pricing information, refer to the official Gatsby Cloud pricing page.

Common integrations

  • Headless CMS: Integrates with platforms like Contentful, Sanity, DatoCMS, and Strapi for content management. See Gatsby's CMS integration guide.
  • WordPress: Connects to WordPress installations via the gatsby-source-wordpress plugin, allowing WordPress to act as a headless CMS. Refer to the Gatsby WordPress source plugin documentation.
  • E-commerce platforms: Integrates with platforms such as Shopify, BigCommerce, and Stripe for building e-commerce storefronts. Explore Gatsby e-commerce solutions.
  • Styling frameworks: Compatible with CSS-in-JS libraries (e.g., Emotion, Styled Components), utility-first CSS frameworks (e.g., Tailwind CSS), and traditional CSS preprocessors (e.g., Sass). View Gatsby styling recommendations.
  • Authentication services: Can integrate with services like Auth0, Clerk, or custom authentication backends using client-side JavaScript.
  • Databases and APIs: Connects to various databases or custom APIs via source plugins to fetch data into the GraphQL layer.

Alternatives

  • Next.js: A React framework offering static site generation, server-side rendering, and client-side rendering, often used for hybrid applications.
  • Hugo: A fast, Go-based static site generator known for its quick build times and simplicity, often chosen for blogs and documentation sites.
  • Astro: A modern static site builder that ships less JavaScript by default, supporting various UI frameworks and focusing on content-driven websites.
  • SvelteKit: A Svelte-based framework for building web applications, supporting static site generation, server-side rendering, and client-side rendering.
  • Remix: A full-stack web framework built on web standards, offering nested routing, server-side rendering, and client-side rendering.

Getting started

To begin a new Gatsby project, ensure you have Node.js and npm (or Yarn) installed. The Gatsby CLI (Command Line Interface) is the primary tool for scaffolding projects. First, install the CLI globally:

npm install -g gatsby-cli

Then, create a new Gatsby site using the CLI and navigate into its directory:

gatsby new my-first-gatsby-site
cd my-first-gatsby-site

The gatsby new command scaffolds a basic Gatsby project structure with a default starter. Once the project is created, you can start the development server:

gatsby develop

This command compiles your site and makes it accessible in your browser, typically at http://localhost:8000. The development server includes hot-reloading, meaning changes to your code will automatically update in the browser without requiring a manual refresh. You can then begin modifying the React components in the src/pages directory to create your site's content and structure, leveraging Gatsby's GraphQL data layer to pull in relevant information from various sources as needed. For more detailed instructions, consult the Gatsby Quick Start guide.