Skip to content

Hostinger

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.

  1. Node.js >= 24 (matches package.json engines)
  2. pnpm 8.15.0 package manager
  3. Build succeeds locally: pnpm build
Terminal window
pnpm install
pnpm build

The build output goes to dist/. Set SITE_URL at build time so canonical URLs, sitemap, and OG tags are correct:

Terminal window
SITE_URL=https://broca.id pnpm build

All PUBLIC_* environment variables are inlined at build time. If you change any, rebuild and redeploy.

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.

Section titled “Option B: GitHub Actions CI/CD (recommended)”

Create .github/workflows/deploy.yml:

name: Deploy to Hostinger
on:
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

The .htaccess file in public/ is copied to dist/ at build time. It handles:

  • Force HTTPS redirect
  • www → non-www redirect
  • Clean URLs (serve .html without extension)
  • Custom 404 page
  • Security headers (X-Content-Type-Options, HSTS, etc.)
  • Cache headers for versioned assets (/_astro/*)
  • Gzip compression
  • 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.id redirects to https://broca.id
  • Security headers present (check DevTools > Network)
  • Sitemap loads at /sitemap-index.xml
  • RSS feed loads at /rss.xml

All variables are build-time only for static output. See Environment Variables for the full list.