Howdy all,
I’m switching from a shared host to Digital Ocean, but want to try the waters with the 5$ plan for a bit first.
I will just be porting over my personal portfolio/blog (PHP, AnchorCMS) so I will need the LEMP stack.
I also hav a couple of small side projects I am working on using Node.JS / MEAN stack, which I would love to host with the same 5$ droplet.
Is it possible/simple to configure both stacks to operate on the same droplet without breaking anything? Are there any guides or tutorials for this?
Thanks for any help!
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.
It should be fine to have both set ups on a single droplet. We have tutorials going through both setups:
You can either start with a fresh Ubuntu base install and follow those tutorials or start with one of the “applications” and install the other along side it.
The one thing to keep in mind is that only one process can bind to port 80 at a time. So in order to run both sites, you’ll need to set up your MEAN app to run behind an Nginx reverse proxy.
You Nginx configuration might look something like this:
A couple things to note here. This assumes the MEAN app is running on port 3000. Update that as needed. Also, the
server_name
directive is important here. It’s how Nginx know how to route requests to the correct app.Let us know how it goes!