How to Deploy Strapi MySQL on a Traditional Hosting Provider

If you have a Strapi app you want to deploy but are uninterested in the multiple cloud or VPS options and want to use a shared hosting package instead, this article is for you.


This is a companion discussion topic for the original entry at https://strapi.io/blog/deploying-strapi-my-sql-on-a-traditional-hosting-provider

Hello,

I got some error when running NODE_ENV=production run build.

In my terminal it said jailshell: run: command not found

Can you help me why that error happen ?

Thanks.

Hi @nicswebdev. that was a bit of an oversight, I apologize. the command is

NODE_ENV=production npm run build

Hello @Ashimi.0x

Thanks for your feedback.

I have some questions again.

  1. I think after git clone we need to rum npm install. Is that right ?
  2. After run nano database.js we need to edit the database credentials same with we setup on cpanel right ?
  3. After run nano .env what should we do after that ?

Sorry if I have several questions to you.

Thanks.

You then have to run ```
NODE_ENV=production run build

Hello,

I’m sorry I don’t understand what you mean. Can you tell a little bit more ?

Thanks

Do you think a google meet will be helpful ?

Hello,

Yes google meet it will be very helpful if you don’t mind. But, if you don’t have same time with me maybe can you record some video ? It will be very helpful to other people too when we share the video recording.

Thanks

Basically, you are to define your environment after using nano .env then you run NODE_ENV=production run build. I will like to better understand your challenge hence the google meet. what’ 's your time right now? can you message me on discord? Ashimi#4138

It’s 6.40PM in my place now. I already add you on discord.

Alright. let’s converse better there.

Hi @Ashimi.0x

Are you still online ? I want to continue the deployment process.

Thanks

By copying the whole project to the Public_html directory, don’t you allow access to the project credentials? Someone could navigate to yourwebsite.com/config/database.js and yourwebsite.com/.env. This would be a considerable security risk as this is where your credentials are located.

hello there, i’ve already add your discord, can you confirm that ?

Hello, I got some error when running NODE_ENV=production run build.

    /node_modules/.bin/strapi: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! herat-exchange-app-backend@0.1.0 build: `strapi build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the herat-exchange-app-backend@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /.npm/_logs/2022-12-29T12_07_32_897Z-debug.log

Can you help me understand why that error happens?

Thanks

1 Like

Hello,

I’m at this point in your tutorial:

Proceed to Phpmyadmin on your Cpanel. Locate your database and import your local SQL file.

I’ve got my new database in PHPMyAdmin on the CPanel, but I’m unclear where I should find my local SQL file to import. Would this be saved within the Strapi project? I imagine its a schema I need to put in as a template, correct?

Thanks in advance for your help

And what about FE part? How to deploy that?

When i tried to follow this my website just ended up rending this:
“It works! NodeJS 12.22.9”

This is an older article, we should see if the author can updated. In the mean time I will go through the steps and see if I can figure out some of the issues folks are having.