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 nextConfig2. Build the project
npm run build3. 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/static4. 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
- Set
output: 'standalone' - Run
npm run build - Copy
public/and.next/static/into.next/standalone - Zip the contents of
.next/standalone - Open
/dashboard/deploy - Choose the
Next.jstemplate - 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.