My customer accountContact commercialWebmailOVHcloud Blog

Welcome to OVHcloud.

Log in to order, manage your products and services, and track your orders

Log in

Install Strapi on your POWER web hosting plan

Find out how to install Strapi headless CMS on your POWER web hosting plan

Last updated 4th February 2021

Objective

You've subscribed to a Web POWER web hosting plan to deploy Node.js applications, and you want to deploy Strapi headless CMS on it.

This guide will explain how to do it.

Find out how to install Strapi on your POWER web hosting plan.

Requirements

If you have just started to use your Web POWER web hosting plan, we suggest to have a look at our Getting started with a POWER web hosting plan guide before going further.

Instructions

Let's suppose you have the default configuration for Node.js hosting:

  • Runtime: nodejs 14
  • Entrypoint: index.js
  • DocumentRoot: www

To verify your configuration, you can use the Retrieve active configuration API endpoint.

Connect via SSH to your POWER web hosting. Let's begin by cleaning the www folder and installing Strapi:

rm -rf www
npx create-strapi-app www --quickstart --no-run

Now let's go into the www folder and create the entrypoint index.js:

const strapi = require('strapi');

strapi(/* {...} */).start();

Build admin UI site :

cd www
yarn build

Create also an .htaccess file to manage HTTPS redirection:

RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Then restart your instance and your Strapi headless CMS will be online.

Strapi

Terminal output:

 ~ $ rm -rf www

~ $ npx create-strapi-app www --quickstart --no-run
npx: 91 installed in 6.741s
Creating a new Strapi application at /home/user/www.
Creating a quickstart project.
Creating files.
Dependencies installed successfully.
[...]

~ $ cat << 'EOF' > www/index.js
const strapi = require('strapi');

strapi(/* {...} */).start();
EOF
~ $ cat << 'EOF' > www/.htaccess
RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
EOF

~/www $ mkdir -p tmp

~/www $ touch tmp/restart.txt

Go further

Join our community of users on https://community.ovh.com/en/.

Join our Gitter room to discuss directly with the POWER Web Hosting team and the other users of this lab.


Did you find this guide useful?

Please feel free to give any suggestions in order to improve this documentation.

Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.

Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.

Thank you. Your feedback has been received.


These guides might also interest you...

OVHcloud Community

Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Discuss with the OVHcloud community

In accordance with the 2006/112/CE Directive, modified on 01/01/2015, prices exclude VAT. VAT may vary according to the customer's country of residence.