In this article, I will walk you through step by step how to configure Backblaze B2 Cloud Storage to backup all virtual hosts via Virtualmin panel. I recently decided to finally ditch my paid cPanel web administration panel and move to the open-source alternative Webmin+Virtualmin. After all the initial settings, which in general did not have any problems, the issue of backups arose.
Before that I used the built-in backup functionality in cPanel and FTP storage, which I rented from the hosting provider. However, as the amount of data grew, this solution became less and less cost effective and I looked at Backblaze B2. It is one of the most cost effective (see screenshot below) S3 compatible cloud storage solutions out there, including being perfect for backups. When comparing the cost to other top cloud storage solutions, the difference is quite obvious.
However, it turned out that Backblaze B2 is not available as a Cloud Storage Provider in the free version of Virtualmin. This was evidenced by a notification at the top of the page :( The official documentation also all indicated that this option is only available if you purchase a license for the Pro version of the panel.
I went googling on this topic and couldn't find any article that would clearly explain how to configure Backblaze backups inside the web interface of the Virtualmin panel on the free version. On the webmin/virtualmin forums, the last posts that said it was unfortunately not possible were from 2020…
At this point I was getting frustrated and started looking at other options for configuring backups via third party utilities such as rclone or b2 (CLI interface for Backblaze)… Still, if you have already decided to use a web panel for server administration, you obviously want to do everything within it without wasting time and effort on witching around configs for third-party console utilities in Linux. Virtualmin out of the box provides a comfortable interface for viewing backup history, configuring schedules, etc.
But at the last minute I saw that Backblaze added an API fully compatible with S3, so I decided to try to attach it to Virtualmin and.…
It worked! Below I thought I'd share exactly how, so you can save your time and money.
Create Backblaze Bucket
First Step
After registering in Backblaze, go to B2 Cloud Storage->Buckets
and click on the "Create a Bucket" button.
Attention! The name of the bucket must be unique not only in your account, but also among all bucket in general on Backblaze including other users of the service. It's like an individual identifier for your storage. I use randomly generated letters and numbers to avoid matches: for example gFisun2H7jAkEBZYTEV3F4VW
You can also optionally enable encryption of all data in this repository by selecting Default Encryption -> Enable
Second Step
Next, go to the Application Keys section and click "Add a New Application Key"
-
The name of the key (
keyName
) can be anything you like -
In the
bucketName
field you can give access to all buckets at once or select a specific one created at the previous step -
Type of Access
you can leave the default Read and Write option unchecked
Third Step
Click the "Create New Key" button and you will see a notification that displays the application key you just created.
Save the keyID
and applicationKey
in a safe place!
Connect the Backblaze S3 Bucket to Virtualmin
In the Virtualmin web panel, go to Backup and Restore -> S3 Accounts
-
Account Description specify any, e.g. "Backblaze".
-
S3 Access Key specify
keyID
from Backblaze -
S3 Secret Key specify the
applicationKey
from Backblaze saved in the previous step. -
In the S3-compatible service section, specify the Endpoint of your bucket. You can find it in the Buckets section of the bucket description in Backblaze (see screenshot below) In my case it is s3.eu-central-003.backblazeb2.com
-
Region is the subdomain following s3. In my case it is eu-central-003
Click “Save”.
-
If you have done everything correctly, your newly created buckets will appear in the Virtualmin panel under
Backup and Restore -> S3 Buckets
Configuring scheduled backups in Virtualmin
-
Open the
Backup and Restore -> Scheduled Backups
section in the Virtualmin panel. And click on the "Add a new backup schedule" button -
Choose a name, for example "Daily backup". You can also choose which virtual servers and specific data to backup in the “Virtual Servers” and “Features and Settings” tab. I won't go into detail on this now, as there is plenty of information about it in the official documentation
-
We are interested in the "Destination and format” tab.
- Select the "S3 bucket" destination and the newly added S3 account from the drop-down list
- In the “Bucket and path” line, enter the name of your bucket followed by the name of the folder where the daily backup will be uploaded. I've also included the date of the backup in the name of the folder. (for this to work, check the "Do strftime-style time substitutions on file or directory name" checkbox)
In the next tab "Schedule and reporting" you can configure the periodicity of backups (different options are available)
Click "Save Schedule" and voila! You have successfully configured backups in Backblaze B2 without purchasing the paid Pro version of Virtualmin.