콘텐츠로 이동

Deploy your Astro Site to Hostinger

이 콘텐츠는 아직 번역되지 않았습니다.

Hostinger is a web hosting provider that supports static sites and Node.js applications.

This guide covers deploying both static and server-rendered Astro projects to Hostinger using hPanel.

  • A Hostinger account with an active hosting plan.
    • Static site deployment is supported on all plans that include hPanel.
    • Server-rendered deployment requires a plan that supports Node.js applications, such as Business Web Hosting or Cloud hosting.
  • An Astro project ready to deploy.

Astro projects use output: 'static' by default, so no additional configuration is required to deploy a static site.

You can upload the contents of your dist/ folder to Hostinger using either the hPanel File Manager or an FTP client.

  1. Build your Astro project locally:

    Terminal window
    npm run build
  2. Log in to hPanel and open your website.

  3. Open Files > File Manager and navigate to the public_html directory.

  4. Upload the contents of your local dist/ folder into public_html. You can drag and drop files, or upload an archive and extract it in place.

  5. Visit your domain to confirm your site is live.

  1. In hPanel, go to Files > FTP Accounts to find or create your FTP credentials.

  2. Connect to your hosting account using an FTP client such as FileZilla.

  3. Upload the contents of your local dist/ folder to the public_html directory on the server.

  4. Visit your domain to confirm your site is live.

For on-demand rendering, deploy your Astro project as a Node.js application on a Hostinger plan that supports Node.js.

Add the Node.js adapter to enable on-demand rendering with the following astro add command:

Terminal window
npx astro add node
See the Node.js adapter guide for additional configuration options.

Make sure your package.json has a start script that runs the built server:

package.json
"scripts": {
"start": "node ./dist/server/entry.mjs"
}
  1. Push your Astro project to a GitHub, GitLab, or Bitbucket repository.

  2. Log in to hPanel and go to Websites.

  3. Add a new website and select the Node.js application option.

  4. Connect your Git provider and select your repository and branch.

  5. Configure the build settings:

    • Build command: npm run build
    • Start command: npm run start
  6. Select a Node.js version that satisfies Astro’s minimum requirement (Node.js 22 or later).

  7. Start the deployment. Hostinger will install dependencies, run your build command, and start the application.

  1. Build your Astro project locally, then upload the generated dist/ folder along with package.json and the lock file (e.g. package-lock.json).

  2. In hPanel, add a new website and select the Node.js application option.

  3. Upload your project files (or a .zip archive) using the File Manager.

  4. Configure the application:

    • Application root: the folder containing your package.json.
    • Start command: npm run start
  5. Select a supported Node.js version and start the application.

더 많은 배포 가이드

기여하기 커뮤니티 후원하기