Deploying Next.js to cPanel
Deploying Next.js to cPanel isn’t straightforward. Most guides assume Vercel or a VPS, but shared hosting is still very common, and yes, it can work.
Here’s what I learned doing it the hard way.
Check Node.js Support
Before anything else, make sure your cPanel has “Setup Node.js App”.
If Node.js isn’t enabled, Next.js will not run.
No workaround. No magic.
This single check saves hours.
How I Made It Work
The key idea is simple:
Next.js must run as a server, not static files
cPanel needs a standalone Node.js build
Deployment must copy only production ready files
Once I treated Next.js like a normal Node app instead of a frontend project, things started to make sense.
The Biggest Gotchas
These were the issues that blocked me the longest:
Default
index.htmlfiles can silently block your appcPanel expects a custom server entry point
You must deploy only what the server needs not the entire repo
None of these errors are obvious, and most tutorials skip them.