Skip to content
Herby Design

How to export Next.js into HTML

Step 1: Add the “export” script Open your package.json and add this inside the “scripts” section: jsonCopyEdit”scripts”: { “dev”: “next dev”, “build”: “next build”, “start”: “next start”, “export”: “next build && next export” } ✅ This make...

H Hernan MalubayWeb Developer 1 min read Updated Nov 9, 2026 Share
Instructions for exporting a Next.js app as static HTML files

Step 1: Add the “export” script

Open your package.json and add this inside the "scripts" section:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start",
  "export": "next build && next export"
}

✅ This makes sure “export” is recognized.


🚀 Step 2: Run the Export Command

After adding the script, run:

npm run export

This will generate an out/ folder with static HTML files.


🚀 Step 3: Upload to Server

Move the contents of the out/ folder to:

/home/u000000000000/domains/public_html/foldername/

Now your Next.js app is a fully static HTML site on Web Server! 🎉


🔎 Still Not Working?

  • Run npm run to check available scripts.
  • Ensure your next.config.js has:
    module.exports = { output: "export", trailingSlash: true, };
  • Try running:
    rm -rf .next
    npm run build
    npm run export

Let me know if you need more help! 🚀 #NextReactDeveloper #NextJs #WebDeveloper

Found this helpful? Share it

How to export Next.js into HTML — step 1: Add the “export” script Open your package.json and add this inside the “scripts” section: jsonCopyEdit”scripts”:…#ProgrammingTips #WebDevelopment #HerbyDesign

Need help with your website?

I build fast, SEO-ready websites and web applications.

Discuss your project
Business and Online Solutions 7 min read

Affordable Web Developer in Cebu City: Hiring Guide

Compare Cebu City web developer quotes, understand project scope and ongoing costs, and hire with confidence using this practical checklist.

Read article