Question

How do I test a site I'm developing in a droplet?

Posted October 6, 2019 507 views
DigitalOcean

I’m using ssh to access my droplet. I can pull the code and develop, but how do I view my edits from a browser? What is the equivalent to spinning up the site locally and accessing 127.0.0.1:8080?

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.

×
1 answer

Hello,

It would depend on the type of application that you are using but for example if you are developing a static HTML/CSS site, you could only install Nginx and it should all work out of the box:

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04

If you are developing a node application, you could again use Nginx but use it as a reverse proxy:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04

Then once you have this setup, you can visit your droplet’s IP in your browser and you would be able to see your app.

Hope that this helps!
Regards,
Bobby

by Brennen Bearnes
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.
Submit an Answer