Install a software update
Set the signing key, upload a signed update package, review it, install it with an automatic backup, and roll back or recover if something goes wrong.
On this page
- Before you start
- Set the signing key (once per site)
- Install from the admin panel
- What is checked before anything changes
- What happens during the install
- What an update never touches
- Roll back the last update
- Clear an update that stopped part-way
- Backups kept by the updater
- History and logs
- Install from the command line
- Common problems
A new version of Chatilo arrives as a signed update package: a .zip built with bin/make-update.php. You install it from Software update in the admin panel or from the command line. Both run the same code: check the package, back up, copy the new files, update the database, and put the old files back if a step fails.
Before you start
- PHP needs the
zipandsodiumextensions. - The user PHP runs as must be able to write to the application's folders. The This installation card on Software update shows Folders writable: Yes when it can.
- The site must trust your signing key (see the next section). Until it does, every package is refused.
- A package to install. See Build an update package.
- Your own recent backup. The updater takes one too, but keep yours as well. See Back up and restore.
Set the signing key (once per site)
Every package must be signed with your private key, so that nobody else can install code on your site, even with a stolen admin sign-in. The site holds only the matching public key.
- On the computer where you build packages, create the key pair once with
php bin/make-update.php --keygen. It prints the public key. The private key stays on that computer, outside the project. - On the server, over SSH as the site user, go to the application folder and run the command below with your public key.
php bin/update.php --set-key YOUR_PUBLIC_KEY
This writes config/update-key.php, which updates never replace. The key cannot be set from the admin panel, on purpose. Afterwards the This installation card shows Signing key: Set with the key's 8-character ID.
Install from the admin panel
- In the admin sidebar, click Software update. (The Version line at the bottom of the sidebar opens the same page.)
In Install an update, choose the package in Update package (.zip) and click Upload and review.
Nothing is installed yet. The hint under the field shows the largest upload this server accepts.
Read the review page, Review version …:
- Release notes, with a Signature verified badge.
- Files that will change: how many files are new, changed, removed and unchanged, with the full lists, and whether the database structure changes.
- Package: version, build date, PHP needed, signature, disk space needed, and a fingerprint of the uploaded file.
- If a red box says This package can’t be installed, fix the reasons listed, or click Discard this package.
- Under Install version …, type Your password and click Install version ….
- Keep the page open. It takes a minute or two, then returns to Software update with Update installed or The update wasn’t installed, and a link to the full log.
An uploaded package that nobody reviews is discarded after a day.
What is checked before anything changes
- Signature. The package must be signed with the key this site trusts. If it is not, the notes and file list are not even shown.
- Version. The package must be newer than the installed version. The same version or an older one is refused; updates only go forward.
- PHP. The server's PHP must be at least the version the package asks for.
- Every file. Each file's checksum must match the signed list inside the package.
- Protected paths. A package that tries to write into site data is rejected.
- Folders and links. The folders it will write to must be writable, and no symbolic link may be in the way.
- Disk space. There must be room for the new files, the backup of the old ones and the database backup.
- No other update may be running or left half-finished.
When you confirm, the file you install must be the same one you reviewed, or you are asked to review again.
What happens during the install
- The package is unpacked to a working folder and every checksum is checked again.
- The site closes. Visitors and signed-in users see a We’re updating page that checks again on its own. Webhooks, the API and the chat widget get a "try again" answer (HTTP 503), so gateways and Meta retry later. The sign-in page and Software update stay reachable for you.
- The updater waits for the background worker to pause, so no job runs old code while files change.
- The files that will be changed or removed are copied to
storage/backups/, in a folder named like20261205-101500-1.0.0-to-1.0.1. - The whole database is backed up into the same folder:
database.sqliteon SQLite, ordatabase.sql.gz(ordatabase.sql) on MySQL or MariaDB. - The new files are copied in, one at a time, and files the new version no longer has are removed. The
VERSIONfile changes last. - Database updates run.
- The site reopens and the worker resumes.
If any step fails, the previous files are put back automatically, the site reopens, and the result tells you which step failed.
What an update never touches
config/: yourconfig.php, the app key andupdate-key.php.storage/: the SQLite database file, uploads, logs, sessions and backups.public/uploads/.- The contents of your database, apart from the structure changes the new version needs.
A package cannot contain these paths, and the updater refuses one that does.
Roll back the last update
- On Software update, find the Roll back card.
- Click Roll back to …, type your password and click Roll back.
Rolling back puts the files back exactly as they were before the most recent update and removes the files that update added. Database changes are not undone. Tables or columns the update added stay; the older version normally ignores them. The database copy from just before the update stays in the backup folder if you need it.
Only the most recent update can be rolled back, and only while its backup is still in storage/backups and the installed version is still the one that update installed.
Clear an update that stopped part-way
If the server restarts or PHP is killed during an update, the page shows The last update stopped before it finished and visitors keep seeing the We’re updating page.
- Make sure the update is really no longer running.
- Click Put the previous files back, type your password and click Put files back and reopen.
Files the stopped update had already replaced are restored from its backup, the site reopens and the worker resumes. Then try the update again. The same can be done over SSH with php bin/update.php --recover.
Backups kept by the updater
The Backups card shows how many update backups are on disk and their size. Backups to keep (1 to 50, default 2) sets how many are kept; older ones are deleted when you save the number and after each successful update.
History and logs
History lists the latest updates and rollbacks, as many as there are backups kept (older entries are removed with their backups), with who ran each and the result: Done, Failed, Rolled back later, Running or Stopped. Click Log to read every step. The same text is in storage/logs/, in a file named update- plus the date, time and version.
Uploads, installs, failures, rollbacks and recoveries are also written to the Audit log.
Install from the command line
Use the command line for a package too big to upload, or if you prefer SSH. Copy the package to the server and run the commands as the site user, from the application folder.
php bin/update.php /path/to/chatilo-update-1.0.1.zip
It prints the same review, asks "Install version … now? [y/N]" and then installs.
| Command | What it does |
|---|---|
php bin/update.php package.zip | Review the package, ask, then install it |
php bin/update.php package.zip --yes | The same without asking |
php bin/update.php --check package.zip | Review only; changes nothing |
php bin/update.php --status | Version, database, signing key, free disk space, lock and last update |
php bin/update.php --rollback | Put back the files from before the last update |
php bin/update.php --recover | Clear an update that was cut short and reopen the site |
php bin/update.php --set-key PUBLIC_KEY | Trust this signing key |
--rollback and --recover also accept --yes. The tool refuses to change anything when you are not the user that owns the site's files, because files written by another user (such as root) can lock the website out of its own folders. --any-user overrides that check.
Common problems
"Updates can’t be installed until a signing key is set"
Run php bin/update.php --set-key YOUR_PUBLIC_KEY on the server.
"Bad signature: this package wasn’t signed with the key this site trusts…"
The package was built with a different key or changed after it was built. Do not install it. Build it again with your own key.
"The package isn’t signed."
Only packages built with bin/make-update.php can be installed.
"Version … is already installed." / "…older than the installed version…"
Build a package with a higher version number.
"The website can’t write to this folder…"
The application's folders are not writable by the user PHP runs as. Fix the owner or permissions, then review again.
"Not enough free disk space…"
Delete old backups in storage/backups or free space on the server.
The upload fails or the page says the file is larger than the server accepts
Raise upload_max_filesize and post_max_size in PHP and the upload limit of the web server (20 MB in the supplied Nginx lines), or install from the command line.
"Background work was still busy after 45 seconds…"
A long job was running. Nothing was changed. Wait a minute and try again.
"That password isn’t right. Nothing was changed." / "Too many wrong passwords. Wait 15 minutes, then try again."
Installing, rolling back and recovering ask for your own account password. After 5 wrong tries you must wait 15 minutes.
"One database update is needed first"
Open System, and under Database updates click Apply updates. Then come back.
"An update is still running, so there is nothing to clear yet."
Wait for it to finish. If it has been stuck for a long time, restart PHP on the server and try again.