Browse documentation

Pharos / Docs / v1.4.2

Remote backups

Updated 2026-12-04 · Pharos 1.4.2

A remote backup sends a complete copy of your installation to storage of your own, once a day: an S3 bucket or an SFTP server. After each upload Pharos downloads the file again and compares it with the original, and only then calls it a success. Open Scheduler and backups under Installation. Only administrators of the installation can add, run or remove a destination.

The Remote backups card on Scheduler and backups: Backup passphrase marked Archives encrypted with fields for a new passphrase, an SFTP destination marked as used for the fallback copy, an S3 destination with its last success and Back up now, and the forms to add an S3 or SFTP destination
Remote backups. The backup passphrase at the top, then each destination with its last success. Back up now runs the same delivery as the daily job. A destination chosen for the fallback copy gets no backups. The data here is a demo.

What is in a backup

One zip file per run, named pharos-, the date and time and a random part, such as pharos-20261115-024500-3f9a1c0b7d2e4a68.zip. With a backup passphrase it is encrypted and ends in .zip.enc.

In the archiveDetail
The databaseOn SQLite a consistent copy, checked for integrity, as database/database.sqlite. On MySQL a dump made with mysqldump, as database/database.sql.
The application and .envThe code, and with a backup passphrase also your configuration, which includes APP_KEY. Without a passphrase .env is left out.
Uploads and public filesUnder public/, also when your public folder lives outside the application folder, as it does after the web installer.
Two notesBACKUP-LAYOUT.json records where the public files came from. BACKUP-README.txt holds the restore steps.
Left outvendor/, git data, caches, sessions, logs and the snapshots under Updates.

Keep the storage private. Without a passphrase the archive is not encrypted and holds your account data. Anyone who can read the bucket or the folder can read all of it.

Backup passphrase

Since 1.2.0 remote backups can be encrypted. Set a Backup passphrase of at least twelve characters at the top of the Remote backups card. From then on every archive is encrypted with it (Argon2id and XChaCha20 Poly1305), ends in .zip.enc and includes .env with APP_KEY. The passphrase is stored on the server, encrypted with APP_KEY, because the daily upload needs it. Keep a copy somewhere else: only the passphrase opens the archives.

Without a passphrase the archives are not encrypted and leave .env out. Then keep APP_KEY somewhere safe yourself: without it the encrypted fields in a restored database, such as two factor secrets and mail and backup credentials, cannot be read.

Open an encrypted archive on any machine with Pharos on it, also a fresh install that has no database yet:

php artisan pharos:backup:decrypt pharos-20261115-024500-3f9a1c0b7d2e4a68.zip.enc

It asks for the passphrase and writes the zip next to it; --out= chooses another place. Removing the passphrase later does not open the archives made with it.

Add a destination

Open S3 destination or SFTP destination, fill in the fields and press Add destination.

S3 fieldWhat to enter
NameYour own label for the destination.
HTTPS endpoint (optional for AWS)The address of an S3 compatible service. Leave it empty for Amazon S3. It must be HTTPS, without a user name, query or fragment in it.
Region, BucketAs your provider names them.
Folder prefixOptional. A folder inside the bucket.
Access key, Secret keyA key that may write and read objects in that bucket.
SFTP fieldWhat to enter
NameYour own label for the destination.
Host, PortThe server and its SSH port, 22 by default.
Username, PasswordThe account to sign in with. Sign in is by password; there is no field for a key file.
Verified server host fingerprintThe complete SHA256 or SHA512 fingerprint of the server's host key. Required.
Remote directoryAn absolute path on the server, /backups by default.
  • The fingerprint is what proves you are talking to your own server. Pharos accepts it as OpenSSH prints it (SHA256: followed by the base64 value) or as hexadecimal, with or without colons. Get it from the server itself or from your provider, not from a first connection you cannot check. Without a valid fingerprint Pharos does not connect.
  • Allow this destination on a private network: tick this when the storage has a private address, for example a server on your own network. Without it Pharos only connects to public addresses. This machine itself and link local addresses are refused either way.
  • Keys and passwords are stored encrypted and are never shown again. To change a destination, remove it and add it again.
  • An installation can have up to 10 destinations.
  • The destination chosen for the fallback copy gets no backups, because people may be able to read it. Its card says Used for the fallback copy. Backups do not go here.

When it runs

  • Every day at 02:45 UTC, from the cron line, to every destination. The command behind it is php artisan pharos:backup-remote.
  • Back up now on a destination does the same at once.
  • Each destination shows Last success. After a failure it shows one short line and no details: check the address, the credentials and whether the server can reach the storage.
  • A delivery gets five minutes in total. A very large installation on a slow line may not fit in that.
  • Pharos never deletes old backups at the destination. Set a lifecycle rule on the bucket or clean the folder yourself, or the storage fills up.

On SQLite the backup needs PHP's sqlite3 and zip extensions. On MySQL it needs the mysqldump program on the server, and tables of a transactional type such as InnoDB for a consistent dump. After the first run, open the archive and check that the database is in it.

Restore

  1. Stop the cron line, so nothing writes while you restore.
  2. An encrypted archive (.zip.enc): open it first with php artisan pharos:backup:decrypt.
  3. Put the application files and .env back. Keep the original APP_KEY: without it the stored destination credentials and the two factor secrets cannot be read. An archive made without a passphrase has no .env: write it again with the APP_KEY you kept.
  4. Put the contents of public/ from the archive into the document root the site uses now. BACKUP-LAYOUT.json tells you where they came from.
  5. Put database/database.sqlite back, or import database/database.sql into MySQL.
  6. vendor/ is not in the archive. Install the dependencies from composer.lock with composer install --no-dev.
  7. Make sure storage/ and bootstrap/cache/ exist and are writable, run php artisan storage:link, and start the cron line again.

Try a restore on a separate installation before you rely on it.