In this article, I am assuming a couple of things that you have already done:
- You already have a domain pointing to your VPS this can be on
- Digital Ocean
- Linode
- AWS Lightsail
- Vultr --> Basically any platform that enables you to spin up your own Linux server
- You already have Caddy installed and it's running on port 2019 locally or something else.
- The port you want to point the domain to is currently running in the background, use something like pm2 to achieve that.
On to the point
- Update your Caddyfile to add a new entry something like this
- Generate JSON file from your Caddy file
- Update your caddy.json file
- Lastly, load your caddy.json file
That's basically it