Question

how to go to localhost 3000

Posted February 10, 2021 130 views
Ubuntu 18.04VS Code

i want to check if my sever is working and i have to go to localhost 3000 to see it

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

Hi @althafnash,

If you deploying the application on a DigitalOcean droplet, you’ll need to allow port 3000 to have incoming connections first. If you are using UFW on your droplet, you can use:

sudo ufw allow 3000/tcp

If you are using IPTables, you can do the following:

sudo iptables -A INPUT -p tcp --dport 3000 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 3000 -m conntrack --ctstate ESTABLISHED -j ACCEPT

Once you know your firewall allows connections on port 3000 and you have started your application on that port, you should be able to load it with your droplet’s IP Address;

XXX.XXX.XXX.XXX:3000

Where XXX.XXX.XXX.XXX is your IP address.

Now, there is a better way to do so. You can install Nginx and use it as a reverse proxy to port 3000. That way you can add a domain and once someone loads your application on the domain it will redirect them to port 3000 behind the scenes. Here is an article on how to firstly installed Nginx:

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

Then you can see in the tutorials section a bunch of Nginx Reverse proxy guides which you can follow depending on the app you are developing.

Now, if you are developing your application locally, on your computer and you want to see your progress. You’ll need to install the thing your app is working with. Let’s say you are using Node, you’ll need node installed locally, in order to make your app work locally as well.

Regards,
KFSys

by Erin Glass
Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. In this guide, we'll discuss how to get Nginx installed on your Ubuntu 20.04 server.
Submit an Answer