Skip to main content
HydroGo
DeploymentDatabases, Redis and media storage

Databases, Redis and media storage

Choose SQLite, PostgreSQL or MySQL, add Redis for several instances, and move media to S3.

Databases

DialectUse whenDSN example
sqlite (default)One instance, small to medium traffic, simple backups.data/hydro.db
postgresMore traffic or several instances.postgres://hydro_app:[email protected]:5432/hydro?sslmode=verify-full
mysql (and MariaDB)You already run MySQL, or your host provides it.hydro:secret@tcp(db.internal:3306)/hydro
BASH
HYDRO_DATABASE_DIALECT=postgres
HYDRO_DATABASE_DSN=postgres://hydro_app:[email protected]:5432/hydro?sslmode=verify-full
hydro migrate --config config.yaml

Every migration ships SQL for all three dialects, so you can move between SQLite, PostgreSQL and MySQL by running hydro migrate on the target database and streaming your data with hydro portable export --format ndjson --scope all and hydro portable import --format ndjson --confirm.

SQLite notes

  • Keep the database on local disk, not a network share.
  • Only HydroGo should write to the file; set database.sqlite_external_write_watch: true if other tools might.
  • Back it up with hydro backup sqlite, not by copying a live file.

Redis or Valkey

Optional for one instance, recommended for several. With redis.url set, rate limits and caches are shared, so counters are correct no matter which instance answers.

BASH
HYDRO_REDIS_URL=rediss://:[email protected]:6379/0
HYDRO_REDIS_KEY_PREFIX=hydro:

Media on S3

By default media lives in media.dir on local disk. For multiple instances, containers without volumes, or large libraries, use an S3-compatible bucket (AWS S3, MinIO, Cloudflare R2, and similar) and, optionally, a CDN.

BASH
HYDRO_MEDIA_STORAGE_DRIVER=s3
HYDRO_MEDIA_S3_ENDPOINT=s3.eu-central-1.amazonaws.com
HYDRO_MEDIA_S3_BUCKET=example-media
HYDRO_MEDIA_S3_REGION=eu-central-1
HYDRO_MEDIA_S3_ACCESS_KEY=REPLACE_ME
HYDRO_MEDIA_S3_SECRET_KEY=REPLACE_ME
HYDRO_MEDIA_CDN_BASE_URL=https://cdn.example.com
# self-hosted stores often need path-style addressing
HYDRO_MEDIA_S3_FORCE_PATH_STYLE=true
Moving existing local media to S3 means uploading the files to the bucket under the same keys. Test on a copy first.

Sizing guidance

SetupProfileDatabaseExtras
Personal site, one editorcompactSQLitenone
Company site or blogstandardSQLite or PostgreSQLCDN for media
High traffic or redundancydistributedPostgreSQL or MySQLRedis, S3, several instances