To use https on localhost instead of http, you can use Caddy, a server written in Go programming language, known for its easy configuration and built-in https support.
Using a simple Caddyfile, you can set up a reverse proxy to redirect traffic to a specific port on your localhost.
To resolve permission denied errors while running Caddy, you can either allow linux to assign the required permissions or stop and restart the Caddy service if it is already running.
Once set up, you will be able to access your localhost using https and your specified sub-domain in the browser or other preferred tools.