Skip to main content
Version: 1.2.0

Deploy to cPanel

cPanel is the most popular control panel in shared hosting. Please make sure your cPanel already support NodeJS.

Database

We assume that you already setup the database correctly. If not, please refer to this docs Restore Database.

Using default database with SQLite

You can skip to use database engine, like MySQL, MariaDB, PostgreSQL, etc.
Just using default database SQLite, it's enough for small website.

Preparation

  1. Edit the config.js file, then change this part with your domain or subdomain, in this case I'll using my subdomain sso.sail-it.id.
config.js
 // WEBSITE
// This is the base url, used for template engine
// Change with your domain without trailing slash.
// Example : https://yourdomain.com
baseUrl: 'https://sso.sail-it.id',
baseAssetsUrl: 'https://sso.sail-it.id',
siteName: 'OpenSSO',
  1. Then save it.
  2. Now select all files then compressed to zip, give it name app.zip.
  3. Done.
node_modules

You are able to install node_modules locally then zip all and upload it to your cPanel.
But npm install from NodeJS App cPanel are recommended.

Upload to hosting

  1. Go to your cPanel and look for File Manager.
  2. Create new folder name app on root.
  3. Go inside app folder, then click Upload button at top left.
    Then you will being redirected to the new page for upload, now choose your zip file and start upload it.

    When the upload complete, you can close it page and back to File Manager.
  4. Click Reload button then you will see your app.zip file on there.
    Now right click on that file, then choose Extract.

    Just type /app on it, then click Extract Files.

    When the extract successfuly, it will shown like this below

    Just click Close and click Reload button again. Then you will see app files already extracted.
  5. Done, you can close the File Manager page.

Setup NodeJS App

  1. Go to your cPanel again.
  2. Look for Setup NodeJS App then click CREATE APPLICATION button.
  3. Configuration should look like this below, then click CREATE button
  4. Then click Start App, if there is no error, the button will display like this below
  5. Done, now try to visit the website.
Troubleshoot

If you found a blank white screen, then it might be:

  • Some of hosting provider is having issue with SQLite support for NodeJS.
  • or might be the library was broken or permissions issue.

The solution is:

  1. You have to choose other database except SQLite, i.e MySQL or PostgreSQL.
  2. Remove library sqlite3 from package by running npm remove sqlite3.
  3. More details configuration, please read here >> Configuration Database.

Create Admin User

If everything is running well, then let's create a first user as Admin.

  1. Just go to Sign Up page.
  2. Fill the form and click Sign Up button.
  3. Done, the first user will get admin user automatically.