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 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