Skip to content

AI & MCP

AI Deploy

Copy page

Deploy Node.js and Next.js apps to your own Hostino Node.js hosting straight from Claude Code and Cursor

With AI Deploy, your AI tool (Claude Code, Cursor or any MCP client) publishes a Node.js or Next.js project straight to your own Hostino Node.js hosting. The app runs inside your own cPanel account: no separate container, no manual upload, no “Setup Node.js App” clicking in cPanel.

Quick start (3 steps)

  1. Have an active Node.js hosting service. If you don’t, ask the tool for a plan suggestion (list_plans with category nodejs_hosting) or buy one on the Node.js hosting page.
  2. Connect Remote MCP (Claude Code, Cursor). If you connected before, re-authenticate once to approve deploy:read and deploy:write (in Claude Code: /mcp → hostino → Re-authenticate).
  3. In your project folder, say: “Deploy this project to my Node.js hosting.”

The tool finds the service, packs and uploads the project, follows the status until live, and gives you the site URL.

What happens behind the scenes

  1. Pick a target: list_deploy_targets returns your Node.js services.
  2. Start the deployment: create_deployment returns a single-use upload link (15 minutes) and the exact upload command, which the tool runs in the project root. node_modules, .next, .git and .env* files are not uploaded.
  3. Make room: failed and old releases and caches are cleaned up so the plan’s disk has enough space.
  4. Install and build on the server: dependencies are installed and the build script runs if you have one — all in a separate folder; the current site keeps serving the whole time.
  5. Switch and health check: the new version is swapped in within milliseconds and checked. If it doesn’t come up, the previous version is restored automatically and the reason is in the logs.
  6. Follow up: get_deployment_status until live or failed. On failure, the status answer already includes a diagnosis (cause and fix), and analyze_deployment and get_deployment_logs give more detail.

Project requirements

ItemDetails
package.jsonMust be at the project root
Node version18, 20 or 22 (default 20) — choose with node_version
Next.jsWorks with no configuration (Pages Router and App Router). No custom server needed
Node.js (Express, Fastify, …)Entry file from main in package.json, or one of server.js, index.js, app.js (and their .mjs variants). The app must listen on process.env.PORT
Buildscripts.build runs if present
package-lock.jsonStrongly recommended: installs come from an in-country mirror and are faster, and later deploys skip installing entirely when dependencies haven’t changed
public/ filesServed by the app itself; /_next/static is served directly by the web server

Multiple apps, subdomains and paths

  • By default the app is published on the service’s main domain.
  • Use domain to pick another domain or a subdomain of the same cPanel account (create the subdomain in cPanel first).
  • Use app_uri to publish on a path, e.g. api → https://example.com/api/.
  • One account can run several apps with different names (app_name). Deploying again with the same app_name updates that app.
  • If a path already runs an app you created manually in cPanel, AI Deploy leaves it alone and returns domain_has_other_app.

Tools

ToolPermissionWhat it does
list_deploy_targetsdeploy:readServices that can run a Node.js app, and the apps on each
get_serviceservices:readOne service’s details: deploy capability, direct cPanel login, apps
create_deploymentdeploy:writeStart a deployment; input: service_id, app_name, optional domain, app_uri, node_version
get_deployment_statusdeploy:readuploading → extracting → building → activating → live or failed
get_deployment_logsdeploy:readInstall/build output and the app’s runtime log
analyze_deploymentdeploy:readAnalyze a failed deploy: cause, evidence from the logs and a concrete fix (read-only)
list_appsdeploy:readApps, domain/path, Node version and environment variable names
set_app_envdeploy:writeSet/remove environment variables; the app restarts automatically
create_app_databasedeploy:writeCreate a MySQL database for the app (once per app)
rollback_deploymentdeploy:writeInstantly switch back to the previous successful version (no rebuild)
restart_appdeploy:writeRestart the app
open_cpanelhosting:loginShort-lived, single-use direct cPanel login link (all your hosting, not only Node.js)

Environment variables and secrets

  • Don’t put secrets in code or .env (.env* files are not uploaded); set them with set_app_env. Values are stored encrypted and no tool returns them.
  • Reserved names (PORT, NODE_ENV, PATH, NODE_OPTIONS, …) can’t be set.
  • NEXT_PUBLIC_* variables are baked in at build time; redeploy after changing them.
  • Both ways work together: variables you set yourself in cPanel (“Setup Node.js App”) are kept by deploys and set_app_env, and the tool’s variables are added on top. If a name exists in both, the tool’s value applies. Removing with set_app_env only removes the tool’s own variables.

Database

If the app needs a database, ask the tool to “create a database for this app”. create_app_database creates a MySQL database and its user inside the same cPanel account and sets the connection details on the app as encrypted environment variables:

VariableValue
DATABASE_URLmysql://USER:PASSWORD@localhost:3306/DBNAME
DB_HOST / DB_PORTlocalhost / 3306
DB_NAME / DB_USER / DB_PASSWORDDatabase name, user and password

The app restarts after the database is created. The password is never shown in the tool output. In code, use process.env.DATABASE_URL with mysql2, Prisma or Drizzle. You can also see the database in cPanel’s phpMyAdmin.

Timing

CaseApproximate time (small Next.js app, Eco plan)
First deploy (full dependency install)about 2–3 minutes
Next deploy with the same package-lock.jsonabout 1 minute (dependencies are not reinstalled)
Rollbacka few seconds
Node.js app without heavy dependenciesabout 15 seconds

Larger projects take longer; higher plans have faster disks.

When a deploy fails

You don’t have to read the logs yourself. analyze_deployment matches the error and the build and runtime logs against known causes on Hostino Node.js hosting and returns, for each, the cause, the matching log line and a concrete fix. For a failed deploy the same findings are in the diagnosis field of get_deployment_status, so the tool usually knows the cause without an extra call. The analysis runs on Hostino’s side; logs are not sent anywhere else.

CauseSign in the logUsual fix
Missing packageCannot find module '…'Add the package to dependencies (not devDependencies) and commit package-lock.json too
Letter case in an importCan't resolve './Components/…'Linux is case-sensitive; write the import path exactly like the file name
Node.js versionUnsupported engineDeploy again with node_version 22 (or the version in engines)
Memory / process limitJavaScript heap out of memory, EAGAINMake the build lighter, set NODE_OPTIONS=--max-old-space-size=768, or upgrade the plan
Fixed portEADDRINUSEListen on process.env.PORT
Missing environment variable… is not defined / must be setSet it with set_app_env
TypeScript or syntax errorType error:, SyntaxError:Fix the file and line shown
npm networkETIMEDOUT, fetch failedCommit package-lock.json so the in-country npm mirror is used

Other recognized causes: conflicting package versions (ERESOLVE), a full disk, a missing build script or start file, Next.js starting without a build, and database connection errors. Example: “The last deploy failed; find the cause, fix the project and deploy again.”

Errors and fixes

Error codeMeaningWhat to do
install_failedInstalling dependencies failedRead get_deployment_logs; usually an incompatible version or a private package
build_failednpm run build failedRead the build log and fix the code error
build_out_of_memoryThe build hit the plan’s RAM limitMake the project lighter or use a higher plan
disk_quota_exceededThe account’s disk is fullDelete unneeded files in the account or use a plan with more disk
health_check_failedThe app didn’t respond after starting (previous version restored)Check the runtime log; make sure it listens on process.env.PORT
domain_not_ownedThe domain/subdomain isn’t on this accountAdd it in this service’s cPanel
domain_has_other_appThat path runs an app created manuallyUse another path or subdomain
archive_rejectedArchive has symlinks, .. paths or special files, or no package.json at the rootUpload from the project root with the suggested command
upload_too_largeOver 50 MBExclude node_modules, build output and large files
deployment_in_progressAnother deployment is runningWait for it to finish
service_not_active / service_not_foundThe service isn’t active or isn’t yoursRenew it or use the right ID

Limits

  • Uploads up to 50 MB (without node_modules).
  • Build and runtime use your plan’s resources. Disk speed by plan: Eco 10, Base 20, Pro 30 and Max 50 MB/s.
  • Besides the live version, one previous version is kept for rollback. If disk space is short, the previous version is removed to make room for the new build, and the deployment status says so.

Direct cPanel login

open_cpanel does what the panel’s “Log in to cPanel” button does and works for all your hosting. Because the link grants full access, hosting:login is a separate permission shown with a warning on the consent screen. Open the link yourself, in your own browser.

Security

  • Ownership: only your own services can be targeted; identity comes only from your login token, never from tool input.
  • No root access: everything runs as your own cPanel user inside your account’s isolated environment.
  • Dedicated key: each service gets its own SSH key that only works from Hostino’s server and only for running commands. Your own SSH keys are left untouched.
  • Archives: symlinks, ../absolute paths and special files are rejected before anything reaches the server.
  • Internal files: only /_next/static is published; server code, build output and logs are not reachable from the web.
  • Supply chain: the in-country mirror is used only when you have a package-lock.json; npm checks every package’s sha512 hash against the lockfile, so the mirror cannot swap a package.

FAQ

Are npm packages installed every time? Isn’t Node.js already on the server? Node.js itself (18/20/22) is installed on the server and is never installed by a deploy. But each project’s dependencies (next, react, …) are specific to that project and its versions, so they’re installed once per project. When package-lock.json and the Node version don’t change, later deploys don’t reinstall them; they reuse the previous version’s packages (without using extra disk space).

What does AI Deploy change in my cPanel account? The first time: SSH access for the account is enabled (inside the isolated environment) and a dedicated key is added. Apps live in ~/hostino-apps/<name> and also appear in cPanel’s “Setup Node.js App”.

Can I manage the app from cPanel later? Yes. The app runs on cPanel’s own Node.js feature. In “Setup Node.js App” you can see its status, stop/start/restart it and add environment variables (kept by later deploys). Just don’t edit the app’s files by hand: every deploy is a fresh copy of your project’s source and sets manual file edits aside. Change the Node version with node_version when deploying.

What about an app I created manually in cPanel? It’s left untouched. AI Deploy only changes apps it created itself.

Example prompts

  • “Deploy this Next.js project to my Node.js hosting.”
  • “Deploy the app on the subdomain app.example.com with Node 22.”
  • “Publish an Express API on the /api path.”
  • “The last deploy failed; find the cause with analyze_deployment and fix it.”
  • “Set DATABASE_URL for the app.”
  • “Roll back to the previous version.”
  • “Give me a cPanel login link.”

Next steps