node.jspassengerpleskphusionnuxt3.js

How to deploy NUXT3 on Plesk using Phusion Passenger


I'm trying to deploy a Nuxt 3 website on Plesk, compiled with yarn build. I therefore have the PUBLIC and SERVER folders, which I have on Plesk hosting.

I have the server.js file which is the following:

`const app = require('./.output/server/index.mjs'); const http = require('http');

http.createServer(app).listen(process.env.PORT);`

I can't find a single guide for Nuxt 3, I need to start the application. From my understanding though, Phusion should start processes without launching a manual start command?

Thank you very much


Solution

  • I solved my problem, and it is way easier than I anticipated: What you need to do is simply create a server.js file, containing 1 line:

    import('./server/index.mjs');
    

    which is the file generated by nuxt3 in ./output/server/index.mjs.

    That's all. I was definitely overcomplicating it coming from nuxt2, I hope it can save time to others.