TIP: When you use an ai coder to build an application / web site, at the end ask the prompt for installation instructions
If you use an AI coder, some applications it produces must have Node.js installed on the server, and then enabled for your application. Ask your AI chatbox to see if that is the case. If it is not a node.js app you just upload the files from your your /dist or /build coder output, into a directory or root of your domain, and you are done.
However if you have a more complex app that requires node.js, here is the installation procedure if you have if you have Plesk control panel. If you do not have Plesk, it is best to get on a different server.
Most application built with aicoders do not require node.js and are very simple to install on a web server as indicated above. In one example we built a complex survey that emailed the results through our smtp server. When installed on the server using just the files in the /dist folder, we hit the URL and got a white page. When we asked the ai prompt for Plesk linux server install instructions, we got the procedure which we simplified below.
If you have a PLESK control panel, setting up a Node.js app is not only doable, it is pretty simple compared to trying to set it up on a server with just cheapo “Control Panel” which will require a lot of command line work. Plesk is king of Server Control Panels, period. Here is the installation process step by step:
Here’s a complete guide to deploy your Node.js (ex:survey application) app on a Plesk Linux server:
1. Prerequisites Check
Verify your Plesk server has the node.js extension
- Log into Plesk panel
- Click on Domains > Click on your domain for the app > In the tabs (you may need to select the 3 dots), Click on Getting Started > Find and click on Node.js.
- If node.js does not appear, you need to enable the Node.js extension. On Left menu click EXTENSIONS. search for Node.js Install.

2. Create Domain/Subdomain if not done already
- In Plesk, go to Websites & Domains
- Click Add Domain or Add Subdomain
- Enter your domain name (e.g.,
survey.yourdomain.com
) - Set document root (e.g.,
/httpdocs
)
3. Upload Your Application Files
Option A: File Manager (Recommended)
- Go to Files in Plesk
- Navigate to your domain’s folder
- Create a new folder called
your-app
(or similar) - Upload all your project files to this folder such as:
your-app/ ├── package.json ├── server.js ├── vite.config.js ├── src/ ├── public/ └── README.md
Option B: FTP/SFTP
- Use FTP client to upload files to
/httpdocs/your-app/
4. Configure Node.js Application
- Go to Websites & Domains → Your domain
- Click Node.js
- Click Enable Node.js
- Configure settings:
- Node.js version: Select latest available (18.x or 20.x recommended)
- Document root:
/httpdocs/survey-app
- Application root:
/httpdocs/survey-app
- Application startup file:
server.js
- Application mode:
production
5. Install Dependencies
- In the Node.js settings page, scroll to NPM
- Click NPM install or use the terminal:
- Or use SSH Terminal (if available):
cd /var/www/vhosts/yourdomain.com/httpdocs/survey-app npm install
6. Build the Application
In the SSH terminal or using Plesk’s terminal:
cd /var/www/vhosts/yourdomain.com/httpdocs/survey-app
npm run build
7. Set Environment Variables
- In Node.js settings, find Environment Variables
- Add:
- Name:
NODE_ENV
- Value:
production
- Name:
PORT
- Value:
3000
(or whatever port Plesk assigns)
- Name:
8. Configure Domain Routing
Option A: Subdomain (Recommended)
- Create subdomain:
survey.yourdomain.com
- Point document root to
/httpdocs/survey-app
- Enable Node.js for this subdomain
Option B: Main Domain with Path
- In Apache & nginx Settings
- Add this to Additional nginx directives:
location /survey { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_cache_bypass $http_upgrade; }
9. Start the Application
- In Node.js settings, click Restart App
- Or use Enable/Disable toggle
- Check Application Status – should show “Running”
10. Configure SSL Certificate
- Go to SSL/TLS Certificates
- Either:
- Let’s Encrypt: Click “Get it free” for automatic SSL
- Upload existing certificate
- Enable Redirect from HTTP to HTTPS
11. Test Your Application
- Health Check: Visit
https://yourdomain.com/api/health
- Survey: Visit
https://yourdomain.com
- Test Email: POST to
https://yourdomain.com/api/test-email
12. Troubleshooting
Check Application Logs:
- In Node.js settings, click Logs
- Check Error log and Access log
Common Issues:
Port Conflicts:
- Plesk may assign different ports
- Check Node.js settings for assigned port
- Update
PORT
environment variable if needed
File Permissions:
chmod -R 755 /var/www/vhosts/yourdomain.com/httpdocs/survey-app
chown -R username:psacln /var/www/vhosts/yourdomain.com/httpdocs/survey-app
SMTP Issues:
- Verify port 25 is open on your server
- Test with:
telnet saasbusinesssoftware.com 25
- Check firewall settings
Memory Issues:
- Increase Node.js memory limit in Plesk settings
- Monitor resource usage
13. Final Configuration
Update DNS (if using subdomain):
- Point
survey.yourdomain.com
to your server IP - Wait for DNS propagation (up to 24 hours)
Firewall:
- Ensure ports 80, 443, and your Node.js port are open
- Check with hosting provider if needed
14. Monitoring & Maintenance
- Auto-restart: Enable in Node.js settings
- Log rotation: Configure in Plesk
- Backups: Set up automatic backups
- Updates: Regularly update Node.js version and dependencies
Your survey application should now be live and accessible! The unified server setup ensures both the React frontend and API backend work seamlessly together.
We asked our ai prompt about this…
So are you saying this is an actual node.js app, that node.js needs to be enabled, vs just using the files in the dist folder?
Tokens: 23481 (prompt: 22056, completion: 1425)
Yes, exactly! You have a full Node.js application that requires Node.js to be enabled on your Plesk server. Here’s why:
Why You Need Node.js (Not Just Static Files)
Your current setup has two critical components:
- React Frontend – This gets built into static files in the
dist
folder - Express Backend Server (
server.js
) – This handles:- Email sending via Nodemailer
- API endpoints (
/api/submit-survey
,/api/health
,/api/test-email
) - Serving the React app in production
What Happens When You Submit the Survey
Looking at your App.jsx
, when someone submits the survey:
const response = await fetch('http://localhost:3001/api/submit-survey', {
method: 'POST',
// ... sends form data to your Node.js server
});
This calls your Express server which:
- Receives the form data
- Uses Nodemailer to send an email to
donn@jasura.com
- Returns success/error response
Static Files vs Node.js App
If you only uploaded dist
folder files:
- ❌ Survey form would display
- ❌ Email submission would fail (no server to handle
/api/submit-survey
) - ❌ No email functionality at all
With full Node.js deployment:
- ✅ Survey form displays
- ✅ Email submission works
- ✅ Complete functionality
Alternative: Static-Only Approach
If you wanted to avoid Node.js, you’d need to:
- Remove the backend server entirely
- Use a different email solution like:
- Formspree (3rd party service)
- Netlify Forms
- Client-side email services
- Modify your React app to use that service instead
Recommendation
Stick with the Node.js deployment because:
- You already have a working solution
- Full control over email functionality
- Professional server setup
- Better security and reliability
Your current architecture is correct – you need the full Node.js app running on Plesk, not just static files.
Leave a Reply