How to install Gridsome on cPanel shared hosting

How to install Gridsome on cPanel shared hosting

Gridsome is a Vue.js static site generaqtor that requires yarn, nodejs and NPM in order to generate website files.

I recommend using two separate devices, one on which you develop the site and another where it will bi published. But, if you for some reason want to use cPanel to both develop the website and publish it, here is how to do it:

1. Create a new Node.js app in cPanel

Make sure to select Node.js >=14

chrome OYj66duk6t - How to install Gridsome on cPanel shared hosting

2. Upload Gridsome files to the folder

In this case, I will use the Gridsome docs website and upload it to the application root/public:

chrome MaJW7dPYJh - How to install Gridsome on cPanel shared hostingchrome qBt3z9FANL - How to install Gridsome on cPanel shared hosting

3. Open the terminal

Enter terminal and paste the command that you see on top of the Node.js create app page:

source /home/XXXX/nodevenv/plugins.club/app/10/bin/activate && cd /home/XXXXX/plugins.club/app

Install yarn with the command:

curl -o- -L https://yarnpkg.com/install.sh | bash

Enter the public folder:

yarn global add @gridsome/cli

Install required modules

npm install

Enter the public folder and run yarn build

cd public/ && yarn build

This will create a new directory /dist and output all the static files in it.

chrome 6u2HXJHXA3 - How to install Gridsome on cPanel shared hosting


I recommend using Git + Netlify for easier publishing. 🙂

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.