Astro
Deploy your Astro Site to Hostinger
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.
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
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
Log in to hPanel and open your website.
Open Files > File Manager and navigate to the
public_htmldirectory.Upload the contents of your local
dist/folder intopublic_html. You can drag and drop files, or upload an archive and extract it in place.Visit your domain to confirm your site is live.
FTP upload
Connect to your hosting account using an FTP client such as FileZilla.
Upload the contents of your local
dist/folder to thepublic_htmldirectory on the server.Visit your domain to confirm your site is live.
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
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
Log in to hPanel and go to Websites.
Add a new website and select the Node.js application option.
Connect your Git provider and select your repository and branch.
Configure the build settings:
- Build command:
npm run build - Start command:
npm run start
- Build command:
Select a Node.js version that satisfies Astro's minimum requirement (Node.js 22 or later).
Start the deployment. Hostinger will install dependencies, run your build command, and start the application.
Deploy by uploading project files
In hPanel, add a new website and select the Node.js application option.
Upload your project files (or a
.ziparchive) using the File Manager.Configure the application:
- Application root: the folder containing your
package.json. - Start command:
npm run start
- Application root: the folder containing your
Select a supported Node.js version and start the application.
Official resources
- Hostinger documentation — official help center for hPanel, hosting plans, and Node.js applications.