Search code examples
node.jsdnsdigital-oceannamecheap

Namecheap domain name for DigitalOcean


Beginner question here. I tried plenty of tutorials but I cannot seem to get the domain name up.

Basically, I deployed my node app on DigitalOcean and the link works (I use the port 5000 jic). These are the steps I took from there:

  1. Set up a domain on DigitalOcean.
  2. Copied the 3 DNS links (ns3.digitalocean.com) to namecheap on custom DNS.
  3. Create a new record on DigitalOcean with the IP of my project (without port as thats not accepted).

I can now access the website using the domain name but I need to put the port number as well, ie. mylink.com:5000

How do I avoid that or can someone explain me the right steps to link my namecheap domain with my digitalocean node app? This is my first time doing this.


Solution

  • Basically you cannot, you should either use port 80 for HTTP, or port 443 for HTTPS so the URL won't need a port (it defaults to them automatically) or you will have to use reverse-proxy (e.g. nginx) if you have to keep your port 5000.