Local Storage
Local storage keeps your backup files on the same server as your WordPress site. It is part of the free plugin and works with no configuration. It is the destination a new backup starts on, unless you choose another Default storage under Hera Backup > Settings > General.
Before you start
- Hera Backup must be installed and activated.
- Nothing else is required: local storage works out of the box.
Where backup files are stored
By default, backups are saved in a hera-backup folder inside your uploads directory, which on most sites is:
wp-content/uploads/hera-backup/
This folder is created automatically when the plugin is activated, and again whenever it is missing when a backup is stored or the path is tested. What the plugin does to keep it private:
- It writes an
.htaccessfile that denies all web access (read by Apache) and an emptyindex.phpthat stops the folder from being listed. A file of either name that is already in the folder is left as it is. - Every backup file name carries 32 random characters, so the address of a backup cannot be guessed.
- Backup files are written with owner-only permissions (
0600). - The plugin checks whether the web server hands out files from this folder: when the plugin is activated, when you change the folder, and once a day. Nginx does not read
.htaccess, so on Nginx this check is what tells you whether the folder is protected.
If the check finds the folder can be downloaded from the web, every admin screen shows a notice saying so, and WordPress's Tools > Site Health reports "Backup files can be downloaded from the web". The notice offers two fixes:
- Move backups outside the web root: tick the confirmation and click the button, and every backup is moved to a
hera-backup-privatefolder beside your WordPress folder, which becomes the backup folder from then on. A backup that cannot be moved stays where it was and is still read from there. When the site cannot create that folder, the notice says why instead. - For the server administrator: the Nginx rule that closes the folder, to add to the server block before reloading Nginx. For the default folder on a standard install it is:
location ^~ /wp-content/uploads/hera-backup/ { deny all; }
Configuring local storage
- Go to Hera Backup > Storages.
- Find the Local Storage card and click Configure (the button reads Connect until the backup folder exists and can be written to).
- Adjust the options described below.
- Click Test connection to confirm the path is writable, then Save.
The form has three options:
- Local path: the server path where backups are written. It shows the current folder; leave it unless you need another location.
- Retention count (5 unless you change it, at least 1): with Auto cleanup after retention on, when a scheduled backup stored here finishes, that schedule's older backups here beyond this number are deleted. Manual and imported backups are never deleted automatically; Free Up Space under Hera Backup > Tools > Cleanup trims them to this number. The recovery point and the backup last restored are never deleted automatically.
- Auto cleanup after retention (on unless you change it): turn it off and this folder sets no limit of its own; a schedule's own retention setting still applies.
See Storage Retention and Cleanup for how retention works across destinations.
A custom path should be:
- A full (absolute) path on your server.
- Writable by PHP on your server (the web-server user, often
www-dataorapache). Test connection creates the folder if it does not exist and checks that it can be written to. - Ideally outside the public web root, so the web server never serves it.
Existing backups are not moved when you change the path; move them yourself over FTP or SSH if you need them in the new location. (The Move backups outside the web root button described above is the exception: it moves them for you.)
Disk space
Local backups use your hosting disk space, so keep an eye on usage. The Local Storage card shows the disk's Capacity, Free space, the number of Backups in the folder and when it was Last used. A rough estimate of what you need:
Space needed = average backup size x number of backups kept
For example, with backups of about 500 MB each and 5 kept, you need about 2.5 GB free. A backup is first built in a temporary work folder and then copied into the backup folder, so while it runs it needs room in both.
Before a backup starts, the plugin checks free space and refuses to start, with a message beginning "Not enough disk space to start", when the work folder has less than about the size of your database plus 50 MB, or when the local backup folder has less than 50 MB free. If the copy into the backup folder fails part way, the partial file is removed, and the error says how much space the folder has free when the server allows it to be measured.
Security checklist
- After setting up local storage, open Tools > Site Health in WordPress and check for "Backup folders are not served by the web server". If it reports that backup files can be downloaded, use Move backups outside the web root or add the Nginx rule from the notice.
- Leave the backup files' owner-only permissions as they are.
- Prefer a path outside the public web root.
- For an important site, always pair local storage with an offsite copy (Hera Backup Hub or a cloud destination): local storage alone is lost if the server fails.