Question

How to access Node.JS project locally?

I have a node.js project running on the ubuntu server.—> App is listening on 5000.

So, I want to access it locally. Like http://server_ip:5000

How can I do this?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi, I have no idea how to access node.js app locally using console and being satisfied of what you get, at the same time. It is your decision if your node.js is front-end or back-end environment. You can access it from outside when you configure it as front-end environment. That means, your app must listen on your droplet’s public IP. You can check what ip addresses your app listens on.

sudo netstat -tulpn

If you get one out of the lines below, your app can be reachable from the Internet.

Proto       Local Address                  State         
tcp         0 0.0.0.0:5000                 LISTEN
tcp         your_droplet_public_ip:5000    LISTEN        

In addition, if you have any firewall installed, you need to configure it to allow connections on specific port (TCP 5000, in your case).