Is it possible to run a PHP website and a Node.js app on the same server?

I have some old websites that are either running on Wordpress or otherwise using PHP that I would like to start migrating over to DigitalOcean soon. I would like to run this on a LEMP stack. I will also be building some Node.js apps in the near future.

I am coming from shared hosting so I am still learning how to manage my own server. Is it possible to run both my PHP websites and Node.js apps on the same server or would they need to be separate? If it is possible, can someone point me in the right direction on how it would be done?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You can use a frontend proxy, like haproxy or nginx or (if you prefer to change stuff on the fly) use Dotcloud Hipache. Then you run multiple webservers on multiple ports and do name-based virtual hosts ( is on one webserver and on the other).

I’d sure love to know how to setup NodeJS and SocketIO along with a default LEMP install.

I would really like to know this as well.