apt install nginx mariadb-server python3-certbot-nginx curl gitRegister your domain, create an A record and AAAA record for @ with the IPv4 and IPv6 of your VM
certbotcurl -fsSL https://deb.nodesource.com/setup_22.x | bash
apt install nodejs
npm i -g yarn
yarnmariadbCREATE USER app@localhost IDENTIFIED BY 'secret';
CREATE DATABASE counterdb;
GRANT ALL PRIVILEGES ON counterdb.* TO app@localhost;
FLUSH PRIVILEGES;mariadb counterdb < database.sqluseradd -rUM myapp
cp myapp.service /etc/systemd/system/myapp.service
systemctl daemon-reload
systemctl reenable myapp
systemctl restart myapp
systemctl status myappIn the file /etc/nginx/sites-enabled/default find the server block with SSL configuration (the one with listen 443 ssl)
In that server block, there should only be one location block and it should contain the following
location / {
proxy_pass http://localhost:3000;
include proxy_params;
}
To edit the file, use:
nano /etc/nginx/sites-enabled/default