Let us migrate your website for free.
5%Discount
If you purchase one of our hosting packages, we will migrate and deliver your website for you.
ViewHow to Host Next.js Projects on Plesk?
Performance, SEO, and user experience are crucial when developing modern web applications. React-based Next.js has become one of today's most popular frameworks thanks to its powerful features such as server-side rendering (SSR), static site generation (SSG), and API Routes.
So, how can you publish a Next.js application you've developed on Plesk? In this guide, we will explain step-by-step how to deploy your Next.js project using Plesk Panel.
Prerequisites
Before starting the installation, make sure the following are ready:Plesk Obsidian or a newer version
- Node.js extension installed
- SSH access (recommended)
- Your domain name must be linked to your Plesk account
- Repository access if you are using Git
1. Check for Node.js Extension
After logging into Plesk panel:
Websites & Domains → Node.js
If Node.js support is not visible, ask your server administrator to install the Node.js Extension.
2. Upload the Project to the Server
You can upload the project using two different methods.
Method 1: With Git
This is the most practical method.
git clone https://github.com/user/project.git
or you can use Plesk's Git integration.
Method 2: FTP / File Manager
You can upload the project from your computer to:
httpdocs/
or
next-app/
folder.
3. Select the Node.js Version
Select the Node.js version supported by your project from the Plesk Node.js settings.
Generally recommended:
Node.js 20 LTS
Node.js 22 LTS
4. Check the package.json File
Make sure the following scripts are present.
{ "scripts": { "dev": "next dev", "build": "next build", "start": "next start" }}
5. Install NPM Packages
From the Plesk Node.js screen:
Press the Run NPM Install button.
Alternatively, via SSH:
npm install
6. Build the Project
Then:
npm run build
If successful, the following folder will be created:
.next/
7. Application Startup File Setting
Most Next.js projects use:
node_modules/next/dist/bin/next
as the startup file.
Application Mode:
Production
8. Application URL
For example:
https://example.com
or
https://app.example.com
9. Start Application
Via Plesk:
Enable Node.js
then
Press the Restart App
button.
10. Enable SSL Certificate
Enable the SSL certificate with Plesk's free Let's Encrypt integration.
This will ensure your application is published securely over HTTPS.
Environment Variables (.env)
Next.js projects often use environment variables.
For example:
DATABASE_URL=NEXTAUTH_SECRET=NEXTAUTH_URL=API_KEY=
You can define this information in the Environment Variables section under Plesk Node.js settings.
Managing the .env file through Plesk is a more secure method than using it directly on the server.
Is PM2 Used?
No.
Plesk runs Node.js applications with its own service manager.
Therefore, you do not need to install PM2 separately.
Viewing Logs
If you encounter problems, you can review the following logs:
Logs
or
/var/www/vhosts/system/domain.com/logs/
Common errors:
Port errors
Missing environment variable
npm install failed
TypeScript errors during build
Incorrect startup file
Performance Tips
For better performance in a live environment, you can implement the following tips:
Run in production mode.
Remove unnecessary dependencies.
Optimize images with next/image.
Enable Gzip or Brotli compression.
Use HTTP/2 support.
Integrate CDN.
Cache static files.
Prefer the latest Node.js LTS version.
Continuous Deployment (CI/CD)
Instead of manually uploading your projects, you can create a Git-based deployment process.
Example flow:
Submit code to GitHub.
Update Plesk Git repository.
Run npm install.
Complete npm run build.
The application should restart automatically.
This method saves time and reduces the risk of errors.
Frequently Asked Questions
Is Next.js SSR supported?
Yes. Thanks to Plesk's Node.js support, Server Side Rendering (SSR) works seamlessly.
Can App Router be used?
Yes. The App Router architecture used in Next.js versions 13, 14 and later is supported.
Do API Routes work?
Yes. Next.js API Routes and Route Handlers work normally.
Is using Docker mandatory?
No. Most Next.js projects can be run directly on Plesk without Docker.
Conclusion
Plesk, thanks to its Node.js support, allows you to quickly and securely deploy Next.js projects. Choosing the correct Node.js version, installing the necessary dependencies, running the application in production mode, and correctly configuring environment variables are fundamental steps to a successful installation.
Features like Git integration, automated deployment processes, SSL management, and centralized log tracking make managing Next.js applications incredibly easy for both individual developers and agencies.
If you purchase one of our hosting packages, we will migrate and deliver your website for you.
View