Explore the Nex ecosystem Editor. Framework. One workflow. ↗
DEPLOYMENT GUIDE / CPANEL

From a local project
to a live website.

Host Nex on cPanel: choose a supported runtime, export the package, configure the application and test your domain.

Node.js 22+PHP-CGI for MVCPHP/Apache alternative
01 / BEFORE YOU START

Choose a target your host supports.

cPanel is a hosting control panel. Node.js, Passenger, PHP-CGI and private-directory access depend on your plan and provider configuration.

Nex export targetPrerequisitesUse when
node-nex · defaultNode.js 22+, Application Manager or Setup Node.js App. PHP/MVC projects also need PHP-CGI 8.2+ with OpenSSL and permission to spawn child processes.Your hosting supports running Node applications and PHP-CGI.
php-apache · compatibilityPHP 8.2+ with OpenSSL, Apache/mod_rewrite or compatible LiteSpeed, and access to a private directory outside the document root.You are not using a Node application and the host meets the PHP/Apache requirements.

This Nex website uses PHP views. If you choose the Node target, PHP-CGI is still required. Node does not translate PHP into JavaScript. Static-only hosting cannot run this project.

Confirm with your hosting provider

  • Are Node.js 22+ and the application interface available?
  • Can the Node application spawn PHP-CGI child processes? What is the correct executable path?
  • Can the runtime read private directories and write to the application's storage/database directories?
  • How are Passenger, reverse proxying, HTTPS and application logs managed for your account?

This tutorial explains configuration. Opening this page does not export files, access a cPanel account or publish a website automatically.

02 / IN NEXSOURCECODE

Prepare the correct deployment package.

  1. Save all source changes and test important routes with nex dev locally.
  2. Open File → Export hosting ZIP. This is different from Export separate sheets.
  3. Select Native Nex Node (node-nex) or PHP/Apache (php-apache) based on your hosting checks.
  4. Use Base URL / for the domain/subdomain root. For https://example.com/nex/, use /nex/ and match the hosting application path.
  5. Review the compatibility report. For database applications, include only the required NexSQL backend aliases/snapshots already configured in the application.
  6. Choose the ZIP destination, then read PANDUAN-HOSTING.md, INSTALL.md, and deployment-report.json for that package.

Through MCP, nex_hosting_plan can inspect the target, requirements, revision and tutorial without returning source or secrets. ZIP creation and destination selection remain application UI actions.

The ZIP is a standard archive containing private deployment configuration and keys; it is not automatically password protected. Store and transfer it privately. Never expose the ZIP or private directory at a public URL.

03 / FILE MANAGER

Upload the complete package privately.

The following example applies to the native Node target. In cPanel, open File Manager, go to your account's home directory and create an application directory outside the public document root.

Example Node target structure
/home/USERNAME/nexsite/
├── app.js                    # Node application startup
├── package.json              # npm start
├── public_html/              # package PHP adapter
├── nex-private-XXXXXXXX/     # actual name follows the ZIP
│   ├── containers/           # encrypted .nexcl / .nexsv
│   └── ...                   # runtime & private configuration
├── INSTALL.md
├── PANDUAN-HOSTING.md
└── deployment-report.json
  1. Upload the ZIP into that private directory and choose Extract.
  2. Make sure app.js and package.json are directly inside the application root, not an extra nested directory.
  3. Enable Settings → Show Hidden Files to see .htaccess if needed.
  4. Keep the package's folder names and relationships intact. Keep a private ZIP backup or remove the uploaded copy after extraction and verification.

For the Node target, do not move only the contents of public_html to the domain. Passenger runs app.js from the application root; public_html/index.php in the Node package is a PHP-CGI adapter, not the Node startup file.

If Node/PHP runs under the same account, private directories can typically use 0700 and key/config files 0600. Match user/group access to your provider's setup; do not use 0777 as a shortcut.

04 / NODE NATIVE

Configure the application in cPanel.

On CloudLinux, open Software → Setup Node.js App → Create Application. If your cPanel uses Application Manager, register the uploaded application and match the domain, application path and deployment environment. The interfaces differ; follow the options your host provides.

Setup Node.js App fieldExample valueExplanation
Node.js version22 or newerSelect a version available and supported by your host.
Application modeProductionDo not run a development runtime on a public website.
Application rootnexsiteRelative to the account home; the directory must contain app.js directly.
Application URLnex.example.comSelect a domain/subdomain you control. This is an example, not a live domain.
URL pathEmpty for the domain rootMatch Base URL / in the export. For a subdirectory, match the prefix and proxy rules.
Application startup fileapp.jsNot index.php or a .nexcl/.nexsv file.
  1. Make sure the domain/subdomain is registered under Domains and DNS points to your hosting.
  2. Complete the form and click Create or Deploy/Register as provided by your panel.
  3. If Application Manager has no startup field, make sure app.js exists in the application path. For custom startup settings, follow your provider's Passenger configuration.
  4. Continue with environment settings, then save and restart the application.

The Nex launcher uses built-in Node modules and does not require npm install for external dependencies. Use the panel's Start/Restart controls. Do not launch an additional npm start process if Passenger already manages the application.

05 / ADD VARIABLE

Configure the hosting process environment.

On the application configuration page, use Environment variables → Add Variable. Enter Name and Value in separate fields.

NameExample ValueNotes
NODE_ENVproductionThis may follow Application mode; make sure the process is in production mode.
NEX_ALLOWED_HOSTSnex.example.comExact hosts only, without https://, paths, quotation marks or wildcards. Separate multiple hosts with commas.
PHP_CGI_BINARY/opt/cpanel/ea-php84/root/usr/bin/php-cgiExample path only. Confirm the actual executable with your provider; required for PHP/MVC.
PORT / HOSTFollow your provider's Passenger configurationDo not choose a random port or store PORT=0 in the panel.

Click Save, then Restart. Variables set using export in Terminal apply only to that shell session, not automatically to Passenger.

Check the PHP-CGI version if Terminal is available

Use the path confirmed by your provider, then run:

Example PHP-CGI executable check
/opt/cpanel/ea-php84/root/usr/bin/php-cgi -v

The output must identify the SAPI as cgi-fcgi, not cli, with PHP 8.2+ and OpenSSL support. Changing the version in MultiPHP Manager does not automatically change the Node application's PHP-CGI path.

Server runtime environment is separate from public website input. Never paste passwords, tokens, nexsh contents, private configuration or deployment keys into tutorials, public screenshots or AI chats.

06 / ALTERNATIVE TARGET

Using the PHP/Apache target.

Use this section only for a ZIP exported as php-apache. Do not mix these instructions with a Node target package.

  1. Make sure PHP 8.2+ and OpenSSL are enabled. Use MultiPHP Manager or your host's PHP Selector to choose the domain's PHP version.
  2. Extract the package into a private location. Keep the nex-private-<id> directory outside the domain's document root.
  3. Place the contents of the exported public directory (index.php and .htaccess) in the correct domain/subdomain document root.
  4. Check that the loader's private path matches the folder location. For custom layouts, adjust only the $private reference according to the package's INSTALL.md . Do not move keys into a public directory.
  5. Make sure Apache/LiteSpeed rewriting is active, .htaccess was uploaded, and open_basedir permits access to the private directory.
  6. Enable HTTPS and check routes and assets using the following test steps.
Example public/private separation
/home/USERNAME/
├── public_html/             # example document root
│   ├── index.php
│   └── .htaccess
└── nex-private-XXXXXXXX/     # private, not publicly downloadable

A subdomain document root may differ from public_html. Use the actual path shown in cPanel Domains. For a subdirectory Base URL, follow the layout and path references in the package guide.

Nginx/IIS needs administrator-managed front-controller configuration; PHP availability alone does not mean Apache rules will work.

07 / BEFORE GOING LIVE

Verify your public domain.

  1. Open your HTTPS domain, for example https://nex.example.com/. The server's 127.0.0.1 address is internal, not a visitor-facing URL.
  2. Test the home page, /panduan, /unduh, and /panduan/hosting on this website. Keep the Download button disabled because no release is available yet.
  3. Test CSS/JavaScript, the mobile menu, code tabs, guide search and copy controls. Also refresh routes other than the home page.
  4. For applications with accounts/databases, test login, HTTPS cookies, roles, CSRF, and data reads/writes in an appropriate test environment.
  5. Make sure the ZIP, private directory, configuration, nexsh, containers and databases cannot be downloaded over HTTP. Check rejection status without sharing secret contents or screenshots.
  6. Review logs through cPanel or private access. Set up monitoring and backups appropriate for your project.

PHP/MVC on the Node target has adapter limits of 4 concurrent PHP requests, an 8 MB body and a 30-second timeout. Test realistic loads; working locally does not certify every shared host.

08 / AFTER GOING LIVE

Update source without replacing production data.

  1. Back up production packages, keys/configuration, databases, uploads and storage through a private, recoverable process.
  2. Test the new package on staging. Use a consistent set of containers, runtime and configuration from the export.
  3. Check whether the package includes a local database snapshot. Do not replace the production database with a local snapshot without an intentional migration plan.
  4. Preserve directory permissions, environment, backend aliases and key/container relationships during deployment. Migrate uploads/storage/legacy SQL files separately when needed.
  5. Restart the Node application through the panel after updating, then test again. For PHP/Apache, check runtime loading using your provider's process.
  6. If verification fails, restore the appropriate backup. Never disable authentication or Host/Origin guards to hide a deployment issue.

Local and hosted databases do not synchronize automatically. A source export is not a complete backup of all production runtime data.

09 / TROUBLESHOOTING

Start with the symptom you see.

SymptomWhat to check
Node.js menu is missingConfirm available features with the provider. Consider php-apache if its requirements are met; installing server-wide Node is not a regular cPanel user's task.
Startup failure / 503Node 22+, application root, app.js, package integrity, Passenger logs, resource limits, PHP-CGI and child-process permissions.
403 ForbiddenMatch NEX_ALLOWED_HOSTS to the actual domain and Origin. Use the current exported runtime for external navigation; do not add wildcards or disable guards.
404 / route refresh failsBase URL, Application URL/path, proxy/rewrite rules, .htaccess and virtual mappings in deployment-report.json.
CSS/JS is missingBase path, Blueprint asset connections, asset network responses and domain paths. Private containers are not static assets to link to.
500 / 502 / 504Private provider/PHP logs, PHP-CGI rather than CLI, OpenSSL, storage/database permissions, child processes and timeout/body limits.
NexSQL failsIncluded backend aliases, database file permissions, service connections and package configuration. Editor admin accounts are separate from backend accounts.
Login/session issuesHTTPS/proxy settings, cookie domain, sessions and CSRF. Do not disable authentication protections to fix a configuration issue.

When asking your provider for help, include the domain, incident time, HTTP status and a sanitized log summary. Remove passwords, tokens, session cookies, keys and private configuration contents.

10 / REFERENCES

Follow your package's own guide.

Nex requirements and formats on this page follow the Nex exporter documentation and the tutorial returned by nex_hosting_plan. INSTALL.md and PANDUAN-HOSTING.md inside the ZIP describe your package's directory names and Base URL.

Interface documentation checked on November 13, 2026. Menus, versions and permissions vary by provider. This website does not access cPanel or store hosting credentials.

← Back to getting started