Stop Overpaying for Hosting — Deploy Your Next.js App on cPanel for Next to Nothing
A no-nonsense, step-by-step walkthrough to get your Next.js 15/16 project running on cheap shared/cloud cPanel hosting — without needing Vercel, Railway, or any expensive platform.
Topics
Deploying a Next.js app doesn't always mean shelling out for Vercel's Pro plan or a costly VPS. If you already have cPanel-based shared or cloud hosting, you can serve a full Next.js application — server-side rendering and all — with zero extra infrastructure cost. This guide walks you through every step: from zipping your project correctly to running pnpm build inside the terminal and restarting your Node.js app.
Step 1 — Create a Clean Archive of Your Project
Before uploading anything, you need to create a ZIP archive of your project — but carefully excluding heavy and environment-specific folders that should not be uploaded.
Exclude the following from your ZIP:
- ✕node_modules/ — these will be reinstalled on the server
- ✕.next/ — the build output will be generated on the server
- ✕.git/ — version control data is not needed
- ✕Any other dot files like .env.local if you plan to set env vars via cPanel (recommended)
On most systems you can right-click and compress, or via terminal:
Step 2 — Set Up Node.js App in cPanel
Log into cPanel and locate the Setup Node.js App section (usually under the Software category). Click Create Application and fill in the following:
- 1 Node.js version — Match this exactly to the version defined in your package.json under engines.node, or whatever version you developed with locally. Mismatched versions cause subtle runtime failures.
- 2 Application mode — Set to PRODUCTION for live sites. Use DEVELOPMENT only for testing (it enables verbose error pages).
- 3 Application root — The folder path where your project lives (e.g. my-next-app/).
- 4 Application URL — The domain or subdomain to serve the app on.
- 5 Application startup file — Set this to server.js (or app.js — whichever you create in the next step).
Step 3 — Add Environment Variables
Still inside the Node.js app setup, scroll down to the Environment Variables section and add:
You can also add any other environment variables your app needs here (database URLs, API keys, etc.) instead of keeping them in a .env file. This is the more secure and recommended approach on shared hosting.
Step 4 — Create Your Custom Startup File
Next.js on cPanel doesn't use next start directly — you need a custom Node.js HTTP server that boots Next and handles requests. Create a file called server.js (or app.js) in the root of your project with the following code:
Step 5 — Upload Your ZIP and Extract It
Go to cPanel's File Manager and navigate to the application root folder you configured in Step 2. Upload your ZIP file there, then right-click it and select Extract. Make sure all files land directly in the app root — not nested inside an extra subfolder.
Step 6 — Copy the Virtual Environment Path
Back in Setup Node.js App, find your app entry and look for the virtual environment path — it looks something like:
Copy this path. You'll need it in the terminal to activate the correct Node.js environment before running any commands.
Step 7 — Open cPanel Terminal and Install Dependencies
Find Terminal in cPanel (under Advanced). Once inside, activate the virtual environment, then navigate to your project:
Now install pnpm globally using npm:
Then clean up any accidental leftover folders, just to be safe:
Install your project dependencies:
Step 8 — Build Your Next.js App
With dependencies installed, run the production build. This generates the optimized .next/ folder that your server will serve.
The build process will compile pages, optimize images, generate static assets, and output everything into .next/. This can take anywhere from 30 seconds to a few minutes depending on project size and server resources.
Step 9 — Restart the Node.js App
After a successful build, go back to Setup Node.js App in cPanel and click Restart on your application. This tells cPanel's passenger process manager to pick up the new build and start serving your app.
Quick Reference — Full Command Sequence
That's it — your Next.js 16 app is live on budget cPanel cloud hosting, no Vercel required. The same workflow works for any Next.js version 13 and above using the App Router or Pages Router.
Discussion
Comments
0 comments
Loading comments...
Recommended Blogs
Continue Reading
18 May 2026
The Meta AI incognito chat will blow your mind
The Meta AI incognito chat is allowing people to privately.....
17 May 2026
Why Everyone Suddenly Wont Shut Up About ASML 🔬
ASML doesn't make AI. It makes the machines that make AI possible — and that's...
12 May 2026
iOS 26.5: Apples New Features… and Their Secret Master Plan
Apple's iOS 26.5 is here with RCS upgrades, smarter Maps, and AI features — but...
Stay Connected
Follow and Explore More
Watch more on YouTube, explore the rest of the brand, and jump back to the homepage to discover ideas, projects, and more.
Sign in with Google to join the discussion.