Report this

What is the reason for this report?

How to access Node.JS project locally?

Posted on September 7, 2020

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?



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!

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.

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).

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.