Documentation
v1
Frontend
Next.js

Deploy Next.js

Use the Next.js template in the dashboard when your app is packaged as a standalone Next.js build.

This guide is for full Next.js app uploads. If your project is mostly API routes or route handlers, see Deploy Next.js API.

1. Enable standalone output

Configure your app so the build writes a standalone server bundle:

/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'standalone',
}
 
export default nextConfig

2. Build the project

npm run build

3. Copy runtime assets into the standalone folder

Next.js expects public/ and .next/static/ to be available alongside the standalone server files:

cp -R public .next/standalone/public
mkdir -p .next/standalone/.next
cp -R .next/static .next/standalone/.next/static

4. Zip the standalone root

cd .next/standalone
zip -r ../../nextjs-app.zip .

Upload nextjs-app.zip with the Next.js template in /dashboard/deploy.

Expected archive root

After unzip, the archive should contain the standalone server root itself, for example:

server.js
package.json
public/...
.next/static/...

Dashboard flow

  1. Set output: 'standalone'
  2. Run npm run build
  3. Copy public/ and .next/static/ into .next/standalone
  4. Zip the contents of .next/standalone
  5. Open /dashboard/deploy
  6. Choose the Next.js template
  7. Upload the archive and pick a subdomain

Best fit

Use the Next.js template for:

  • full Next.js applications
  • SSR pages
  • server components
  • frontend apps that still need the Next runtime

When to use a tunnel instead

Use a normal Mekong tunnel when:

  • you are still developing locally with HMR
  • you want your local dev server exposed directly
  • you need live debugging against your own machine

For development-focused setup, see the Next.js tunnel guide.