Stormkit LogoStormkit Logo WhiteStormkit

Deploying Next.js websites

Next.js is a framework written for React applications which handle server side logic. You can easily host your Next.js applications on Stormkit.

To host your app simply go to your application's build config. Click on My application > My environment > Edit and specify the following fields in your build configuration:
ServerlessWhen the serverless toggle is turned on, the requests will be served from lambdas. This allows rendering your application on the server side for better SEO and performance. On the other hand, if you have a static website, you can leave the toggle off.
Build commandThe build command. For instance, npm run build.
Before deploying, we need to tell Next.js to serve the static files from our CDN and that it's serverless build. Go ahead and update the next.config.js:// Next.config.js { target: "serverless", assetPrefix: process.env.PUBLIC_PATH } And that should be it. Click deploy and have your serverless Next.js application up and running - ready to be served to millions of users.