Strapi CMS is an open-source, headless CMS built on Node.js. It provides an admin interface to manage content and automatically generates a REST or GraphQL API for delivery to any frontend. When deployed on Rocky Linux 9 with PostgreSQL, PM2, Nginx, and SSL, it becomes a secure, high-performance backend suited for production-grade applications.


Why This Stack?

ComponentPurpose
Rocky Linux 9Enterprise-grade, RHEL-compatible OS with long-term support and security updates.
PostgreSQLReliable, feature-rich relational database for structured data.
PM2Node.js process manager ensuring uptime, auto-restarts, and logging.
NginxReverse proxy for load balancing, caching, and SSL termination.
Let’s EncryptFree, automated SSL certificates for encrypted communication.

Advantages of Strapi on Rocky Linux 9

  1. Enterprise Stability – Rocky Linux is designed for mission-critical environments.
  2. Scalable Architecture – Strapi + PostgreSQL + Nginx can handle high concurrent requests.
  3. Secure by Design – SELinux, firewall rules, and HTTPS protect your content API.
  4. Headless Flexibility – Serve the same content to websites, mobile apps, and connected devices.
  5. Modern Development Workflow – JavaScript/TypeScript support, customizable API, plugin ecosystem.

How Strapi Compares to Other CMS Platforms

Feature / CMSStrapi (Headless)WordPress (Traditional)Ghost (Headless/Blog)Directus (Headless)
ArchitectureAPI-first, HeadlessMonolithic, Theme-basedAPI-driven (focused on blogs)API-first, Headless
DatabasePostgreSQL, MySQL, etc.MySQL/MariaDB onlySQLite, MySQL, PostgreSQLMultiple DBs
FrontendAny framework (React, Vue, Angular, static sites)Built-in PHP templatesAny frameworkAny framework
Custom APIsFully customizableLimited via pluginsLimited API optionsFully customizable
Programming LanguageJavaScript/TypeScriptPHPJavaScriptJavaScript/TypeScript
Admin UIModern, React-basedPHP-based, older UXMinimal, blog-focusedModern, Vue-based
Use CasesMulti-platform apps, e-commerce, content hubsBlogs, small to medium websitesBlogging, newslettersData-driven apps, dashboards

Best Use Cases for This Stack

  • Multi-channel publishing – Manage content once and publish to web, mobile, and digital signage.
  • E-commerce backend – Serve product catalogs to custom frontends (e.g., React storefronts).
  • Corporate portals – Secure internal content delivery with role-based access.
  • Custom applications – Build tailored APIs without starting from scratch.

Performance & Security Benefits

  • Nginx Reverse Proxy improves speed with caching and compression.
  • PM2 Process Management ensures zero downtime during deployments.
  • PostgreSQL handles complex queries and large datasets efficiently.
  • Let’s Encrypt SSL secures APIs without recurring certificate costs.
  • Rocky Linux 9 provides predictable updates and SELinux protection.

Step 1: Create a Rocky Linux 9 VPS on Shape.Host

Go to https://shape.host and log in.

Click “Create”, then select “Instance”.

Shape.host Resources dashboard with Create > Instance highlighted.

Choose the server location closest to your target audience.

Shape.host instance form with the data center location selector highlighted.

Select Rocky Linux 9 (64-bit) as the operating system.

Pick a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.

Shape.host instance form with the operating system image selector highlighted.

Click “Create Instance”.

Shape.host instance form with the Create Instance button highlighted.

Copy the IP address from the “Resources” section.

Shape.host Resources dashboard with the server IP address highlighted.

Step 2: Connect to the Server

ssh root@your-server-ip

Step 3: Update System and Install Base Packages

dnf update -y
dnf install curl wget nano unzip git -y
Terminal showing DNF/YUM package management commands and output.
Terminal showing DNF/YUM package management commands and output.

Step 4: Install and Configure PostgreSQL 16

Enable the PostgreSQL repository:

dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm -y
Terminal showing DNF/YUM package management commands and output.

Install PostgreSQL 16:

dnf install postgresql16 postgresql16-server postgresql16-contrib -y
Terminal showing DNF/YUM package management commands and output.

Initialize the database:

/usr/pgsql-16/bin/postgresql-16-setup initdb
Terminal showing PostgreSQL configuration commands for Strapi.

Enable and start PostgreSQL:

systemctl enable postgresql-16
systemctl start postgresql-16
Terminal showing systemd service management commands or output.

Log into PostgreSQL and create the database and user:

su - postgres -c psql

Inside the prompt:

CREATE DATABASE strapidb;
CREATE USER strapiuser WITH ENCRYPTED PASSWORD 'YourStrongPassword';
ALTER DATABASE strapidb OWNER TO strapiuser;
\q
Terminal showing SQL database and user configuration commands.

Step 5: Install Node.js 20 and NPM

curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
dnf install nodejs -y
node -v
npm -v
Terminal showing DNF/YUM package management commands and output.
Terminal showing DNF/YUM package management commands and output.
Terminal showing Node.js or npm version output.

Step 6: Create and Build Strapi Project

Create the Strapi app:

npm create strapi-app@latest my-project
Terminal showing npx commands or output during Create and Build Strapi Project.

(Optional) Update npm:

npm install -g npm@11.5.2
Terminal showing npm package installation messages.

Go to the project folder and build:

cd my-project
NODE_ENV=production npm run build
Terminal showing file and directory setup commands.

Install PostgreSQL support:

npm install pg
Terminal showing npm package installation messages.

Step 7: Install and Configure PM2

Install PM2 globally:

npm install -g pm2
Terminal showing npm package installation messages.

Create PM2 configuration:

nano ecosystem.config.js

Paste:

module.exports = {
  apps: [
    {
      name: 'strapi',
      cwd: '/root/my-project',
      script: 'npm',
      args: 'start',
      env: {
        NODE_ENV: 'production',
        HOST: '127.0.0.1',
        PORT: '1337',
        DATABASE_CLIENT: 'postgres',
        DATABASE_HOST: '127.0.0.1',
        DATABASE_PORT: '5432',
        DATABASE_NAME: 'strapidb',
        DATABASE_USERNAME: 'strapiuser',
        DATABASE_PASSWORD: 'YourStrongPassword'
      }
    }
  ]
};
Terminal showing the GNU nano editor and configuration text.

Start and enable PM2:

pm2 start ecosystem.config.js
pm2 startup
pm2 save
Terminal showing PM2 application process management output.
Terminal showing systemd service management commands or output.
Terminal showing PM2 application process management output.

Step 8: Install and Configure Nginx

dnf install nginx -y
Terminal showing DNF/YUM package management commands and output.

Create the reverse proxy configuration:

nano /etc/nginx/conf.d/strapi.conf

Paste:

server {
    listen 80;
    server_name your_domain.com;

    location / {
        proxy_pass http://127.0.0.1:1337;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_cache_bypass $http_upgrade;
    }
}
Terminal showing web server configuration text.

Enable and restart Nginx:

systemctl enable nginx
systemctl restart nginx
Terminal showing systemd service management commands or output.

Step 9: Install and Configure SSL with Let’s Encrypt

dnf install certbot python3-certbot-nginx -y
certbot --nginx -d rockylinux-tutorials.shape.host -m contact@shape.host --agree-tos --no-eff-email
Terminal showing DNF/YUM package management commands and output.
Terminal showing Certbot certificate commands and messages.

✅ Strapi CMS is now installed and running on Rocky Linux 9 with PostgreSQL, PM2, Nginx, and SSL.

You can access it at:

https://rockylinux-tutorials.shape.host
Strapi initial administrator registration form.
Strapi administrator welcome dashboard with project tools.

Use Shape.Host for fast and secure Linux SSD VPS hosting.