Install and Deploy Next.js Templates
In this part of the documentation we will show you how to install Next.js Templates.
Before moving forward, make sure you have Node.js installed on your machine. Otherwise the installation commands will not work.
If you're using Boilerplate templates, follow the Boilerplate installation guide. Otherwise you can follow the installations steps below:
1. Download template and extract it. Then CD into that directory and run this command to install the dependencies:
npm install
or
yarn install
2. After completing the installation run this command to start the developement server:
npm run dev
or
yarn dev
When this command runs successfully the template will open on localhost:3000. Now you will see all the changes you make on the browser.
Deploying to server
After the installation and customization are done you have to deploy the template. Here are the steps you need to follow to deploy the template:
Build the template locally and then deploy it to the server. Build the template using the following command, When you run this command you’ll get a build folder. Now you can upload this folder to your server and your site will be live.
npm run build
or
yarn build