[{"data":1,"prerenderedAt":31},["ShallowReactive",2],{"doc-en-deploy-nodejs-application-plesk":3},{"path":4,"slug":5,"title":6,"description":7,"category":8,"subcategory":9,"icon":10,"date":11,"author":12,"order":13,"image":14,"tags":15,"keywords":21,"docGroup":28,"docGroupIcon":28,"link_fr":29,"bodyHtml":30},"\u002Fdocs\u002Fen\u002Fcloud\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk","deploy-nodejs-application-plesk","How to Deploy a Node.js Application on Plesk","Deploy your Node.js or Next.js application on your Winheberg Plesk web hosting, automatic configuration, source protection, LTS version, dependencies, build, variables and secrets.","cloud","hebergement-web","tabler:brand-nodejs","2026-11-01","Winheberg",91,"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk.webp",[16,17,18,19,20],"Node.js","Plesk","Web Hosting","Next.js","Deployment",[22,23,24,25,26,27],"deploy node.js plesk","node.js hosting","next.js plesk","plesk passenger","node.js lts","plesk environment variables","","\u002Fdocs\u002Fhebergement-web\u002Fdeployer-application-nodejs-plesk","\u003Ch2>Context\u003C\u002Fh2>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fwinheberg.com\u002Fen\u002Fcloud\u002Fweb-hosting\">Winheberg web hosting\u003C\u002Fa> runs on Plesk and supports Node.js applications, whether an API, a backend or a Next.js project. Deployment differs from a classic PHP website, because the application runs in its own process managed by Phusion Passenger, not as a set of files served directly by the web server.\u003C\u002Fp>\n\u003Cp>As soon as your files are in place, Plesk reads your \u003Ccode>package.json\u003C\u002Fcode>, recognises the application type and offers an automatic configuration. It generates the startup file Passenger expects and shows you the list of changes before applying them.\u003C\u002Fp>\n\u003Cp>This guide follows that automatic path, then details the manual configuration for cases where detection does not succeed.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-note\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"10\"\u002F>\u003Cline x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"\u002F>\u003Cline x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>The Winheberg Plesk panel is displayed in French. Menu, field and button names are quoted below exactly as they appear on screen, followed by their English meaning.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>Prerequisites\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>An active Winheberg web hosting plan\u003C\u002Fli>\n\u003Cli>Access to your Plesk interface\u003C\u002Fli>\n\u003Cli>Your application sources, with their \u003Ccode>package.json\u003C\u002Fcode> file\u003C\u002Fli>\n\u003Cli>A domain or subdomain already attached to the hosting, for example by following our guide \u003Ca href=\"https:\u002F\u002Fwinheberg.com\u002Fen\u002Fdocs\u002Fhebergement-web\u002Fconnect-external-domain-plesk\">How to Connect an External Domain to Your Plesk Hosting\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cdiv class=\"markdown-alert markdown-alert-note\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"10\"\u002F>\u003Cline x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"\u002F>\u003Cline x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>SSH access is not available on web hosting plans. Every operation described here is done from the Plesk interface, npm commands included.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>1. Test the project locally\u003C\u002Fh2>\n\u003Cp>Before uploading anything, check that your application builds and starts on your machine.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">npm install\nnpm run build\nnpm run start\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>If any of these commands fails locally, it will fail on the server too. Fix it before going further, troubleshooting is far easier on your own machine. If your project has no build step, only the first and last commands apply.\u003C\u002Fp>\n\u003Ch2>2. Upload the application files\u003C\u002Fh2>\n\u003Cp>Compress your sources into a \u003Ccode>.zip\u003C\u002Fcode> archive, \u003Cstrong>without\u003C\u002Fstrong> the \u003Ccode>node_modules\u003C\u002Fcode> and \u003Ccode>.next\u003C\u002Fcode> folders. They will be regenerated on the server, and uploading them causes platform incompatibilities on top of a needlessly long transfer.\u003C\u002Fp>\n\u003Cp>Open \u003Cstrong>Fichiers\u003C\u002Fstrong> (\u003Cem>Files\u003C\u002Fem>) in the side menu, go into \u003Ccode>httpdocs\u003C\u002Fcode>, click \u003Cstrong>+\u003C\u002Fstrong> then \u003Cstrong>Téléverser le fichier\u003C\u002Fstrong> (\u003Cem>Upload file\u003C\u002Fem>). Once the archive is uploaded, select it and extract it in place from the \u003Cstrong>Archive\u003C\u002Fstrong> menu.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567752517-d3b915bdb70876652230ae4f.webp\" alt=\"Upload file menu of the Plesk file manager in httpdocs\" width=\"786\" \u002F>\n\n\u003Cp>After extraction, check that the \u003Ccode>package.json\u003C\u002Fcode> file sits directly in \u003Ccode>httpdocs\u003C\u002Fcode> and not in an intermediate subfolder.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-important\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Cpath d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z\"\u002F>\u003Cpath d=\"M12 8v4\"\u002F>\u003Cpath d=\"M12 16h.01\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>The order of these steps matters. Plesk only detects the application type and offers automatic configuration when \u003Ccode>package.json\u003C\u002Fcode> is already in place. On an empty domain, you will have to fill everything in by hand.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>3. Run the automatic configuration\u003C\u002Fh2>\n\u003Cp>From \u003Cstrong>Sites Web &amp; Domaines\u003C\u002Fstrong> (\u003Cem>Websites &amp; Domains\u003C\u002Fem>), open your domain, the \u003Cstrong>Démarrer\u003C\u002Fstrong> (\u003Cem>Get started\u003C\u002Fem>) tab, then \u003Cstrong>Node.js\u003C\u002Fstrong>. Plesk displays the \u003Cstrong>Type d&#39;application\u003C\u002Fstrong> (\u003Cem>Application type\u003C\u002Fem>) detected from \u003Ccode>package.json\u003C\u002Fcode> and the \u003Cstrong>Configurer automatiquement\u003C\u002Fstrong> (\u003Cem>Configure automatically\u003C\u002Fem>) button.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567752868-6ed0f9bf397ff93272281a22.webp\" alt=\"Detected application type and Configure automatically button in Node.js\" width=\"640\" \u002F>\n\n\u003Cp>Click \u003Cstrong>Configurer automatiquement\u003C\u002Fstrong>. Plesk lists what it is about to change before applying anything, for instance the creation of the \u003Ccode>.plesk.startup.cjs\u003C\u002Fcode> startup file that loads your entry point, and setting aside a static \u003Ccode>index.html\u003C\u002Fcode> that would otherwise be served instead of your application.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567753248-16d579d3767720561053c8f5.webp\" alt=\"Configure hosting automatically window with the Apply and restart button\" width=\"766\" \u002F>\n\n\u003Cp>Review that list, then click \u003Cstrong>Appliquer et redémarrer\u003C\u002Fstrong> (\u003Cem>Apply and restart\u003C\u002Fem>). The original \u003Ccode>index.html\u003C\u002Fcode> file is kept as \u003Ccode>index.html.autoconfig-bak\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-tip\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"10\"\u002F>\u003Cpath d=\"M12 16v-4\"\u002F>\u003Cpath d=\"M12 8h.01\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>There is no need to change the port written in your code. Passenger intercepts your application&#39;s \u003Ccode>listen()\u003C\u002Fcode> call and binds it to its own channel, whatever port is set. The \u003Ccode>.plesk.startup.cjs\u003C\u002Fcode> file says so in a comment, do not edit or delete it.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>4. Protect your source files\u003C\u002Fh2>\n\u003Cp>With the automatic configuration, the \u003Cstrong>Racine du document\u003C\u002Fstrong> (\u003Cem>Document root\u003C\u002Fem>) often stays the same as the \u003Cstrong>Root d&#39;application\u003C\u002Fstrong> (\u003Cem>Application root\u003C\u002Fem>), namely \u003Ccode>\u002Fhttpdocs\u003C\u002Fcode>. The web server then serves any file in that folder directly, including \u003Ccode>package.json\u003C\u002Fcode> and your application code, which anyone can download by knowing its name.\u003C\u002Fp>\n\u003Cp>Plesk itself points this out on the dashboard as long as Node.js is not enabled, recommending a document root set to a subfolder of the application root, such as \u003Ccode>public\u002F\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>Create a \u003Ccode>public\u003C\u002Fcode> folder inside \u003Ccode>httpdocs\u003C\u002Fcode> from the file manager. On the Node.js dashboard, then click the folder icon next to \u003Cstrong>Racine du document\u003C\u002Fstrong>, select \u003Ccode>public\u003C\u002Fcode> under \u003Ccode>httpdocs\u003C\u002Fcode> in the tree, and click \u003Cstrong>Enregistrer\u003C\u002Fstrong> (\u003Cem>Save\u003C\u002Fem>). Only put in that folder the files meant to be served as they are, such as images or stylesheets.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-caution\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"10\"\u002F>\u003Cline x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"\u002F>\u003Cline x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>Never hard code a password or an API key in your code. Use the \u003Cstrong>Secrets\u003C\u002Fstrong> of the \u003Cstrong>Environnement\u003C\u002Fstrong> (\u003Cem>Environment\u003C\u002Fem>) tab, covered in step 8.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>5. Check the version and application mode\u003C\u002Fh2>\n\u003Cp>Once the configuration is applied, the dashboard shows the \u003Cstrong>Redémarrer l&#39;app\u003C\u002Fstrong> (\u003Cem>Restart app\u003C\u002Fem>), \u003Cstrong>Arrêter l&#39;app\u003C\u002Fstrong> (\u003Cem>Stop app\u003C\u002Fem>) and \u003Cstrong>Désactiver Node.js\u003C\u002Fstrong> (\u003Cem>Disable Node.js\u003C\u002Fem>) buttons. If the \u003Cstrong>Activer Node.js\u003C\u002Fstrong> (\u003Cem>Enable Node.js\u003C\u002Fem>) button is still there, click it.\u003C\u002Fp>\n\u003Cp>Then click the pencil next to \u003Cstrong>Version de Node.js\u003C\u002Fstrong> (\u003Cem>Node.js version\u003C\u002Fem>), pick the version your project needs, and \u003Cstrong>Enregistrer\u003C\u002Fstrong>. While you are there, check that \u003Cstrong>Mode d&#39;application\u003C\u002Fstrong> (\u003Cem>Application mode\u003C\u002Fem>) is set to \u003Ccode>production\u003C\u002Fcode>, this setting drives your application&#39;s \u003Ccode>NODE_ENV\u003C\u002Fcode> and \u003Ccode>PASSENGER_APP_ENV\u003C\u002Fcode> variables.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567753972-c29a08e8073c740be466999a.webp\" alt=\"Node.js version selector and production application mode\" width=\"640\" \u002F>\n\n\u003Ch3>Which version to pick\u003C\u002Fh3>\n\u003Cp>The versions on offer are not equal. An LTS version receives security fixes for several years, whereas odd versions such as 23.x or 21.x never became LTS and are no longer maintained.\u003C\u002Fp>\n\u003Cdiv class=\"md-table md-table--info md-table--striped\">\u003Cdiv class=\"md-table__caption\">Node.js versions offered by Plesk, status as of November 1, 2026\u003C\u002Fdiv>\u003Cdiv class=\"md-table__scroll\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Version\u003C\u002Fth>\n\u003Cth>Status\u003C\u002Fth>\n\u003Cth>End of support\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>26.x\u003C\u002Ftd>\n\u003Ctd>Active LTS since October 28, 2026\u003C\u002Ftd>\n\u003Ctd>April 30, 2029\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>24.x\u003C\u002Ftd>\n\u003Ctd>Maintenance LTS since October 20, 2026\u003C\u002Ftd>\n\u003Ctd>April 30, 2028\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>23.x\u003C\u002Ftd>\n\u003Ctd>No longer maintained\u003C\u002Ftd>\n\u003Ctd>June 1, 2025\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>22.x\u003C\u002Ftd>\n\u003Ctd>Maintenance LTS\u003C\u002Ftd>\n\u003Ctd>April 30, 2027\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>21.x\u003C\u002Ftd>\n\u003Ctd>No longer maintained\u003C\u002Ftd>\n\u003Ctd>June 1, 2024\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>20.x\u003C\u002Ftd>\n\u003Ctd>No longer maintained\u003C\u002Ftd>\n\u003Ctd>April 30, 2026\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>18.x\u003C\u002Ftd>\n\u003Ctd>No longer maintained\u003C\u002Ftd>\n\u003Ctd>April 30, 2025\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\n\u003C\u002Fdiv>\u003Cdiv class=\"md-table__footer\">Dates taken from the official Node.js release schedule.\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Cp>Go for \u003Cstrong>26.x\u003C\u002Fstrong> on a new project, it is the active LTS branch. Keep \u003Cstrong>24.x\u003C\u002Fstrong> if one of your dependencies is not compatible yet, it keeps receiving fixes until April 2028.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-warning\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Cpath d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"\u002F>\u003Cline x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"\u002F>\u003Cline x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>The 23.x, 21.x, 20.x and 18.x branches no longer receive security fixes. Avoid them for an application exposed to the Internet, even if your code runs on them.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Cp>A version that is too old also makes most recent frameworks fail to build, with a message that does not always name the culprit version. Next.js 16, for instance, requires at least Node.js 20.9.\u003C\u002Fp>\n\u003Ch2>6. Install the dependencies\u003C\u002Fh2>\n\u003Cp>Click \u003Cstrong>Installer NPM\u003C\u002Fstrong> (\u003Cem>NPM install\u003C\u002Fem>), or open the \u003Cstrong>Exécuter les commandes Node.js\u003C\u002Fstrong> (\u003Cem>Run Node.js commands\u003C\u002Fem>) tab and pick \u003Cstrong>install\u003C\u002Fstrong> from the list. Plesk reads your \u003Ccode>package.json\u003C\u002Fcode> and rebuilds the \u003Ccode>node_modules\u003C\u002Fcode> folder on the server.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567754418-32ecb747ef8491fc0880d61a.webp\" alt=\"Run Node.js commands tab with the list of package.json scripts and npm commands\" width=\"780\" \u002F>\n\n\u003Cp>The \u003Cstrong>Sortie de la commande\u003C\u002Fstrong> (\u003Cem>Command output\u003C\u002Fem>) shows the result. Wait for the operation to finish before moving on, on a large project the installation takes several minutes.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567754802-86b937346ee765d47b410cd2.webp\" alt=\"npm install command output in Plesk\" width=\"770\" \u002F>\n\n\u003Cdiv class=\"markdown-alert markdown-alert-note\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"10\"\u002F>\u003Cline x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"\u002F>\u003Cline x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>Plesk also supports Yarn and pnpm. Click the pencil next to \u003Cstrong>Gestionnaire de packages\u003C\u002Fstrong> (\u003Cem>Package manager\u003C\u002Fem>) on the dashboard to pick \u003Ccode>npm\u003C\u002Fcode>, \u003Ccode>yarn\u003C\u002Fcode> or \u003Ccode>pnpm\u003C\u002Fcode>.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>7. Run the build\u003C\u002Fh2>\n\u003Cp>Click \u003Cstrong>Démarrer le script\u003C\u002Fstrong> (\u003Cem>Run script\u003C\u002Fem>). Plesk opens the \u003Cstrong>Exécuter les commandes Node.js\u003C\u002Fstrong> tab, whose \u003Cstrong>Scripts du package.json\u003C\u002Fstrong> (\u003Cem>package.json scripts\u003C\u002Fem>) list shows your project scripts. Pick \u003Ccode>run build\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>For a Next.js project, this step generates the \u003Ccode>.next\u003C\u002Fcode> folder, the one you deliberately did not upload. Building on the server rather than uploading a build made on your machine avoids architecture incompatibilities.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-warning\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Cpath d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"\u002F>\u003Cline x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"\u002F>\u003Cline x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>For Next.js, this step is mandatory. Starting the application without a build produces the error \u003Ccode>Could not find a production build in the &#39;.next&#39; directory\u003C\u002Fcode>.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>8. Declare the environment variables\u003C\u002Fh2>\n\u003Cp>Open the \u003Cstrong>Environnement\u003C\u002Fstrong> tab. It separates two kinds of values passed to your application.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567755282-9f3f0e61172ea6ed55e5df5d.webp\" alt=\"Node.js Environment tab with environment variables and secrets\" width=\"786\" \u002F>\n\n\u003Cdiv class=\"md-table md-table--info md-table--striped\">\u003Cdiv class=\"md-table__caption\">Variables in the Environment tab\u003C\u002Fdiv>\u003Cdiv class=\"md-table__scroll\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Section on screen\u003C\u002Fth>\n\u003Cth>Use\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>Variables d&#39;environnement (\u003Cem>Environment variables\u003C\u002Fem>)\u003C\u002Ftd>\n\u003Ctd>Non sensitive settings, visible to anyone who opens this page\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Secrets\u003C\u002Ftd>\n\u003Ctd>Passwords, API keys and tokens, stored encrypted and write only, their value is never displayed again once saved\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Variables prédéfinies (\u003Cem>Predefined variables\u003C\u002Fem>)\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>NODE_ENV\u003C\u002Fcode>, \u003Ccode>PASSENGER_APP_ENV\u003C\u002Fcode>, \u003Ccode>NODE_PATH\u003C\u002Fcode> and \u003Ccode>IN_PASSENGER\u003C\u002Fcode>, set by Passenger, a variable with the same name declared above takes precedence\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Cp>Add your values with \u003Cstrong>Ajouter un champ\u003C\u002Fstrong> (\u003Cem>Add field\u003C\u002Fem>), click \u003Cstrong>Enregistrer\u003C\u002Fstrong>, then \u003Cstrong>Redémarrer l&#39;app\u003C\u002Fstrong> from the dashboard so the application picks them up.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-important\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Cpath d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z\"\u002F>\u003Cpath d=\"M12 8v4\"\u002F>\u003Cpath d=\"M12 16h.01\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>With Next.js, variables prefixed with \u003Ccode>NEXT_PUBLIC_\u003C\u002Fcode> are embedded in the code at build time. Put them in a \u003Ccode>.env.production\u003C\u002Fcode> file at the application root before running step 7, and only keep there values you accept to make public.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>9. Start the application\u003C\u002Fh2>\n\u003Cp>Click \u003Cstrong>Redémarrer l&#39;app\u003C\u002Fstrong>, then open your domain in a browser. As long as nobody has visited it, the \u003Cstrong>Statut\u003C\u002Fstrong> (\u003Cem>Status\u003C\u002Fem>) reads \u003Cstrong>Inactif\u003C\u002Fstrong> (\u003Cem>Idle\u003C\u002Fem>), the application starts on the first request. It then switches to \u003Cstrong>En cours d&#39;exécution\u003C\u002Fstrong> (\u003Cem>Running\u003C\u002Fem>), with the process count and the start time.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fstatics\u002Fimages\u002Fdocs\u002Fen\u002Fhebergement-web\u002Fdeploy-nodejs-application-plesk-1793567753630-3a3796035b299634b19315e3.webp\" alt=\"Active Node.js dashboard with the Restart app, NPM install and Run script buttons\" width=\"786\" \u002F>\n\n\u003Ch2>Manual configuration\u003C\u002Fh2>\n\u003Cp>If your \u003Ccode>package.json\u003C\u002Fcode> was not in place when you opened the Node.js page, or if detection did not recognise your project, fill in the fields yourself from the Node.js dashboard.\u003C\u002Fp>\n\u003Cdiv class=\"md-table md-table--info md-table--striped\">\u003Cdiv class=\"md-table__caption\">Fields to fill in\u003C\u002Fdiv>\u003Cdiv class=\"md-table__scroll\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Field on screen\u003C\u002Fth>\n\u003Cth>Value\u003C\u002Fth>\n\u003Cth>Role\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Cstrong>Root d&#39;application\u003C\u002Fstrong>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>\u002Fhttpdocs\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>The folder holding \u003Ccode>package.json\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Racine du document\u003C\u002Fstrong>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>\u002Fhttpdocs\u002Fpublic\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>The folder of files served as they are, kept apart from your sources\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Fichier de démarrage d&#39;application\u003C\u002Fstrong> (\u003Cem>Application startup file\u003C\u002Fem>)\u003C\u002Ftd>\n\u003Ctd>The file Passenger runs, \u003Ccode>app.js\u003C\u002Fcode> by default\u003C\u002Ftd>\n\u003Ctd>Your application entry point\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Cp>Passenger starts a JavaScript file, it does not run \u003Ccode>npm start\u003C\u002Fcode>. When an application is usually launched through an npm command, open \u003Ccode>package.json\u003C\u002Fcode> and find the file passed to \u003Ccode>node\u003C\u002Fcode>, that is the one to declare. For an Express application or any hand written Node.js code, that file already exists, often \u003Ccode>app.js\u003C\u002Fcode>, \u003Ccode>server.js\u003C\u002Fcode> or \u003Ccode>index.js\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>For Next.js, it does not exist. The \u003Ccode>next start\u003C\u002Fcode> command calls a framework binary, not a file from your project. Create a \u003Ccode>start.js\u003C\u002Fcode> file at your application root with the following content.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-javascript\">process.env.NODE_ENV = &#39;production&#39;;\n\nconst app = require(&#39;next\u002Fdist\u002Fcli\u002Fnext-start&#39;);\n\napp.nextStart({\n  port: process.env.PORT || 3000,\n});\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Then declare \u003Ccode>start.js\u003C\u002Fcode> in \u003Cstrong>Fichier de démarrage d&#39;application\u003C\u002Fstrong> and click \u003Cstrong>Redémarrer l&#39;app\u003C\u002Fstrong>.\u003C\u002Fp>\n\u003Cdiv class=\"markdown-alert markdown-alert-warning\">\u003Cspan class=\"alert-icon\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\u003Cpath d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"\u002F>\u003Cline x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"\u002F>\u003Cline x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"\u002F>\u003C\u002Fsvg>\u003C\u002Fspan>\u003Cdiv class=\"markdown-alert-body\">\u003Cp>If your \u003Ccode>package.json\u003C\u002Fcode> contains \u003Ccode>&quot;type&quot;: &quot;module&quot;\u003C\u002Fcode>, the \u003Ccode>require\u003C\u002Fcode> statement above fails. Name your file \u003Ccode>start.cjs\u003C\u002Fcode> instead of \u003Ccode>start.js\u003C\u002Fcode>, the \u003Ccode>.cjs\u003C\u002Fcode> extension forces CommonJS interpretation, then declare that name in the startup file field.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Ch2>Troubleshooting\u003C\u002Fh2>\n\u003Ch3>❌ Could not find a production build in the &#39;.next&#39; directory\u003C\u002Fh3>\n\u003Cp>The build was not run, or it failed without you noticing.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Run \u003Ccode>run build\u003C\u002Fcode> again from \u003Cstrong>Démarrer le script\u003C\u002Fstrong> and read the \u003Cstrong>Sortie de la commande\u003C\u002Fstrong> to the end\u003C\u002Fli>\n\u003Cli>Check that the \u003Ccode>.next\u003C\u002Fcode> folder exists in the application root\u003C\u002Fli>\n\u003Cli>Make sure \u003Cstrong>Root d&#39;application\u003C\u002Fstrong> points to the folder holding \u003Ccode>package.json\u003C\u002Fcode>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3>❌ require() of ES Module is not supported\u003C\u002Fh3>\n\u003Cp>Your project is declared as an ES module, which makes the \u003Ccode>require\u003C\u002Fcode> statement unusable in a \u003Ccode>.js\u003C\u002Fcode> startup file.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Rename your startup file with the \u003Ccode>.cjs\u003C\u002Fcode> extension\u003C\u002Fli>\n\u003Cli>Report that new name in \u003Cstrong>Fichier de démarrage d&#39;application\u003C\u002Fstrong>\u003C\u002Fli>\n\u003Cli>Restart the application with \u003Cstrong>Redémarrer l&#39;app\u003C\u002Fstrong>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3>❌ The application process exited prematurely\u003C\u002Fh3>\n\u003Cp>The process failed to start.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Check that the startup file really exists at the application root\u003C\u002Fli>\n\u003Cli>Make sure the dependencies were installed, the \u003Ccode>install\u003C\u002Fcode> \u003Cstrong>Sortie de la commande\u003C\u002Fstrong> must show no error\u003C\u002Fli>\n\u003Cli>Look for a missing environment variable or secret in the \u003Cstrong>Environnement\u003C\u002Fstrong> tab\u003C\u002Fli>\n\u003Cli>Confirm that \u003Cstrong>Mode d&#39;application\u003C\u002Fstrong> is set to \u003Ccode>production\u003C\u002Fcode>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3>❌ Your source files show up in the browser\u003C\u002Fh3>\n\u003Cp>The \u003Cstrong>Racine du document\u003C\u002Fstrong> is the same as the \u003Cstrong>Root d&#39;application\u003C\u002Fstrong>, so the web server serves your sources directly.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Create a \u003Ccode>public\u003C\u002Fcode> folder in the application root\u003C\u002Fli>\n\u003Cli>Set \u003Ccode>\u002Fhttpdocs\u002Fpublic\u003C\u002Fcode> as \u003Cstrong>Racine du document\u003C\u002Fstrong> from the Node.js dashboard\u003C\u002Fli>\n\u003Cli>Restart the application, then open your website with \u003Ccode>\u002Fpackage.json\u003C\u002Fcode> added at the end of its address, the file must no longer show up\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>Best practices\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Upload your files before opening the Node.js page, that is what enables detection and automatic configuration\u003C\u002Fli>\n\u003Cli>Always validate \u003Ccode>npm run build\u003C\u002Fcode> locally before uploading anything\u003C\u002Fli>\n\u003Cli>Keep \u003Ccode>node_modules\u003C\u002Fcode> and \u003Ccode>.next\u003C\u002Fcode> out of your uploads, they are regenerated on the server\u003C\u002Fli>\n\u003Cli>Run the build again then \u003Cstrong>Redémarrer l&#39;app\u003C\u002Fstrong> after every code update\u003C\u002Fli>\n\u003Cli>Stay on an LTS version of Node.js and switch branch before its end of support\u003C\u002Fli>\n\u003Cli>Store passwords and API keys in the \u003Cstrong>Secrets\u003C\u002Fstrong>, never in the code nor in a file served by the website\u003C\u002Fli>\n\u003Cli>If you change framework, run \u003Cstrong>Configurer automatiquement\u003C\u002Fstrong> again so Plesk regenerates the startup file\u003C\u002Fli>\n\u003Cli>Serve your application over HTTPS with the free certificate described in our guide \u003Ca href=\"https:\u002F\u002Fwinheberg.com\u002Fen\u002Fdocs\u002Fhebergement-web\u002Flets-encrypt-ssl-certificate-plesk\">How to Generate a Let&#39;s Encrypt SSL Certificate for Your Website\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>To hand the deployment over to a developer without opening your whole account, give them a dedicated access with our guide \u003Ca href=\"https:\u002F\u002Fwinheberg.com\u002Fen\u002Fdocs\u002Fhebergement-web\u002Fcreate-user-account-plesk\">How to Create a User in Plesk\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>Need help?\u003C\u002Fh2>\n\u003Cp>If your application still does not start after these checks, open a ticket with our support from your \u003Ca href=\"https:\u002F\u002Fbilling.winheberg.com\">client area\u003C\u002Fa>, \u003Cstrong>Technical\u003C\u002Fstrong> department, filling in the \u003Cstrong>Related Product\u003C\u002Fstrong> field with the hosting concerned.\u003C\u002Fp>\n\u003Cp>Attach the full error message along with the build output. Our team can also read the Passenger log on the server side, which often holds the exact cause of a failed start.\u003C\u002Fp>\n\u003Cp>Your application is live 🚀\u003C\u002Fp>\n",1794526350369]