Can I install both MongoDB and MySql on the same server instance?

Posted February 3, 2015 12.5k views

I have a single server with Linux, Nginx, MySql, and PHP currently installed. It works great and I have no problems with that stack, but I’m interested in putting a NodeJS app that will use MongoDB on the same server with it. I know I’d have to install NodeJS and MongoDB in order to do this, but I’m curious if this is even possible? And if it is possible, should I do it? For reference, none of the sites on my server are doing anything really intense. All of the MySql-driven sites are WordPress, and this new NodeJS site would be a simple CMS type of site. Thanks!

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.

1 answer

Yes, you can. They system doesn’t care if you have 1, 2, or a hundred database servers. It just cares that you don’t try to run more than one on a port (3306 for MySQL, for example).

You can even run 2 or more instances of MySQL on the same server – one per port.

Submit an Answer