How to Create a PostgreSQL Database in cPanel
Create a PostgreSQL database and user in cPanel with the wizard, connect your app on localhost, and manage and back up your database.
Run a Node.js app on cPanel hosting without a VPS: create the app in Setup Node.js App, upload your code, install packages, set environment variables and start it.
You can host a Node.js app on cPanel hosting without a VPS. In cPanel, open Setup Node.js App, create an application, choose the Node.js version, the folder for your code and the start file, then install your packages and start the app. At HostGrap, Node.js apps are supported on cPanel Plus and bigger plans in Europe and Singapore, on SL Plus and bigger plans on our Sri Lanka servers, and on every Business cPanel plan. This guide walks through each step.
Node.js apps are included on the plans in the table below. The smallest plans in each range, such as Core, SG Lite and SL Lite, run PHP websites such as WordPress, but not Node.js apps.
| Plan range | Node.js apps |
|---|---|
| cPanel hosting, Europe | Plus, Prime and Max |
| cPanel hosting, Singapore | SG Plus, SG Pro and SG Max |
| cPanel hosting, Sri Lanka | SL Plus, SL Pro and SL Max |
| Business cPanel hosting | Every plan |
If you are on a smaller plan, you can upgrade in your client area without losing your website or email.
cPanel suits websites and APIs built with frameworks such as Express, Next.js in server mode or Nuxt, small bots and dashboards. Your app runs behind the web server on your own domain or subdomain, with free SSL.
Shared hosting has limits, like any plan: your app shares the CPU and RAM of your account, and it can't keep long-running background jobs or listen on its own network ports. If your app needs root access, its own process manager, WebSockets at scale or software of your own, a VPS is the better fit. Read shared hosting vs VPS if you are not sure.
myapp. cPanel creates it in your home folder. Keep it outside public_html, so your source code isn't public.api.yourdomain.lk.app.js or server.js.Upload your code to the application root folder with File Manager, FTP or Git. Don't upload the node_modules folder: it is large and is created on the server instead.
Back in Setup Node.js App, open your app and click Run NPM Install. cPanel reads your package.json and installs the packages. You can also run npm install yourself in Terminal, after running the command cPanel showed you to enter the app's environment.
In your app's settings in Setup Node.js App, add each variable under Environment variables, such as NODE_ENV, DATABASE_URL or an API key, and click Save. Keep secrets here instead of in your code. Restart the app after changing them.
Click Start App, or Restart after you change your code or settings, and open the Application URL in your browser. Your startup file must start a web server. Use the port the platform gives your app in process.env.PORT, for example:
const express = require('express');
const app = express();
app.get('/', (req, res) => res.send('Hello from HostGrap'));
app.listen(process.env.PORT || 3000);If the page shows an error, check that the startup file name and the Node.js version are right, that npm install finished without errors, and that your app starts on your own computer with the same settings.
Yes. Every plan that runs Node.js also includes MySQL databases, and the Europe, Singapore and Business plans include PostgreSQL too. Create the database in cPanel and connect to it from your app on localhost. See how to create a PostgreSQL database in cPanel.
Need a hand? HostGrap AI on live chat or WhatsApp can turn on cPanel Terminal (SSH) and check your account's resource limits, and our team can help if your app doesn't start.
Create a PostgreSQL database and user in cPanel with the wizard, connect your app on localhost, and manage and back up your database.
Send automatic replies such as "We are away until Monday" from any email address in cPanel. Step by step with pictures, plus how to edit or turn it off.
Create an email address on your domain in cPanel in under a minute, and change its password later from Manage. Step by step, with pictures.