Installing Strapi on a Plesk Server (Ubuntu 24.04) with NVM, PM2, and Nginx

Strapi is a popular open-source headless CMS that lets you model content, manage it through a web admin, and expose it over APIs. In this guide we show how to run Strapi on a Plesk server (Ubuntu 24.04) using NVM, PM2, and Nginx, and how to configure ports so you can host multiple Strapi instances on the same box.

Table of Contents

Modern websites and applications increasingly rely on headless CMS platforms: systems that provide content via APIs instead of tightly coupling it to a specific front-end theme. Strapi is one of the most popular open‑source headless CMS options in this space.

Strapi is a Node.js application that lets you define content types (pages, blog posts, products, FAQs, etc.), manage content through a web-based admin panel, and expose that content over REST or GraphQL APIs. Your front end can be anything you like—React, Next.js, Nuxt, a mobile app, or even a traditional server-rendered site—while Strapi focuses solely on content and APIs.

Why might you want to use Strapi?

  • Flexibility: You can model content exactly the way your business needs it instead of fighting a rigid page template system.
  • API-first: Content is delivered over APIs, which makes it easy to reuse across multiple sites, apps, or services.
  • Self-hosted and open source: You control where it runs (and how it’s secured), which is attractive for compliance or cost reasons.
  • Developer friendly: Strapi integrates cleanly with modern JavaScript toolchains and frameworks, and its plugin system makes it easy to extend.

Plesk, on the other hand, is a proven control panel that many teams already use to manage domains, DNS, SSL/TLS certificates, and web hosting. Running Strapi on a Plesk server is a natural fit: let Plesk handle the platform plumbing (domains, SSL, system users), while Strapi handles the content.

In this guide we’ll walk through installing Strapi on a Plesk server running Ubuntu 24.04, under a Plesk subscription such as strapi.acme.com. We’ll:

  • Use NVM to manage Node versions
  • Use npm (or yarn) to install Strapi
  • Use PM2 to run Strapi as a background service
  • Use Nginx as a reverse proxy via Plesk
  • Configure Strapi to listen on a non-default port so that multiple Strapi instances can run on the same server

We’ll assume:

  • Plesk Obsidian is already installed on Ubuntu 24.04.
  • DNS for strapi.acme.com points to your Plesk server.
  • PostgreSQL is external (e.g., AWS RDS, DigitalOcean Managed PG, on-prem DB). We’ll just need its host, port, db name, user, and password.

1. Create the Plesk Subscription

First, create a standard Plesk subscription for the Strapi instance.

  1. Log in to Plesk as admin.
  2. Go to Subscriptions → Add Subscription.
  3. Set:
    • Domain name: strapi.acme.com
    • Username: strapi (or something similar)
    • Password: choose a strong password
  4. Plan / PHP settings don’t matter much for Strapi itself, but PHP may be used for other things on the subscription.
  5. Save to create the subscription.

This will create a system user (e.g. strapi) and a home directory, usually something like:

We’ll run Strapi under this UNIX user.


2. SSH into the Subscription User

SSH into the server as root (or your admin user), then switch to the subscription user:

Confirm you’re in the right home directory:

We’ll install NVM, Node, and Strapi from here.


3. Install NVM and Node.js

Strapi expects a modern LTS version of Node. Installing Node via NVM makes it easy to upgrade later and keep this user isolated.

From the strapi user shell:

Load NVM into your current shell:

Install an LTS Node (replace with the current LTS you prefer):

Verify:


4. Create the Strapi Project

Decide where you want the Strapi code to live. A common pattern for Plesk:

Create a Strapi project (change cms to whatever you want):

When prompted:

  • Choose Custom (manual) if asked.
  • Select PostgreSQL as the database.
  • Skip sample content if you prefer a clean start.

Once created:


5. Configure Strapi to Use a Non-Default Port

By default, Strapi often runs on port 1337. To support multiple Strapi instances on the same server, give each instance a unique port, e.g.:

  • strapi.acme.com → port 1340
  • strapi2.acme.com → port 1341
  • etc.

Strapi uses environment variables (or .env) to define its port. Inside your Strapi project directory:

If you don’t already have a .env file in production, create one. A simple .env might look like this (example):

Key bit for running multiple instances:

For another instance on the same server (maybe marketing.acme.com), just set a different port:

Tip: Generate secure random strings for APP_KEYS, API_TOKEN_SALT, etc. Don’t reuse them between projects.


6. Test Strapi Manually

Before adding PM2, confirm Strapi runs correctly.

From the Strapi project directory:

You should see Strapi binding to 0.0.0.0:1340 (from your .env). Since Plesk’s firewall or public ports may not expose this directly, you may not be able to hit it from outside yet—that’s fine. We’ll use Nginx to proxy HTTP to this port.

Stop Strapi with Ctrl+C once you’re satisfied it starts without errors.


7. Install and Configure PM2

PM2 will keep Strapi running as a background process and restart it on crashes or reboot.

Still as the strapi user:

Start Strapi with PM2:

Check status:

You should see strapi-cms listed as online.

To make PM2 reload on reboot, run:

This command will output another command that you must run as root. Copy it, open a new root shell, and run it. It will look something like:

Then, save the current process list:

Now, after a reboot, PM2 will automatically start Strapi for the strapi user.


8. Configure Nginx Reverse Proxy in Plesk

Plesk uses Nginx + Apache by default. We’ll configure Nginx to proxy traffic from https://strapi.acme.com to our Strapi app on 127.0.0.1:1340.

8.1 Enable SSL for the Domain

  1. In Plesk, go to Domains → strapi.acme.com.
  2. Click SSL/TLS Certificates (or Let’s Encrypt).
  3. Issue a certificate for strapi.acme.com.
  4. Make sure SSL/TLS support is enabled for the domain in Hosting Settings.

8.2 Add Custom Nginx Proxy Rules

  1. In Plesk, open Domains → strapi.acme.com → Apache & Nginx Settings.
  2. Scroll down to Additional Nginx directives.
  3. Add something like this:

  1. Click OK or Apply.

Nginx will now forward all requests for strapi.acme.com to the Strapi process on port 1340.

8.3 Restrict Apache (Optional)

If you want Nginx to handle everything and avoid Apache interfering, in the same screen you can choose:

  • Proxy mode on (default)
  • or tweak settings so static files can be offloaded, etc.

For most simple Strapi setups, the basic reverse proxy above is enough.


9. Verify the Setup

Open a browser and go to:

You should see the Strapi admin panel login/setup screen.

If you get a 502/504:

  • Check that PM2 shows the app as online: pm2 status
  • Check that Strapi logs are clean:
  • Make sure the Nginx proxy port matches your .env PORT.
  • Verify SSL is active and the certificate is correct.

10. Running Multiple Strapi Instances on the Same Server

Now that the first instance works, adding more is straightforward:

  1. Create another Plesk subscription or domain (e.g. marketing.acme.com) and corresponding system user.
  2. Repeat the NVM/Node/Strapi setup under that user, or choose to centralize Node in one user and manage multiple Strapi projects there — just be consistent.
  3. For each project:
    • Use a unique port in .env (e.g., PORT=1341, PORT=1342, etc.).
    • Add a corresponding PM2 process with a unique name.
    • Add Nginx proxy rules in Plesk that point to the correct port.

Example .env snippet for a second instance:

Example Nginx directive for that domain:

With this pattern you can run multiple Strapi environments (staging, production, per-site CMS, etc.) safely on a single Plesk server.


11. Operational Tips

A few practical notes for production:

  • Backups
    Keep your Strapi project and uploads directory backed up (e.g. ~/httpdocs/cms and its /public/uploads), and use database-level backups for PostgreSQL.
  • Logs
    PM2 captures logs, but you may want to implement log rotation or ship logs to a central system:
  • Updates
    • Use NVM to install new Node LTS versions and test Strapi against them.
    • Upgrade Strapi via npm install @strapi/strapi@latest (or your chosen version), then rebuild:
  • Security
    • Keep Plesk, Ubuntu packages, and Node dependencies patched.
    • Use strong secrets in .env and restrict access to that file (chmod 640 and correct ownership).
    • Limit SSH to key-based auth if possible.

Conclusion

With Plesk handling domains and SSL, and Nginx/PM2 handling the application layer, you can host Strapi on a Ubuntu 24.04 Plesk server cleanly and repeatably. By using custom ports in .env, it’s trivial to run multiple Strapi instances on the same box without port conflicts.

Have a project or a problem?

Talk with a senior engineer for practical recommendations—no obligation.

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.