4

I want to deploy the nodejs files to web server, for the time being, i was run like this node server.js through command prompt. how to run the nodejs always and without command prompt. please suggest.

4
  • 1
    Which is the system operation mounthed on server? Commented Nov 17, 2016 at 10:46
  • @Filippo1980, apache cpanel Commented Nov 17, 2016 at 11:05
  • That's not an operating system, Moses, that's an application management web app that can be installed on many different operating systems. Commented Nov 17, 2016 at 11:31
  • For deploy you can use PM2, and for automatic start systemd. Commented Nov 21, 2016 at 2:19

1 Answer 1

3

To deploy node.js app, you pretty much need shell access. You have to run node.js somehow. So, typical web-host does not work, you need rights to run your own process. If you are running host yourself, then you are looking for process manager, for example supervisor or pm2.

There is some node.js hosting services too, some good ones listed here. All hosting providers give you instructions how to deploy node.js on their platform so I'm not going to cover that (some examples: Heroku, Digital Ocean). Especially Digital Ocean have a lot of good tutorials, worth of reading, even if you are using some other hosting.

That being said, are you sure you have Node.js app? Node.js is often used in client-side workflows too, so it's possible your app could be deployed using cPanel. If you are just using node.js to run webpack-dev-server, for example, changes are you have just client-side app and it can be deployed on regular http-server, like Apache. If that's the case, your build process most likely produce dist folder which contains html, css and js to upload to our server's document root.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.