How to Host a Node.js Website on Plesk
What You'll Need
Before starting, make sure you have:
- A Plesk server with the Node.js Toolkit extension installed
- Your Node.js application ready to upload
- FTP/SFTP credentials or File Manager access
- Basic knowledge of your application's structure
Note: This guide assumes your hosting provider has already installed the Node.js Toolkit extension. If the Node.js option doesn't appear in your Plesk panel, contact your hosting provider.
Understanding Node.js Application Structure
Before uploading your application, it's important to understand its directory structure:
Application Root
The main directory containing all your application files and subdirectories. This is where you'll find:
package.json- Lists dependencies and scriptsnode_modules/- Installed packages (don't upload this folder)- Application code files
- Configuration files
Document Root
A subdirectory within the application root that contains static files like:
- HTML files
- CSS stylesheets
- JavaScript files for the browser
- Images and other assets
- Often called
public/,static/, ordist/
Application Startup File
The main file that starts your application. Common names:
app.jsserver.jsindex.jsmain.js
Example structure:
my-nodejs-app/ ← Application Root
├── package.json
├── app.js ← Startup File
├── node_modules/
├── public/ ← Document Root
│ ├── index.html
│ ├── css/
│ └── js/
├── routes/
└── views/
Step 1: Upload Your Application
You have several options to upload your Node.js application to Plesk.
Option A: Using Plesk File Manager (Easiest)
- Log in to Plesk
- Go to Websites & Domains
- Find your domain and click Files (File Manager icon)
- Navigate to your domain's directory (usually
/httpdocsor/) - Create a new folder for your application or use the existing directory
- Click Upload and select your application files
- If you have a
.zipor.tar.gzfile, upload it and extract it
Important: Do NOT upload the node_modules folder - Plesk will install dependencies automatically later.
Option B: Using FTP/SFTP Client
- Open your FTP client (FileZilla, WinSCP, etc.)
- Connect using your FTP credentials:
- Host: Your domain or server IP
- Username: Your FTP username
- Password: Your FTP password
- Port: 21 (FTP) or 22 (SFTP)
- Navigate to your domain directory
- Upload all application files except
node_modules/ - Preserve the directory structure
Option C: Using Git (Recommended for Developers)
If your application is in a Git repository:
- Go to Websites & Domains
- Click Git (requires Git extension)
- Click Clone Repository
- Enter your repository URL
- Select the destination directory
- Click OK
Plesk will clone your repository automatically.
Step 2: Configure Your Node.js Application
Once your files are uploaded, configure the application to run properly.
Access Node.js Configuration
- Log in to Plesk
- Go to Websites & Domains
- Find your domain
- Click Create Website > Node.js
Or if already created:
- Click the Node.js button on your domain card
Configure Application Settings
You'll see a configuration screen with several options:
1. Node.js Version
What it is: The version of Node.js runtime that will run your application.
How to choose:
- Check your application's
package.jsonfile for the required Node.js version - Look for an
"engines"section:"engines": { "node": ">=18.0.0" } - If unsure, select the latest LTS (Long Term Support) version
- Common versions: 18.x, 20.x, 22.x
Example: Select Node.js 20.x for modern applications.
2. Package Manager
What it is: The tool used to install your application's dependencies.
Options:
- npm - Default Node.js package manager (most common)
- Yarn - Alternative package manager (faster, more reliable)
How to choose:
- If your project has
yarn.lockfile → Choose Yarn - If your project has
package-lock.jsonfile → Choose npm - Plesk usually detects this automatically
Example: Most applications use npm, so that's the safe choice.
3. Document Root
What it is: The directory containing static files (HTML, CSS, images).
How to configure:
- Click the folder icon
- Navigate to your static files directory
- Common names:
public/,static/,dist/,build/
Examples:
- Express app with static folder:
/httpdocs/my-app/public - React app:
/httpdocs/my-app/build - Simple app:
/httpdocs/my-app(if no separate static folder)
4. Application Mode
What it is: Sets the NODE_ENV environment variable.
Options:
- Development - For testing (verbose errors, hot reload)
- Production - For live sites (optimized, minimal logging)
- Custom - Enter your own value
How to choose:
- Use Development while testing
- Switch to Production when going live
Example: Start with Development, change to Production later.
5. Application Root
What it is: The main directory containing all your application files.
How to configure:
- Click the folder icon
- Select the directory where you uploaded your application
- This should contain
package.jsonand your startup file
Example: /httpdocs/my-nodejs-app
6. Application Startup File
What it is: The JavaScript file that starts your application.
How to configure:
- Enter the filename (not the full path)
- Common names:
app.js,server.js,index.js,main.js - Check your
package.jsonfile's"main"field for the correct file
Example in package.json:
{
"main": "server.js"
}
Then enter: server.js
7. Custom Environment Variables (Optional)
What it is: Additional configuration variables your application might need.
Common examples:
PORT- Server port (usually set by Plesk automatically)DATABASE_URL- Database connection stringAPI_KEY- Third-party service keysSECRET_KEY- Application secret for sessions
How to add:
- Click Add Variable
- Enter Variable Name (e.g.,
API_KEY) - Enter Variable Value (e.g.,
your-api-key-here) - Click OK
Example:
DATABASE_URL = mongodb://localhost:27017/myapp
API_KEY = sk_test_123456789
Save Configuration
After filling in all settings, click OK to save your configuration.
Step 3: Install Dependencies and Start Application
Now that your application is configured, it's time to install dependencies and start it.
Access Node.js Control Panel
- Go to Websites & Domains
- Find your domain
- Click the Node.js button
Enable Node.js
- Click Enable Node.js
- This activates the Node.js runtime for your application
Install Dependencies
- Click NPM Install (or Yarn Install if using Yarn)
- This installs all packages listed in
package.json - This step is required and only needs to be done once
- Wait for the installation to complete (may take 1-5 minutes)
- You'll see a success message when done
- This installs all packages listed in
What happens:
- Plesk reads your
package.jsonfile - Downloads and installs all dependencies
- Creates the
node_modulesfolder - Similar to running
npm installon command line
Run Build Scripts (If Required)
Some applications need build scripts to run before starting:
- Click Run Script (optional)
- Enter the script name from your
package.json - Common scripts:
build,setup,migrate - Click OK
- Enter the script name from your
Example package.json scripts:
{
"scripts": {
"start": "node app.js",
"build": "webpack --mode production"
}
}
To run the build script, enter: build
Verify Application is Running
After installation and starting:
- The Node.js version should appear under the Node.js button on your domain card
- Your application is now live and accessible
Step 4: Access Your Website
Your Node.js application should now be running!
Test Your Application
Open your web browser and go to:
http://your-domain.com
or
https://your-domain.com
You should see your Node.js application running.
Common Access Patterns
Depending on your application setup:
Root access:
http://yourdomain.com/- Main application
API endpoints:
http://yourdomain.com/api/users- API routes
Static files:
http://yourdomain.com/css/style.css- Static assets
Managing Your Application
Stop Your Application
To stop your Node.js application:
- Go to Websites & Domains
- Click Node.js
- Click Disable Node.js
Note: This doesn't delete your files or settings. You can restart anytime.
Restart Your Application
After making code changes:
- Click Node.js
- Click Restart App (or Disable then Enable)
Important: You must restart the application for code changes to take effect!
Update Dependencies
When you modify package.json:
- Click Node.js
- Click NPM Install (or Yarn Install)
- Wait for installation to complete
- Click Restart App
View Application Logs
To troubleshoot issues or monitor your application:
- Go to Websites & Domains
- Click Logs
- Look for entries with Node.js tag
- Use the filter to show only Node.js logs
What you'll see:
- Application console output
- Error messages
console.log()statements- Crash reports
Common Configuration Examples
Express.js Application
Typical setup:
- Node.js Version: 18.x or 20.x
- Package Manager: npm
- Application Root:
/httpdocs/my-express-app - Document Root:
/httpdocs/my-express-app/public - Startup File:
app.jsorserver.js - Application Mode: Development (testing) → Production (live)
React/Next.js Application
Typical setup:
- Node.js Version: 18.x or 20.x
- Package Manager: npm or Yarn
- Application Root:
/httpdocs/my-react-app - Document Root:
/httpdocs/my-react-app/build(React) or/httpdocs/my-react-app/out(Next.js) - Startup File: Usually handled by framework
- Application Mode: Production
- Build Script: Run
buildbefore starting
API Server (No Static Files)
Typical setup:
- Node.js Version: Latest LTS
- Package Manager: npm
- Application Root:
/httpdocs/my-api - Document Root: Same as Application Root
- Startup File:
index.jsorserver.js - Application Mode: Production
- Environment Variables: Database URL, API keys
Troubleshooting
Application Won't Start
Check the following:
- Correct startup file:
- Verify the filename is correct
- Check
package.json"main" field
- Dependencies installed:
- Run NPM Install again
- Check logs for installation errors
- Node.js version:
- Ensure version matches your app requirements
- Try a different version if needed
- View logs:
- Go to Logs to see error messages
- Look for missing modules or syntax errors
Cannot Access Website
Possible causes:
- Application not enabled:
- Click Enable Node.js
- Wrong document root:
- Verify static files are in correct directory
- Check document root path in settings
- Port conflicts:
- Plesk manages ports automatically
- Don't hardcode ports in your code
- File permissions:
- Ensure files are readable
- Check folder permissions
Errors After Code Changes
Solution:
- Click Node.js
- Click Restart App
- Node.js applications don't auto-reload by default
Module Not Found Errors
Solution:
- Check
package.jsonhas all dependencies listed - Run NPM Install again
- Restart the application
Application Crashes
Steps to diagnose:
- View Logs for error messages
- Check code for syntax errors
- Verify environment variables are set correctly
- Test locally before deploying
Best Practices
Security
- Use Production mode for live sites
- Don't commit sensitive data to Git
- Use environment variables for secrets
- Keep dependencies updated
Performance
- Enable Production mode for optimization
- Use latest Node.js LTS version
- Minimize dependencies
- Use caching where appropriate
Maintenance
- Check logs regularly
- Update dependencies periodically
- Backup your code before changes
- Test locally before deploying
Summary
To host a Node.js application on Plesk:
- Upload your application files (without
node_modules) - Configure in Plesk:
- Set Node.js version
- Choose package manager
- Set application root and document root
- Specify startup file
- Add environment variables
- Install dependencies with NPM/Yarn Install
- Enable Node.js to start the application
- Access your website at your domain
Your Node.js application is now live on Plesk!


















