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 8 min read

AI Prompts for Small Business: 7 Useful Templates

Use practical AI prompts to draft customer replies, product copy, social posts, and plans—while checking facts and protecting customer privacy.

Read article
Business and Online Solutions 7 min read

Affordable Web Developer: Compare Cebu City Quotes

Compare Cebu City web developer proposals by scope, ongoing costs, ownership, and support so you can choose a website plan that fits your budget.

Read article
Programming Tips 7 min read

Become a Web Developer: A Practical Career Plan

Learn how to become a web developer with a clear path through core skills, hands-on projects, a strong portfolio, and your first applications.

Read article