How to connect a custom domain to a Node.js application

Connect your own domain name to your Node.js application deployed on Hostinger

Updated 6 days ago

If you deployed your Node.js application using a temporary domain, you can connect your own custom domain at any time. Connecting a custom domain makes your application accessible through a domain name you own.

You can start the domain connection process from two locations in Hostinger dashboard:

  • Websites list

  • Website Dashboard of the Node.js application

Option 1 — Connect a domain from the Websites list

  1. Log in to Hostinger dashboard.

  2. Open the Websites list.

  3. Locate your Node.js application using a temporary domain.

  4. Hover over the website, click the options button (⋮), and select Connect domain.

You will be redirected to the domain connection flow.

Option 2 — Connect a domain from the Website Dashboard

  1. Open the Website Dashboard for your Node.js application.

  2. Click Connect domain.

This will open the domain connection page.

How to connect your custom domain

Once you start the domain connection flow:

  1. Enter the custom domain you want to use (for example, domain.com ).

  2. Confirm the domain selection.

  3. Follow any on-screen instructions if DNS changes are required.

    Hostinger site setup asks for a domain name, with the domain input field highlighted by an arrow

Domain connection and SSL

Domain connection may take up to 24 hours, depending on DNS propagation. Once the process is completed:

  • Your Node.js application will be accessible via the custom domain
  • SSL certificates will be installed automatically

Fix HTTPS not working on a Node.js custom domain

HTTPS works once the domain points to Hostinger and the SSL certificate is installed. If it doesn’t, check these five causes in order:

  1. Make sure the domain points to Hostinger through Hostinger nameservers or an A record with your hosting IP address, and allow up to 24 hours for DNS propagation.
  2. Make sure both domain.tld and www.domain.tld point to the website. See domain does not work with www at Hostinger.
  3. If the SSL certificate is still missing, go to Security → SSL. If its status is Installing, wait for the retry. Otherwise, uninstall the certificate and install it again. The full domain name, including any subdomain, must be 64 characters or shorter. See how to fix a failed Hostinger Lifetime SSL installation.
  4. If you use Cloudflare, set the Cloudflare SSL mode to Full. See troubleshooting Cloudflare Universal SSL at Hostinger.
  5. If the site keeps redirecting in a loop, update your app’s HTTPS redirect to read the X-Forwarded-Proto header, as described in Hostinger CDN: Visitor IP addresses in logs and analytics. In Express.js, add app.set('trust proxy', 1).

NOTES

  • You can change or replace the connected domain later if needed.
  • During DNS propagation, your application may still be accessible via the temporary domain.
  • If your domain is registered outside Hostinger, make sure the required DNS records are added correctly.