Deploying a website
Use Caddy to serve your product on your own domain, with HTTPS certificates obtained by itself.
The machine has a public IPv4 and IPv6 address of its own, with ports 22, 80 and 443 open by default. Below, a service listening on port 3000 of the machine is put on your domain.
DNS
At your DNS provider, add an A record pointing the domain (say app.example.com) at the machine's public address.
Install Caddy
sudo apt update && sudo apt install -y caddyMake /etc/caddy/Caddyfile read:
app.example.com {
reverse_proxy 127.0.0.1:3000
}Then reload. Caddy obtains the certificate and renews it by itself:
sudo systemctl reload caddyStarting your service at boot
Docker is the least effort:
curl -fsSL https://get.docker.com | sudo sh
sudo docker run -d --restart always -p 127.0.0.1:3000:3000 your-imageThe port is published on 127.0.0.1 only, so Caddy is the one way in from outside.
Only a static site
Copy the files to /var/www/site and write the Caddyfile as:
app.example.com {
root * /var/www/site
file_server
}