How do I change the port in Next.js

July 27, 2022

Add the following to your projects package.json.

next dev -p 3001
{
  "dev": "next dev -p 3001",
  "build": "next build",
  "start": "next start",
  "lint": "next lint"
}

Profile picture

Written by Matthew Shirtliffe Software Engineer & Co-founder of Studio 200 You can follow them on Twitter