How to host nextjs app on cyberpanel

I have a Next-JS App i have created and want to host it on my CyberPanel Server.

I need help please. how can install and run pm2

Hello @MultiMaN95

To deploy a static build / Single-Page Application (SPA) just add it like any normal html website. It will run. Just like gatsbyjs

No need for nodejs.

ok will try it out. thanks

I was deploy NextJS App with PM2 on Cyberpanel.

This what i am doing…

  1. Login to LiteSpeed WebAdmin Console.
  2. Select Virtual Host and Choose domain name.
  3. Select External App, add new.
  4. Choose Web Server then Next.
  5. Set Name.
  6. Set Address : localhost:port example: localhost:3001
  7. Fill other required field then save.
  8. Graceful Restart.
  9. Select Context menu, add new.
  10. Type : Proxy
  11. URI: /
  12. Web Server: Select that web server create before then save and Graceful Restart
  13. Clone App from github, cd to folder, npm install, npm run build
  14. Set PM2, i am usually using : pm2 start npm --watch --name "nextapp" -- run start -- -p 3001

That’s it…

2 Likes

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.