Quick answer
Build Astro on your computer and upload the generated static output to your domain’s document root. A static site does not need Node.js running on the hosting server. An Astro project that renders pages on demand needs a compatible server runtime and a different deployment plan.
Check the project before building
Use the project’s documented Astro and Node.js requirements, package.json scripts, and lockfile. Confirm that the project produces static HTML. Do not change an existing SSR project to static output without checking its routes, data fetching, forms, and authentication.
For a new site, ask your coding tool for a static Astro project and a list of features that require a backend. Keep secrets in protected local environment settings; values bundled into browser JavaScript are public.
Install dependencies and build locally
Open a terminal in the project directory. If it has a supported package-lock.json, npm ci installs the locked dependency set. A different package manager or a project without that lockfile needs its own documented install command.
npm ci
npm run build
npm run preview -- --host 127.0.0.1Preview the production output
Open the loopback URL printed by the preview command. Check the home page and a nested route directly, not just through navigation. Inspect images, fonts, links, and base paths for the intended domain or subdirectory. Stop the preview with Ctrl+C when finished.
For a conventional static Astro build, the public output is in dist. Confirm that directory in the actual project configuration. Deploy its contents, so the output’s index.html is at the domain root; keep source, node_modules, private environment files, and build tooling out of public web access.
Publish and verify
- Confirm the account’s document root and supported transfer method. Download the live files you will replace and check newer changes.
- Upload the contents of the static output through SFTP or available File Manager controls. Keep the output folder structure intact.
- Open the real HTTPS root and nested URLs. Confirm that assets load without local-development hostnames or mixed-content errors.
- Test the actual contact-form handler or other backend service separately. Static HTML alone does not deliver email, store submissions, or process payments.
When the export needs SSR
If the project uses on-demand rendering or a server adapter, ask support about the exact Node/application runtime, startup process, environment variables, and account limits before publishing. Jailed SSH does not guarantee a persistent application runtime. Do not run npm run dev as a public shared-hosting service.
Future edits and recovery
Keep the source project, lockfile, and published version together. Rebuild after source edits, preview again, and upload the reviewed output. If a release fails, restore the changed public files from the pre-release copy. Astro source files are normally edited in the project or an added CMS; uploading static output does not create a WordPress-style admin editor.
Related help
- Connect Codex to a cPanel website using a local SSH workflow
- Connect Claude Code to a cPanel website from your computer
- Publish an AI-generated static HTML website to cPanel
- Find the correct document root before an AI tool uploads files
- Check whether an exported website needs a server runtime before upload
Official references
Last content review: October 31, 2026. Check the version and features available in your own account.