Local development with Netlify CLI
The Netlify CLI brings the functionality of your Netlify production environment directly to your local machine through the dev command. This CLI functionality is also referred to as Netlify Dev.
When you use Netlify Dev, the CLI provides a proxy server that includes edge logic for custom headers and redirects, environment variables, and Netlify Functions. It automatically detects tools and frameworks like Gatsby, Hugo, Eleventy, Next.js, and more to configure a local development server that mimics the Netlify production environment.
The sections below describe how to get started with Netlify Dev, how project detection and ports work, and how to customize the configuration.
You can also access the command reference for dev for more information.
Get started with Netlify Dev
Section titled “Get started with Netlify Dev”Before you begin, make sure you complete the following if you haven’t already:
- Install the Netlify CLI.
- Authenticate with an access token.
- Link your local project to a Netlify
siteID(also called Project ID in the Netlify UI). To do this, set up continuous deployment withnetlify initor link an existing Netlify site withnetlify link.
To start a local development server for the build tool you’re using, run the following command from the root of your linked repository: