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

February 3, 2015 2.6k 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!

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.

Have another answer? Share your knowledge.