What is the best environment setup for a Node.js web app working with a MySQL server?

January 24, 2017 254 views
Node.js MySQL One-Click Install Apps Ubuntu

I want to deploy a Node web app (with Express) to a droplet. I've used MySQL for database management on my local machine.

I also have Cron running PHP scripts which scrape an external website for data, and insert this data into the database.

What would be the best way to get this live?

Could I setup a one-click Node.js app, then install the MySQL server and Cron, and migrate the PHP scripts and the cronjob to this droplet?

1 Answer


You can install the one-click NodeJS image to a Droplet and then proceed to install MySQL and PHP using the package manager provided by Ubuntu, yes. You'll still be provided with root access to the Droplet, so you could install other packages as well, if needed.

If you're only running PHP scripts from CRON you'd at least need PHP's CLI package, though if you want to run PHP scripts from the web browser at any point, I'd recommend also installing NGINX and using PHP-FPM. You would then setup NGINX as a reverse proxy and it would handle proxying to both PHP and your NodeJS application(s).

Have another answer? Share your knowledge.