With many thanks to my brother
How it began
We’ve been always thinking about building our own backup server using the ARM solution of Raspberry PI. When we needed to manage approx. 25 WordPress web projects couple of months ago we did some experiments with MainWP on virtual server at DigitalOcean.
Unfortunately there was a problem with the low disk space. Even that we stored only the last two backups on the disk, we ran out of 30GB storage limit for $10 per month (while on the other side we didn’t experience any other technical issue with the server) after a couple of weeks.
The lack of storage wasn’t caused by the fact that we backed up the data from more weeks. But at least 5 of our projects had created more than 2 GB of backup data for each backup file. If we would have updated to a 60GB plan the total cost would be $480 per year ($40 / month).
More than that the $40 solution from DigitalOcean includes DualCore CPU and 4GB RAM (more than Raspberry PI) which is really not necessary for the backup server. The compression of backup data runs completely on the server where the WP project is installed. After that it is sent to the backup server. Finally the operation system (CentOS) takes almost 10% of the storage.
What we were looking for was an ideal solution to meet these requirements:
- stable and cheap system
- with approx. 60 GB of storage
- low budget and low energy consuming
- MainWP for backup scheduling
Financial and energy demands
The whole device must be stable so you have to count in the energy backup in the form of 4,2V LiPO battery and the Power supply module for approx. $30.
Then, the main unit (Raspbery PI) for about $45, 16GB microSD card for $10, 64GB USB drive for $21 and more stuff like Arduino, two thermometers and a plastic box for $20. A standard USB charger with minimum of 2A output serves as a power supply.
The total price is $136 so far, including the backup power supply. If you prefer the solution without the backup power supply it would be $30 down and the total price would be $106.
There’s still a room for more modifications like the storage size. You may pay an additional $20 to go with 128GB USB drive for example. Also don’t forget that the cheapest USB drive or microSD cards are usually slow what really slows down the whole backup process.
The internet connection is also one of the key elements. The best solution is to do the backups during the night with at least 10Mbps connection.
Based on the components we used, the total power consumption should be about 5Wh which means approx. 45kWh per year in non-stop operation 24/7. According to the actual average price for the kWh it is only $5 per year in non-stop operation.
The return of your investments of $140 would be 14 months in the case of $10 for 30Gb VPS from DigitalOcean or less than 4 months in the case of $40 60GB option.
To make the server a bit more reliable and stable, we decided to add a standalone power supply and a bit of intelligence to the whole solution. The additional components are not necessary but will help you to keep the server running even in the case of short power failures which could lead to damage of the backup files and errors in database.
UPS module + LiPo 4,2V 2Ah battery
This module helps you to keep the server running if you run out of electric power or in the case of the power failure. It serves as the energy switcher that controls the battery to keep it fully charged and in standby mode. You can buy the module here.
Raspberry PI 2 model B
We chose the Raspberry PI 2 model B because of the low energy consumption and server speed. You may use the other (older) version or some different alternative solutions like Banana PI for example. Raspberry PI really showed us that it is capable and reliable element of this server. As for the smooth system operation we decided for 16GB microSD card with only Raspian system and other software installed. 64GB storage (USB drive) is fully reserved for backups. If you have a higher budget you can go with the 128GB version instead.
Arduino PRO mini
To make the whole system a bit more intelligent we recommend to add Arduino Pro Mini with two thermometers and button. Arduino can tell you the actual source of Raspberry´s power or just send a command “TURN OFF” in the case of the lower battery level or due to the overheating of the whole environment. Data from UPS and thermometers can be sent to Raspberry as logs and you can review them as a graph. Or it can push the notification in the case of the power failure or higher temperature of the server or the environment.
We decided to put all of the components into the transparent plastic box. You can view the gallery:
The first turn on and real measurements
After the completion of the server we took a couple of real measurement with Charger Doctor to find out how they differ from the 5W we predicted. The results are below:
What do you think? Is this a good idea or do you have any better tips or suggestions? Feel free to leave the comment below or just share the article. You can find more info in our Lab section.