Aller au contenu
TubePress — gratuit, auto-hébergé & activement maintenu
Prise en main

Déploiement automatisé (CLI et agents IA)

Installez TubePress de façon non interactive en ligne de commande — pour qu’un script ou un agent IA puisse le déployer de bout en bout, sans navigateur.

TubePress can be installed without a browser, from a single command — so a deployment script, a CI pipeline or an AI agent can stand up a complete site end to end, with no human clicking through a wizard. The command-line installer runs the exact same logic as the web setup wizard, so an automated install and a manual one produce an identical site.

There is no build step: TubePress is plain PHP with no Composer and no Node.js. Unzip the release, run one command, and point your web server at public/.

For AI agents. Every download includes an AGENTS.md file at the project root — a machine-readable deployment contract with the full procedure, options, web-server config and verification steps. Point your agent at it.

1. Check the environment

Run the read-only checker first. It changes nothing and exits non-zero if a required check fails, so a script can gate on it:

php bin/install.php --check --json

Required (block install): PHP 8.2+, the pdo_mysql, mbstring and fileinfo extensions, and writable config/, storage/ and public/uploads/ directories. Recommended (warnings only): curl, zip, gd or imagick, and exec() enabled for the self-managed cron heartbeat.

2. Install in one command

Provide your database and admin details. The installer connects, runs every migration, writes config/database.php, creates the admin account, seeds the default settings, pages and SEO, and writes the install marker:

php bin/install.php \
  --db-host=127.0.0.1 --db-name=tubepress --db-user=tubepress \
  [email protected] --site-url=https://example.com \
  --json

If you do not pass an admin password, a strong one is generated and returned in the result (shown once — store it). The output is JSON, so a script can parse "ok" and act on it.

Keep secrets off the command line. Pass passwords as environment variables instead of flags — flags are visible in the process list and shell history.
export TUBEPRESS_DB_PASSWORD='…'
export TUBEPRESS_ADMIN_PASSWORD='…'   # omit to auto-generate
php bin/install.php --db-name=tubepress --db-user=tubepress \
  [email protected] --site-url=https://example.com --json

Options

Every value can be supplied as a CLI flag, an environment variable, or a key in a JSON answer file passed with --config=FILE. Resolution order: flag > environment variable > config file > default.

  • --db-host / TUBEPRESS_DB_HOST — default 127.0.0.1; accepts host, host:port, :port, [ipv6]:port or a /path/to.sock socket.
  • --db-name / TUBEPRESS_DB_NAMErequired.
  • --db-user / TUBEPRESS_DB_USERrequired.
  • --db-pass / TUBEPRESS_DB_PASSWORD.
  • --admin-user / TUBEPRESS_ADMIN_USER — default admin.
  • --admin-email / TUBEPRESS_ADMIN_EMAILrequired.
  • --admin-pass / TUBEPRESS_ADMIN_PASSWORD — generated if omitted.
  • --site-name, --site-description, --site-url (and their TUBEPRESS_SITE_* variables).
  • --force (re-run on an installed site, non-destructive), --check, --json, --help.

Exit codes: 0 success / checks pass, 1 install or checks failed, 2 usage error.

3. Configure the web server

Point the document root at public/ and add the standard rules for your server. Both Apache and Nginx are supported; full, copy-paste snippets are in Server requirements and in the bundled AGENTS.md.

4. Verify

curl -fsS https://example.com/ -o /dev/null        # homepage 200
curl -fsS https://example.com/admin/login -o /dev/null   # admin login 200

Then log in at /admin/login with the admin account you created.

Idempotent and safe to re-run

The installer is idempotent. On a site that is already installed it exits with "error": "already_installed" and changes nothing, unless you pass --force — and even then it is non-destructive: it never drops data and never duplicates the admin account or default pages.

Security: the installer closes itself after setup

Once a site is installed it cannot be re-installed by a visitor. This is enforced at several layers:

  • The web installer routes (/install, /install/database, …) are not registered at all once config/installed.php exists — they return 404.
  • The CLI installer lives in bin/, which is outside the public/ document root, so it is never reachable over HTTP; it also refuses to run except from a real command line.
  • HeadlessInstaller re-checks the install marker and refuses to run on an installed site unless an operator with shell access explicitly passes --force.
Secure by default. The generated admin password is strong and shown only once, config/database.php is written with tightened permissions, and 2FA, Argon2id hashing, CSRF protection and rate limiting are built in.

Background jobs

TubePress runs its periodic work (update checks, sitemaps, transcode dispatch) opportunistically after web requests and via a self-managed heartbeat. On a low-traffic server, start the heartbeat once so jobs keep ticking; it re-spawns itself on later requests when exec() is available:

php bin/heartbeat.php >/dev/null 2>&1 &

It needs a correct site_url (set --site-url at install). See Cron & CLI for running it as a service.

Toujours bloqué ?

Ouvrez un ticket depuis votre tableau de bord et notre équipe vous assistera.

Essayer la démo en direct → Télécharger TubePress →