Complete guide to deploying your full-stack application on Nuxit hosting
Nuxit is a European hosting provider offering VPS and shared hosting solutions. This guide covers deploying both your React frontend and Node.js backend on Nuxit servers.
npm run build)
Connect to your Nuxit server via SSH:
Update system packages and install essential software:
Install Node.js (using NVM recommended):
Install PM2 for process management:
Create a directory for your application:
Clone your repository (or upload files):
Create a .env file for production environment variables:
Add your production database credentials and other environment variables here
Test your Node.js server runs correctly:
Set up PM2 to manage your Node.js process:
Configure PM2 to start on server reboot:
Adjust paths according to your Node.js version and username
Create a new Nginx configuration file:
Add the following configuration (adjust as needed):
Enable the configuration and test Nginx:
Install Certbot for Let's Encrypt certificates:
Obtain and install SSL certificate:
Set up automatic renewal:
Certbot will automatically update your Nginx configuration
pm2 logs and sudo journalctl -u nginx
Usually means Nginx can't connect to your Node.js backend. Check:
pm2 list)sudo tail -f /var/log/nginx/error.logCommon causes and solutions:
Remember that environment variables need to be:
.env fileprocess.env in Node.jsREACT_APP_ and rebuild