Node.js App setup guide

  1. From the cPanel SOFTWARE section, click the Setup Node.js App icon.
  1. Click the CREATE APPLICATION button. Complete the fields.
    In our example, we will be installing the application in /home/youraccount/myghostblog, and be serving it from, using Node.js version 10.
  1. Installation of the Ghost blog software must be done from the command line. SSH into your account, and enter this command (replacing your cPanel username and Application root as required).
    source /home/krystald/nodevenv/myghostblog/10/bin/activate && cd /home/krystald/myghostblog
    This will enter you into a virtual shell environment setup for the Node.js version your application uses. Entering the pwd command should show that you are now in the application's root directory.
    You'll see something like:
  2. Next, install the ghost-cli, a command line interface for managing ghost installations by typing the following:
    npm install ghost-cli@latest -g
    You'll see a response something like this:
    /home/krystald/nodevenv/myghostblog/10/lib/bin/ghost -> /home/krystald/nodevenv/myghostblog/10/lib/lib/node_modules/ghost-cli/bin/ghost
    + ghost-cli@1.11.0
    added 363 packages from 191 contributors in 27.297s
    The ghost binary (which is actually the ghost-cli binary) is installed. We will need your version of the path highlighted in bold from this response in a while, so make a note of it.
  3. Now, we must remove all files from the application root directory (/home/krystald/myghostblog) so it's empty again (otherwise ghost won't install in the next step). BE VERY CAREFUL to make sure you are in the correct directory - enter the pwd command again to make sure you are in the Application root directory before issuing the rm -rf * command
    You should see your application root path:
    Once the path is confirmed type the following to remove all the files:
    rm -rf *
  4. Now we are ready to install the ghost blog software itself. We don't want it to try and install nginx or MySQL, so we use the --no-setup option along with the ghost cli command we highlighted above.
    $ /home/krystald/nodevenv/myghostblog/10/lib/bin/ghost install local --no-setup
    You'll see a response something like this:
    ✔ Checking system Node.js version
    ✔ Checking current folder permissions
    ✔ Checking memory availability
    ✔ Checking for latest Ghost version
    ✔ Setting up install directory
    ✔ Downloading and installing Ghost v2.31.1
    ✔ Finishing install process
  5. This process can take a minute or two, so please be patient. Once installed, there are a few things we need to do in order to get Ghost running. Passenger, the software which allows your application to be served via LiteSpeed, requires the public directory exist in the Application root, so run the following commands:
    mkdir public
    chmod 755 public
  6. Type the following to view your Application root file structure:
    ls -la
    It should look something like this:
    drwxr-xr-x  5 krystald krystald  103 Oct  3 08:57 .
    drwx--x--x 24 krystald krystald 4096 Oct 3 08:53 ..
    drwxrwxr-x 8 krystald krystald 108 Oct 3 08:51 content
    lrwxrwxrwx 1 krystald krystald 42 Oct 3 08:53 current -> /home/krystald/myghostblog/versions/2.31.1
    -rw-rw-r-- 1 krystald krystald 60 Oct 3 08:53 .ghost-cli
    drwxr-xr-x 2 krystald krystald 10 Oct 3 08:57 public
    drwxrwxr-x 3 krystald krystald 27 Oct 3 08:51 versions
  7. Because ghost-cli installs the app into [Application root]/current, we need to create the default app.js file expected by Passenger and tell it where to find the Ghost application bootstrap file. Start Nano from the command line with:
    nano app.js
    once in nano, type the following as the first and only line
    const app = require('./current/index.js');
    Then, save the file by pressing Ctrl-x then capital Y to confirm, and hit enter to confirm the filename.
    We must setup a MySQL database and MySQL user using the tools within cPanel. This is covered in our separate guide on creating MySQL Databases and Users - link opens in a new window.
  8. The next step requires considerable editing, so you may want to edit the file locally using an editor of your choosing. Use your details for the paths as well as the MySQL database name, database user and password.
    Modify ./current/core/server/config/env/config.production.json so its contents are as follows (changing your domain as required):
    "server": {
    "host": "",
    "port": 2368
    "url": "",
    "database": {
    "client": "mysql",
    "connection": {
    "host": "localhost",
    "port": 3306,
    "user": "krystald_ghostdbuser",
    "password": "yourdbpassword",
    "database": "krystald_ghostdb"
    "mail": {
    "transport" : "Direct",
    "from": ""
    "paths": {
    "contentPath": "content/"
    "logging": {
    "level": "info",
    "rotation": {
    "enabled": true
    "transports": ["file", "stdout"]
  9. Once you have modified the above file and saved it, go back into the cPanel Node.js management screen, and restart the application using the Actions controls on the right hand side.
  10. If all is well, you should now be able to browse to your website at the URL you set the application up on, in our case,
  11. It may take a few moments for the application to start, during which time you may see the following message.
    This is normal. After a few moments you should be able to refresh the page and see your blog.
  12. To setup our blog, browse to (your URL will differ, depending on the URL you setup for the Application) - here you can setup your own admin login:
    Once you have setup your admin area, to get back to the admin login in future, simply append ghost to the end of your blog URL e.g.

How did we do?

Powered by HelpDocs
© Krystal Hosting Ltd 2003–2019