Depending on how you build your app will determine where you can deploy to.
By default, a Next.js app has to be deployed to an environment that supports Node.js. So that's pretty much everywhere expect static hosting services like netlify (not easily anyway).
👍🏾 tip: You should deploy to vercel. Vercel literally made Next.js.
If you export your app to be pure static (no need for Node), you can deploy to static hosting services. You can use:
next export
To do that. There are some gotchas, though.
⚠️ warning: Besure to change the hardcoded API URLS in the fetch calls to use and ENV var for the live URLS.
We're going to deploy to Vercel.
It's actually pretty easy. Install the CLI
npm
npm i -g vercel
yarn
yarn global add vercel
In your project, run:
vercel
That's it! If your project is already on Github, you can deploy that way from vercel as well. Create an account and connect your Github account.