cPanel/JethostNodeApp
cPanel module

JethostNodeApp

5 functions, invoked through the cpanel_uapi tool.

scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="JethostNodeApp", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

configure_app POST#

Set environment variables, mode, or startup file for a Node.js application.

updates config by app_root; supply at least one of env_vars/app_mode/startup_file (none = error); changes apply on next restart. Does NOT change Node version or install dependencies.

app_rootstringRequired
app_modestringOptional
production | development.
startup_filestringOptional
entry file relative to app_root (e.g. app.js), no ...
env_varsstringOptional
env vars as a JSON-object STRING (e.g. {"NODE_ENV":"production","PORT":"3000"}); replaces the current set; string values; applies after restart.

control_app POST#

Start, restart, or stop a Node.js application.

changes running state by app_root; restart after a deploy or env change so Passenger reloads. Verify via list_apps app_status.

actionstringRequired
start | restart | stop.
app_rootstringRequired
as above.

create_app POST#

Register a new Node.js application.

registers the app and provisions ~/nodevenv/<app_root>/<version>/; does NOT deploy code or install dependencies. Follow with a deploy step. Target domain must exist on and be owned by the account. Creating a second app at the same app_root fails — call list_apps first. For LARGE apps, deploy a PREBUILT app: run npm install and any build step locally or in CI and upload the resulting built/bundled output via deploy_site_from_url or a private git repo + .cpanel.yml — large dependency trees frequently cannot be installed or built on the server (time/resource limits). A bundled production build is self-contained, so node_modules does not need to be uploaded. Do not rely on server-side dependency install (provision_node_dependencies) for large projects.

app_rootstringRequired
path relative to home (e.g. apps/myapi), never absolute, no .., charset [A-Za-z0-9._/-]; the stable app identifier.
domainstringRequired
a domain/subdomain owned by the account (verify via list_website_domains); unowned domains are rejected.
app_uristringRequired
URI path under the domain, no leading slash (apihttps://<domain>/api); empty string serves at root.
versionstringRequired
Node.js version; major-only (20) or full (20.20.2); must be an available server version; no server default so required.

destroy_app POST#

Unregister (delete) a Node.js application.

permanently unregisters the app at app_root and removes its virtualenv; destructive/irreversible — confirm with the user. Does NOT delete source code under app_root. Separate from control_app so it is independently gateable.

app_rootstringRequired

list_apps GET#

List this account's Node.js applications.

returns every registered Node.js app flattened from Selector state, each with app_root (the identifier used by all other functions), domain, app_uri, version, app_status, app_mode, startup_file, env_vars, and virtualenv activate path. Call FIRST to discover apps and check status. An app appears here as soon as created, even before code/deps are deployed.

No parameters.