How I can run a coder-server instance and test a express.js app in the same droplet?

October 25, 2019 2k views
Initial Server Setup Development Node.js

Hi, I’ve deployed a coder-server instance in a droplet, this is in my opinion the best way to have an cloud-based dev environment cause we can run VSCode on the web, everything ok whit coder-server.

My problem comes when I try to run a sample-app whit node and express, the app runs on port 3000 ok apparently, but seems that the droplet doesn’t have open that port and in consequence the browser can’t reach the express.js server.

Can somebody please help me to solve this situation?

Thanks.

1 Answer

Hello,

As the coder-server image from the marketplace uses Ubuntu, you could try opening port 3000 through the default Ubuntu firewall. First check if the firewall is active:

sudo ufw status

If the firewall is active, then you can open the port with:

sudo ufw allow 3000

For more information, you could take a look at this article here:

https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands

Hope that this helps!
Regards,
Bobby

by Mitchell Anicas
UFW is a firewall configuration tool for iptables that is included with Ubuntu by default. This cheat sheet-style guide provides a quick reference to UFW commands that will create iptables firewall rules are useful in common, everyday scenarios. This includes UFW examples of allowing and blocking various services by port, network interface, and source IP address.
Have another answer? Share your knowledge.