Hostinger
Overview
Section titled “Overview”This site is built as a fully static Astro site (output: 'static'). Hostinger’s shared/LiteSpeed hosting serves the dist/ directory as-is — no Node.js runtime needed on the server.
Pre-Deploy Checklist
Section titled “Pre-Deploy Checklist”- Node.js >= 24 (matches
package.jsonengines) - pnpm 8.15.0 package manager
- Build succeeds locally:
pnpm build
pnpm installpnpm buildThe build output goes to dist/. Set SITE_URL at build time so canonical URLs, sitemap, and OG tags are correct:
SITE_URL=https://broca.id pnpm buildAll PUBLIC_* environment variables are inlined at build time. If you change any, rebuild and redeploy.
Deploy to Hostinger
Section titled “Deploy to Hostinger”Option A: Manual FTP / hPanel File Manager
Section titled “Option A: Manual FTP / hPanel File Manager”Upload the entire contents of dist/ into public_html/ (or your configured document root).
Important: Ensure .htaccess is uploaded — some FTP clients hide dotfiles. Enable “show hidden files” in your FTP client.
Option B: GitHub Actions CI/CD (recommended)
Section titled “Option B: GitHub Actions CI/CD (recommended)”Create .github/workflows/deploy.yml:
name: Deploy to Hostingeron: push: branches: [main]jobs: build-and-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 with: version: 8.15.0 - uses: actions/setup-node@v4 with: node-version: 24 cache: 'pnpm' - run: pnpm install --frozen-lockfile - run: pnpm build env: SITE_URL: ${{ secrets.SITE_URL }} PUBLIC_GA_MEASUREMENT_ID: ${{ secrets.PUBLIC_GA_MEASUREMENT_ID }} PUBLIC_GTM_ID: ${{ secrets.PUBLIC_GTM_ID }} - name: Deploy via FTP uses: SamKirkland/FTP-Deploy-Action@4 with: server: ${{ secrets.FTP_HOST }} username: ${{ secrets.FTP_USER }} password: ${{ secrets.FTP_PASSWORD }} local-dir: ./dist/ server-dir: ./public_html/Add these secrets to your GitHub repo:
| Secret | Purpose |
|---|---|
FTP_HOST |
Hostinger FTP hostname (e.g. ftp.broca.id) |
FTP_USER |
Hostinger FTP username |
FTP_PASSWORD |
Hostinger FTP password |
SITE_URL |
https://broca.id |
.htaccess
Section titled “.htaccess”The .htaccess file in public/ is copied to dist/ at build time. It handles:
- Force HTTPS redirect
- www → non-www redirect
- Clean URLs (serve
.htmlwithout extension) - Custom 404 page
- Security headers (X-Content-Type-Options, HSTS, etc.)
- Cache headers for versioned assets (
/_astro/*) - Gzip compression
Post-Deploy Verification
Section titled “Post-Deploy Verification”- Homepage loads at
https://broca.id/ - HTTPS works with no mixed content warnings
- Clean URLs resolve (e.g.
/about,/blog,/docs/) - 404 page works at
/nonexistent-page -
www.broca.idredirects tohttps://broca.id - Security headers present (check DevTools > Network)
- Sitemap loads at
/sitemap-index.xml - RSS feed loads at
/rss.xml
Environment Variables
Section titled “Environment Variables”All variables are build-time only for static output. See Environment Variables for the full list.