Skip to main content
HydroGo
← All deploy guides Unique to HydroGo cPanel / Apache / nginx FastCGI · SQLite WAL

Run HydroGo on Shared Hosting (CGI & FastCGI)

Unlike Node.js or multi-container CMS platforms, HydroGo compiles to one CGO-free Linux binary that even runs under classic CGI and FastCGI hosts with SQLite.

01

1. Upload the linux/amd64 binary via SFTP

Place the static hydro binary in cgi-bin/ (or outside public_html with a FastCGI socket). Make sure permissions are executable (0755).

chmod 0755 ~/public_html/cgi-bin/hydro
02

2. Configure CGI wrapper or FastCGI listener

Pass --cgi for per-request execution or --fastcgi for persistent FastCGI workers over stdin or loopback.

#!/bin/sh
export HYDRO_DATABASE_DIALECT=sqlite
export HYDRO_DATABASE_DSN="/home/user/hydro_data/hydro.db"
exec /home/user/bin/hydro serve --cgi --config /home/user/hydro/config.yaml
03

3. Route clean URLs in .htaccess

Rewrite requests to your CGI handler cleanly while keeping SQLite outside webroot.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /cgi-bin/hydro.cgi/$1 [QSA,L]
Checklist

Production hardening checklist

  • Always store hydro_data/hydro.db and config.yaml outside public_html (never accessible via HTTP).
  • Upgrade to standalone systemd / Docker on a VPS when traffic scales for in-memory caching and auto-updates.