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

Posted January 24, 2017 3.5k views
UbuntuMySQLNode.jsDigitalOcean 1-Click Apps Marketplace

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?

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.

Submit an Answer
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).