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.
Prerequisites
Section titled “Prerequisites”- 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.
Static site deployment
Section titled “Static site deployment”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.
File Manager upload
Section titled “File Manager upload”FTP upload
Section titled “FTP upload”Server-rendered deployment using Node.js
Section titled “Server-rendered deployment using Node.js”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
Section titled “Add the Node.js adapter”Add the Node.js adapter to enable on-demand rendering with the following astro add command:
Make sure your package.json has a start script that runs the built server:
{ "scripts": { "start": "node ./dist/server/entry.mjs" }}Deploy from a Git repository
Section titled “Deploy from a Git repository”Deploy by uploading project files
Section titled “Deploy by uploading project files”Official resources
Section titled “Official resources”- Hostinger documentation — official help center for hPanel, hosting plans, and Node.js applications.