Deploy your Next JS site to Netlify


Screenshot of Google Chrome showing a GitHub repository

As you may know, Netlify has something called continuous deployment, which lets you connect a Git repository to a Netlify site. This will update your page automatically with every push you make to that repo.

There are two ways to connect your git repo to Netlify: using the command line, or using the app UI. In this quick tutorial, I'm going to use the UI to show you how to deploy a Next JS repo.

Get into Netlify

First, you have to visit, after you are logged in you will see something like this:

Select your Git provider and repo

Then after selecting your git provider, and getting the proper authorization, you will be able to select the repo you want. In my case, I had one called "personalblog".

Put in your build commands

In the next page you could select the team, branch or even change the build command if necessary. But in my case, there was no need, as the npm run build was my default build command and I left the rest as they were.

Update your domain!

And that's it! By default, Netlify will create a random domain for you to access your site but you can always change it in the Site Settings once the deployment is finished. You could also add your own domain to the site you just deployed. For example, I already have my personal site hosted on Netlify, so I only have to add a subdomain from it and Netlify made the verification for it.