Hosting with Plesk Obsidian

Hi, having some real issues getting development mode to work with this setup. I’ve got the cms working correctly on the server through plesk. I have a server.js file which simply contains the following:

const strapi = require(‘strapi’);
strapi(/* {…} */).start();

I can change the node settings in plesk to either production or development, after reloading the app it the correct shows whichever state i chose before going to the login screen. The issue is that I can’t edit collection types and get the error "The autoReload feature is required to use this plugin. Start your server with strapi develop"

How can i get this working properly so i edit collection types with this setup?

System Information
  • Strapi Version 3.4.5:
  • Operating System Ubuntu 18:
  • Database Sqllite:
  • Node Version 12:
  • NPM Version 12:
  • Yarn Version 1:

If you are running in production, the CTB (Content-type builder) is forcefully disabled in production and staging. You should not create/update/delete content-types in these environments due to how Strapi it built.

You can find more information in this FAQ: Troubleshooting - Strapi Developer Documentation

Trying to run production with the CTB enabled is not a support environment and you do so at your own risk.

1 Like

Thanks for the reply. I have node environment set to “development” and i’ve rebuilt the admin panel. is there no way to run in development mode via plesk? It shows as being in development mode but i still get the warning when opening the CTB,

We don’t have an API option to start strapi in development mode with a server.js or app.js

strapi(/* {…} */).start(); ← This is basically the same as running npm run start or yarn start and what is required to use the development mode is basically npm run develop or yarn develop but there is no strapi(/* {…} */).develop(); option.

If Plesk allows you to run a custom command you could run it like this, but as mentioned earlier we don’t support nor recommend it.

Start strapi with:

const strapi = require('strapi');

strapi({
    autoReload: true,
    serveAdminPanel: true
}).start();

It works on my shared server. :slight_smile:

1 Like

The strapi is deployed but an error is occurring when I am trying to access media library or try to upload something.
Please Help me with this A.S.A.P

Is hosting strapi on a plesk ubuntu 22.04 system actually possible?

Running latest Strapi v4 on Plesk Obsidian 18.0.46 with Node 16.17 the server.js code has to be this in my experience:

// server.js content: 

const strapi = require('@strapi/strapi');

strapi({
    autoReload: true,
    serveAdminPanel: true
}).start();

The suggested code in Strapi docs doesn’t work, it seems we have to force autoReload.

I’m currently stuck on the same issue as @rishabhchand007 had, the 403. A fix for this on Plesk is allowing directory discovery on the server, however, this will not do much since your new error will be 404 (on upload/<some_file>). The rest of the panel works perfectly fine, I’m even able to upload a new site logo. Just when I try to access the media library, or when I try to add new media, it will throw an error. @Arklogic since you managed to set this up, do you maybe have a guide for us which you followed? :slight_smile:

If any of you could help me, that would be really appreciated! :smiley:

@rishabhchand007 the problem with the 403 error has to do with nginx proxying to Apache. Turn this off and it should work. Go to:
Your strapi domain ==> Hosting & DNS ==> Apachy & nginx Settings ==> Proxy mode (under nginx) and turn it off

1 Like

Muchas Gracias por esto! Sigue funcionando en Plesk Obsidian 18.0.49 y con Node 18.

Esto también era un problema para mi, muchas gracias por el aporte!

Hello, I’ve been trying to deploy Strapi on mi Plesk server. I followed a couple of guides I found on internet:

Deploy Strapi on Plesk
Getting Strapi to run in Plesk

I also tried @MyKrzysiu 's strategy, but still not working. I don’t get any errors. When I go to my domain it just sends back the default Plesk template. Any Idea of why is this happening?. Should I reference a document besides server.js on NodeJS or something similar?

@fisocodes these are the steps that worked for me, running Plesk Obsidian 18.0.58 on Ubuntu 20.04.

  1. Run NODE_ENV=production strapi build
  2. Create server.js file with the following contents. NB: It should NOT have autoReload in production mode.
const strapi = require('@strapi/strapi');
const app = strapi({ distDir: './dist' });
app.start(); 
  1. Upload the ./dist directory only to your file manager.
  2. Upload your server.js and package.json files to your file manager.
  3. Create a ./public/uploads directory in your file manager.
  4. In the Node.js dashboard:
  • Update the Document Root to the public directory
  • Update the Application Root to your root directory
  • Edit the Application Startup File to your server.js file
  • Add your environment variables
  • Click “+ NPM Install”

Once this is done your file manager should look like this:

  • dist
  • node_modules
  • public
  • package.json
  • server.js

Click Restart App and it should work :rocket: