Deploy a Node.js Web App on Hostinger with Namecheap DNS and SSL

by Fahim Mahmud Chisti

To deploy a web app on Hostinger while your domain stays on Namecheap, you run it as a Node.js web app in hPanel. Then you point the domain’s A record at Hostinger in Namecheap’s Advanced DNS and switch on Hostinger’s free SSL. Keeping Namecheap as your DNS host means email and other records keep working.

This guide also covers the three usual failures: an SSL certificate that will not issue, email that stops after a DNS change, and a 503 error because the app ignores the port Hostinger assigns.

Quick answer: Deploy the app from hPanel as a Node.js web app, add an A record for @ and a CNAME for www in Namecheap Advanced DNS pointing to Hostinger, wait until dig shows the Hostinger IP, then install SSL and turn on Force HTTPS in hPanel.

  1. Make the app listen on process.env.PORT.
  2. In hPanel, add a Node.js web app from your Git repository or an archive and deploy it.
  3. Copy the Hostinger server IP from the website dashboard.
  4. In Namecheap Advanced DNS, point @ (A record) and www (CNAME) at Hostinger and leave the MX records alone.
  5. Once dig returns the Hostinger IP, install SSL and enable Force HTTPS.
In this guide
  1. Before You Start
  2. Step 1: Make the App Use Hostinger’s Port
  3. Step 2: Create the Node.js Web App in hPanel
  4. Step 3: Point Namecheap DNS at Hostinger
  5. Step 4: Install SSL and Force HTTPS
  6. Step 5: Set Environment Variables and Restart the App
  7. Troubleshooting Common Deployment and DNS Errors
  8. Frequently Asked Questions
  9. Next Steps
Deploy a Web App on Hostinger with Namecheap DNS and SSL

Before You Start

  • A Hostinger plan that includes Node.js web apps (Business Web Hosting or Cloud) and access to hPanel.
  • Your Namecheap login, with the domain using Namecheap BasicDNS.
  • The app in a GitHub or GitLab repository, or as an archive you can upload.
  • A terminal on your own computer for the dig checks (built in on macOS and Linux; on Windows, nslookup example.com 8.8.8.8 gives the same answer).
  • About an hour, including DNS propagation. Changing the A record moves visitors off your old host, so deploy and test the app on Hostinger before you change DNS. Write down your current DNS records first so you can roll back.

Step 1: Make the App Use Hostinger’s Port

Before touching hPanel, make sure your app handles dynamic environment ports and reverse proxy headers. If you hardcode a port and ignore process.env.PORT, the proxy Hostinger puts in front of your app may not be able to reach it, and visitors get a 503 Service Unavailable error.

Here is a basic Express setup (server.js, in your project’s root folder) configured to read the assigned port and trust upstream proxy headers:

const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
// Trust reverse proxy headers from Hostinger edge
app.enable('trust proxy');
// Basic security headers
app.use((req, res, next) => {
  res.setHeader('X-Content-Type-Options', 'nosniff');
  res.setHeader('X-Frame-Options', 'DENY');
  next();
});
// Serve static build files
app.use(express.static(path.join(__dirname, 'public')));
app.get('/api/health', (req, res) => {
  res.status(200).json({ status: 'online', timestamp: new Date().toISOString(), uptime: process.uptime() });
});
app.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}`);
});

Check that your package.json lists every dependency and names your entry file. Hostinger installs the dependencies during deployment, and you point it at the entry file (server.js here) when you set the app up.

{
  "name": "my-web-app",
  "version": "1.0.0",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {
    "express": "^4.19.2"
  }
}

Run npm install and npm start on your own computer first. http://localhost:3000/api/health should return a small JSON object with "status":"online". If it fails locally, it will fail on Hostinger too.

Step 2: Create the Node.js Web App in hPanel

Node.js web apps run on Hostinger’s Business Web Hosting and Cloud plans. Log in to hPanel, go to Websites > Add Website, and choose Node.js Web App.

  1. Enter your domain name registered at Namecheap (e.g., example.com).
  2. Connect your GitHub or GitLab repository, or upload an archive of the project. Don’t copy the project into public_html by hand; a stray .env file there can be downloaded by anyone.
  3. In the build settings, pick Other as the framework preset, select an LTS runtime (22 or 24; see the Node.js documentation), and set server.js as the Entry file.
  4. Click Deploy. Hostinger installs the dependencies and starts the app for you.

When the deployment finishes, the website dashboard should show the app as Running. If it does not, open Deployments for the build log (see Error 2 below).

Grab the server IP address from the website’s Dashboard under Hosting Plan > Plan details (e.g., 203.0.113.10). You’ll need this for your Namecheap DNS records.

Step 3: Point Namecheap DNS at Hostinger

You can connect Namecheap to Hostinger in two ways: switch the nameservers to Hostinger, or keep Namecheap BasicDNS and add host records. Keep BasicDNS if you have active email or TXT verification records on the domain. Changing nameservers breaks them unless you first recreate every record at the new DNS host.

If you’re worried about breaking an active inbox, read our walkthrough on how to point Namecheap DNS to Hostinger without breaking email before editing records.

In Namecheap, go to your Domain List, click Manage next to your domain, and open the Advanced DNS tab.

  1. Under Host Records, remove any default parking pages or old server IPs. Leave MX, TXT and mail-related CNAME records as they are.
  2. Add an A Record with Host: @, Value: YOUR_HOSTINGER_IP, and set TTL: Automatic (or 5 min while testing). If you need a refresher on record syntax, check the Namecheap DNS host record guide.
  3. Add a CNAME Record with Host: www, Value: example.com. (replace with your root domain), and TTL: Automatic.

The finished host records look like this:

# Namecheap Advanced DNS Host Records Configuration
Type   Host  Value          TTL
A      @     203.0.113.10   5 min
CNAME  www   example.com.   5 min

Before requesting an SSL certificate, check from your own computer’s terminal that the new records have propagated:

dig +short example.com @8.8.8.8
dig +short www.example.com @8.8.8.8

Once both dig commands return your Hostinger IP address (the www lookup shows your domain name first, then the IP), you’re clear to set up SSL.

Step 4: Install SSL and Force HTTPS

Hostinger provides a free SSL certificate directly inside hPanel. Do not trigger the install until your DNS records point to Hostinger. If the domain validation check reaches the old IP, it fails and you’ll have to retry later.

Once the DNS resolves to your Hostinger IP, open the website’s Dashboard in hPanel and go to Security > SSL:

  1. Select your domain from the list.
  2. Click Install SSL. Hostinger runs an automated domain validation; the Let’s Encrypt validation protocols page explains how this kind of check works.
  3. Turn Force HTTPS on to redirect all standard HTTP traffic to HTTPS.

To check, open http://example.com/api/health. The browser should end up on the https:// address with a padlock and show the JSON status.

Don’t add redirect rules to the .htaccess file in public_html: Hostinger generates it to route requests to your Node app and overwrites it on every deployment. If you also want HSTS, add one line to the security-headers middleware in server.js:

res.setHeader('Strict-Transport-Security', 'max-age=31536000');

The Strict-Transport-Security (HSTS) header tells browsers to require HTTPS on all future visits, as detailed on MDN Web Docs. Add it only after HTTPS works, because browsers remember it for the whole max-age.

Step 5: Set Environment Variables and Restart the App

Never commit raw API keys or database strings into your repo. Set them in hPanel instead, under Environment variables in the website dashboard sidebar. Add keys one at a time or use Import .env with a file like this; saving redeploys the app:

NODE_ENV=production
DATABASE_URL=mysql://u123456_app:YOUR_DB_PASSWORD@127.0.0.1:3306/u123456_db
SESSION_SECRET=replace-with-a-long-random-string

You don’t need PM2 on these plans. hPanel starts and supervises the Node process; to restart it by hand, click the Running badge on the website dashboard and choose Restart.

Troubleshooting Common Deployment and DNS Errors

Error 1: SSL Installation Fails with ‘Domain not pointing to Hostinger’

Namecheap DNS changes usually take between 5 and 30 minutes to propagate. If hPanel errors out, query Namecheap’s authoritative nameservers directly from your terminal to see what they’re serving:

# Query Namecheap authoritative nameserver directly
dig @dns1.registrar-servers.com example.com A

If Namecheap returns your Hostinger IP, retry the SSL setup inside hPanel. It should validate right away. If it returns an old IP, the A record was not saved or an older duplicate @ record is still there.

Error 2: 503 Service Unavailable or Cannot GET /

This means Hostinger’s reverse proxy can’t reach your Node instance. Open Runtime Logs in the website dashboard to see what died; build errors are under Deployments.

The usual culprit is a dependency missing from package.json, a missing environment variable, or a hardcoded port ignoring process.env.PORT.

Error 3: Email Stops Arriving After the DNS Change

Changing your domain’s A record won’t alter your MX records, but deleting the wrong row in Namecheap can break incoming mail. Compare your records with the list you saved before you started and restore anything missing. If messages bounce or head to spam, read our guide to configure SPF, DKIM, and DMARC records in Namecheap DNS.

Frequently Asked Questions

Should I use Namecheap BasicDNS or switch nameservers to Hostinger?

Stay on Namecheap BasicDNS if you have external mail servers (like Google Workspace), custom subdomains, or third-party verification tags. Only switch to Hostinger nameservers (ns1.dns-parking.com and ns2.dns-parking.com) if you want to manage all DNS records entirely inside hPanel.

How do I deploy updates when I push code to GitHub?

If you connected a GitHub or GitLab repository, every push to the deployed branch triggers a new deployment automatically. If you uploaded an archive, upload the new version and redeploy from the dashboard.

Why does the browser still say “Not secure” after SSL is installed?

Usually because the page loads some files over plain HTTP, which browsers call mixed content. Make sure all scripts, stylesheets and images use relative paths or explicit https:// URLs, then reload with the cache cleared.

Can I run multiple web apps on different subdomains?

Yes, up to the number of web apps your plan includes. Add each app on its own subdomain in hPanel, then add a matching A Record for that subdomain in Namecheap Advanced DNS, pointing to your Hostinger server IP. Hostinger routes each subdomain to the right app.

Next Steps

Your app is live on your Namecheap domain over HTTPS. Push a small change to confirm automatic redeploys work, and keep the list of DNS records you saved. If you later need full control over the server, such as custom Nginx rules, background workers or WebSockets, see how to deploy Node.js on a Hostinger VPS with Nginx.

all_in_one_marketing_tool