NextJS, how to upload a server-side rendered application to my FTP account

1.5k Views Asked by At

I appreciate all of your help. I like how create-react-app allows you to run NPM RUN BUILD and then upload the "Build" folder to your FTP directory.

How is this possible with NextJS? I built my app and ran NPM RUN BUILD, but do not see a Build folder. I am using server-side rendering with getServerSideProps, so is there a web page that explains this? I read the Deployment web page on NextJS.org, but I do not want to use their servers.

Thank you again for your help.

Bruce

1

There are 1 best solutions below

0
On

You need to setup a custom Node.js server if you don't want to use Vercel. Your package.json should contain these scripts:

{
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  }
}

From the docs:

next build builds the production application in the .next folder. After building, next start starts a Node.js server that supports hybrid pages, serving both statically generated and server-side rendered pages.

As you can see, you get .next instead of a build folder.