'What is required to deploy Next.js without Vercel?
I need to deploy a Next.js app, but not on Vercel. What are the steps to deploying it?
I used to drag and drop the build folder from React to the server, but in Next.js I don't know which files I should deploy and how.
NB: I am using getServerSideProps so next export will not work.
Solution 1:[1]
A node environment where you can use next start is required. Therefore, you can use any platforms that offer servers, such as EC2, Digital Ocean, Linode, etc.
Solution 2:[2]
Because I need to deploy on a variety of servers and platforms, not all of which desire to have an additional node express server running, I have transitioned to Gatsby.js entirely. Same static page delivery as Next.js but no need for node or express on the server. Drag and drop the build folder into any server folder - just like React.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | paulogdm |
| Solution 2 | Martin Dwyer |
