Yes, but for production or to development? If is for development try things like Vagrant or Docker for not pollute all your local environment and to keep things easy :)
I vote for docker because is super easy and fast to configure all the services you need.