37
loading...
This website collects cookies to deliver better user experience
sudo apt update; sudo apt upgrade
sudo apt install nginx redis-server python3-certbot-nginx
sudo apt install neovim
nvim /etc/nginx/sites-available/example.com
proxy_pass
value, the port should be whichever port you plan to run your NodeJS server on.server {
listen 80;
server_name example.com www.example.com;
location / {
proxy_pass http://localhost:3000/;
}
}
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled
redis.conf
file:nvim /etc/redis/redis.conf
supervised
key; set the value to systemd
.sudo systemctl restart redis.service
sudo systemctl restart redis
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install v15.11.0
git clone https://probablygithub.com/yourusername/yourrepo.git
cd yourrepo.git
npm install
pm2
globally:npm install pm2 -g
server.js
to the path of your main file):pm2 start server.js
pm2 startup
pm2 save
sudo reboot
sudo certbot --nginx -d example.com -d www.example.com
root
.ufw
for added security. I would reference Brad Traversy's deployment strategy.