Tutorials / DNS

Point DNS to a VPS and Enable HTTPS with Caddy

beginner30 minLast reviewed: 2026-07-15Target OS: Ubuntu 24.04 LTS

Written by uNode Engineering; reviewed by uNode Operations.

DNS dependency order, firewall ports, reverse-proxy configuration, validation, and certificate troubleshooting reviewed.

TLS issuance works only after public DNS points to the VPS and ports 80 and 443 reach Caddy. Verify each dependency in order instead of repeatedly requesting certificates.

Illustration for How to Point a Domain to a VPS and Enable HTTPS

Prerequisites

  • A domain you control.
  • A running Ubuntu 24.04 VPS.
  • An application listening on a local port such as 3000.
Open console server deploy

Step 1

Create DNS records

Create an A record for the hostname pointing to the VPS IPv4. Remove stale A/AAAA records that route somewhere else.

dig +short A app.example.com
# The answer must equal <server-ip>

Step 2

Allow web traffic

Open HTTP and HTTPS while keeping SSH allowed.

ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw status

Step 3

Install and configure Caddy

Install Caddy from its supported package source, then proxy the hostname to the local application.

app.example.com {
    reverse_proxy 127.0.0.1:3000
}

Step 4

Verify HTTPS and logs

Check the certificate, response, and service logs before changing application settings.

caddy validate --config /etc/caddy/Caddyfile
systemctl reload caddy
curl -I https://app.example.com
journalctl -u caddy -n 100 --no-pager