Upload Project Files #
- Log in to cPanel → File Manager.
- Go to your subdomain folder (e.g.
/home/username/admin). - Upload your project ZIP file (
BravoMart-Admin.zip). - Extract it inside the folder.
- Ensure files are directly inside the folder (not nested in another directory).
Create Environment File #
- In File Manager, duplicate
.env.example→ rename to.env.production. - Edit
.env.productionand set your API URL:
NEXT_PUBLIC_API_URL=https://api.yourdomain.com/api
Install Dependencies #
- Go to cPanel → Terminal or Application Manager → Run Script.
- Inside your project folder, run:
npm install
Build the Project #
Still in Terminal or Application Manager, run:
npm run build
This will generate the production files inside the .next folder.
Start the Application in cPanel #
- Go to cPanel → Setup Node.js App (Application Manager).
- Create a new app:
- Node.js version: Use LTS version (18 or 20)
- Application mode: Production
- Application root: Path to your project folder (e.g.,
/home/username/admin) - Application startup file:
npm startor select the script from the dropdown
- Click Create Application and then Run NPM Install (if not already done).
- Start the app from the Application Manager panel.
Verify the Installation #
Visit your subdomain:
https://admin.yourdomain.com
You should now see the BravoMart Next.js Admin Panel running in production.