Skip to main content

Automated Backups, Remote S3 Copies and Restore

Nightly backups of every account, kept on the server and, if you want, copied to an S3-compatible bucket.

What gets backed up

Each hosting user gets one archive per backup, covering all of their domains:

  • All files in the account's home directory (/home/<username>/)
  • All MariaDB databases owned by the account
  • Apache vhost configuration
  • PHP-FPM pool configuration
  • SSL certificate details

Alongside them, a server configuration archive (system_config_YYYY-MM-DD.tgz) holds what you need to rebuild the server: the panel database, and the Apache, PHP, MariaDB, lighttpd, fail2ban, WireGuard, SSH, cron and vsftpd configuration.

Schedule

Backups run automatically at 3 AM by default. All accounts are backed up in sequence.

0 3 * * *   root   inetp backup_accounts

Where backups are kept

Archives are stored on the server in /backup, one per account per day, named <username>_YYYY-MM-DD.tgz. Clients can download their own from the Backups tab of the client portal.

Retention

Set local retention on the Backups page (1 to 365 days). Backups older than that are deleted automatically on the next backup run.

Manual backup

  • Admin UI: Admin → Backups → "Backup Now" for individual accounts
  • CLI: inetp backup_accounts

Remote backups to S3

New in 1.29. iNetPanel can copy each night's archives to an S3-compatible bucket, so a backup survives the loss of the server itself. It works with Amazon S3, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces, MinIO and Garage.

Set it up in the Remote Backup (S3) card on the Backups page:

  • Endpoint URL: leave blank for Amazon S3. For other providers use the endpoint they give you, for example https://<account-id>.r2.cloudflarestorage.com, https://s3.us-west-004.backblazeb2.com or https://s3.wasabisys.com.
  • Region, Bucket and Folder in the bucket. Backups are stored in the folder as <username>_YYYY-MM-DD.tgz.
  • Addressing: Automatic suits almost everyone; path-style and virtual-hosted are there for providers that need one.
  • Access key ID and Secret access key. The secret is stored where only root can read it, never in the panel database.
  • Upload speed limit in Mbit/s (0 = no limit). Uploads share your connection with the sites you host.
  • Upload the server configuration backup too: needed to rebuild the server. It contains the panel database and WireGuard keys, so use a private bucket.
  • Delete old backups from the bucket: remote retention, in days. Only backups this server uploaded to this folder are ever deleted, and the newest backup of each account is always kept.

Test Connection checks the settings against the bucket, and Upload Now sends whatever is not there yet. After that, uploads start on their own when the nightly backup finishes. They run in the background, retry if the connection drops, and an hourly check picks up a run that failed. If uploads keep failing, a warning appears in the panel header.

From the shell: inetp s3_backup status, inetp s3_backup upload, inetp s3_backup test and inetp s3_backup retention --dry-run.

Restore

Restore an account from Admin → Restore, or from the shell:

inetp restore_account --username <user> --backup-file <path>
Share: 𝕏 Twitter Facebook LinkedIn