UndieGravity LogoUndiegravity

Deploy HTML and Next.js Sites to Netlify

Deploy to Netlify by dragging a folder for HTML sites or connecting Git for Next.js and React. Build settings, forms without a backend, and free plan basics.

By UndieGravity, , 1 min read

Netlify hosts static sites and full framework apps, and it has the easiest deploy of all for plain HTML: drag a folder into the browser. Here is how to deploy each kind of template.

HTML template: drag and drop

  1. Sign up at netlify.com.
  2. Open the Netlify Drop page from your dashboard (Add new project, Deploy manually).
  3. Drag your template folder, the one containing index.html, onto the page.

Your site is live in seconds on a netlify.app address. To update it, drag the changed folder again. For regular updates, use Git instead (below).

React or Next.js: connect Git

  1. Push your project to GitHub, GitLab, or Bitbucket.
  2. In Netlify choose Add new project, Import an existing project and pick the repository.
  3. Check the build settings Netlify detects.
  4. Add environment variables, then deploy.

Build settings by project type

  • Vite (React): build command npm run build, publish directory dist.
  • Next.js: build command npm run build; Netlify detects Next.js and configures the rest with its adapter, which supports server rendering, route handlers, and images.
  • Static Next.js export: build command npm run build, publish directory out.

Netlify's Next.js adapter is developed in the open as part of the OpenNext project and updates automatically unless you pin a version.

Single page apps need one redirect

A React app with client-side routing returns 404 when someone refreshes on /about, because no about.html exists. Add a _redirects file to the publish folder:

/*    /index.html   200

Contact forms without a backend

Netlify Forms collects submissions from plain HTML forms. Add a data-netlify="true" attribute and a name, and submissions appear in your Netlify dashboard.

<form name="contact" method="POST" data-netlify="true">
  <input type="hidden" name="form-name" value="contact">
  <label>Email <input type="email" name="email" required></label>
  <label>Message <textarea name="message" required></textarea></label>
  <button type="submit">Send</button>
</form>

Free plan basics

Netlify's free plan uses a monthly credit allowance shared by builds, bandwidth, and other features, and it allows commercial sites. When the credits run out, projects pause until the next cycle rather than charging you. Check Netlify's pricing page for the current numbers.

Keep reading

Deployment

Deploy a Next.js Site to Vercel in 10 Minutes

Step by step: push your Next.js project to GitHub, import it into Vercel, add environment variables, connect a custom domain, and know the Hobby plan limits.

, 2 min read

Deployment

Host an HTML Website for Free on GitHub Pages

Publish an HTML template on GitHub Pages for free: create a repository, turn on Pages, add a custom domain with HTTPS, and know the size and usage limits.

, 1 min read