> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/node.js/overview-1/astro.md).

# Astro

Content-first framework that ships zero JavaScript by default. Hostinger supports both static and server modes.

**`app_type`:** `astro`

## `package.json`

```json
{
  "scripts": {
    "dev": "astro dev",
    "build": "astro build",
    "preview": "astro preview"
  }
}
```

## Static

Default Astro mode — pre-renders every page at build time.

**hPanel settings:**

| Field            | Value   |
| ---------------- | ------- |
| Application type | `astro` |
| Build script     | `build` |
| Output directory | `dist`  |
| Entry file       | —       |

Use when your content is known at build time (blogs, docs, marketing sites).

## Server (SSR)

Runs a Node server that renders pages on each request. Required for dynamic routes, API endpoints, or server-only environment access.

Install the Node adapter:

```bash
npx astro add node
```

Configure `astro.config.mjs`:

```js
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';

export default defineConfig({
  output: 'server',
  adapter: node({ mode: 'standalone' }),
});
```

**hPanel settings:**

| Field            | Value                   |
| ---------------- | ----------------------- |
| Application type | `astro`                 |
| Build script     | `build`                 |
| Output directory | `dist`                  |
| Entry file       | `dist/server/entry.mjs` |

## Hybrid rendering

Astro supports per-page opt-in/opt-out of pre-rendering:

```astro
---
// src/pages/dynamic.astro
export const prerender = false;  // server-rendered
---
```

```astro
---
// src/pages/static.astro
export const prerender = true;   // pre-rendered at build
---
```

Deploy as server mode — Astro handles each page individually based on the `prerender` flag.

## Notes

* Node 20 or newer for Astro 4+.
* For static deployments, no entry file is needed.
* Bind to `process.env.PORT` if using a custom server adapter.

***

*Last updated: July 21, 2026*
