The cloud is now all the rage, but the problem is that leaving our private data in the hands of third parties is not very secure, especially when it comes to confidential documents. Many of the Cloud services have clauses in the licence conditions (which nobody reads out of laziness) that allow third parties (developers of the service itself) to access your data.
There are free clouds that offer greater privacy and securitywith the possibility of encrypting your data so that only you can access it. In addition, they usually only offer a few gigabytes of storage, and if you want more, premium services are offered for a fee.
Imagine if it were as simple as storing the data in a USB pendriveYou set the capacity you want for free, with your own private cloud, where only you can access it and available from anywhere in the world. Well, your own Dropbox can be a reality and it won't cost you too much thanks to Raspberry Pi and OwnCloud.
The private cloud can have advantages for your private use or for a hypothetical business. And as you can see, it is very easy to set up and configure.
- Raspberry Pi complete and configured. With a uSD with Raspbian installed. You can buy it in our shop for an affordable price and a kit of the most complete.
- USB flash drive or 2.5" self-powered USB hard drive.
- Internet connection at home (WiFi or wired).
Installation and configuration
To create our cloud, the first thing we need to do is a series of preliminary steps to set up and configure the cloud. Raspberry Pi and the Raspbian system. We are going to configure the IP to be static and to do so we will edit the file /etc/network/interfaces. First of all I advise you to go to that directory and make a copy of the file for security. Then go to the terminal and type the following:
sudo nano /etc/network/interfaces
Now open the file with the text editor and locate the line that says iface eth0 inet dhcp and delete it. We will then add these lines:
iface eth0 inet static
At gateway we have to put the IP address of our router and in address the Static IP that we always want our network to have. Once done, exit the editor and save the changes. Then restart with sudo reboot and once the system has booted, type in ifconfig to check that the previously modified data has taken effect. If there is a problem, replace the file with a new one. /etc/network/interfaces for the backup you made.
If everything went well, we now have our static IP. Now we must connect our USB hard disk or our pendrive which will act as memory in the cloud. If, for example, the pendrive is 32GB, we will have this amount available in our cloud. And we can always expand it without paying fees.
We are now going to configure the server. The first thing to do is to access the terminal again and type:
sudo apt-get update && sudo apt-get upgrade
It may take a while depending on your Internet connection. Once the system has been updated, we will install the packages necessary to set up our server and the OwnCloud cloud (in a single line):
sudo apt-get install apache2 apache2 php5 php5-json php5-gd php5-sqlite curl libcurl3 libcurl3-dev php5-curl php5-common php-xml-parser
Once the whole chain of packages has finished installing, we need to install the sqlite database:
sudo apt-get install sqlite
Then we download OwnCloud typing on the console:
Then, after downloading, we go to unzip it and copy it to the directory /var/www for it to work:
sudo tar -xjf owncloud-9.0.2.tar.bz2 -C /var/www
Afterwards, the modify the properties of the folder we just copied:
sudo chown www-data:www-data -R /var/www/owncloud
The next step is to edit the maximum upload size files in Apache. For this step, you access, with a text editor, to /etc/php5/apache2/php.ini and modify the line upload_max_filesize y post_max_size and change the default amounts (2MB and 8MB) to a reasonable amount for the files you are going to store. For example, if you are working with files up to 85 MB, put this amount in these fields. Save the changes and you are done.
Restart the Apache server to apply the changes:
sudo service apache2 restart
Access in graphic mode to your pendrive and creates a directory/subdirectory named owncloud/data and give them the appropriate permissions:
sudo chown www-data:www-data -R /media/pendrive/owncloud/data
Now all we have to do is log in from the browser to the cloud and create an account with a username and password. From the OwnCloud website you can download clients for Windows, Linux and Mac that you can install to access your cloud from these systems. If you don't install them you can do it directly from the browser. For iOS y Android there are also apps.
To access, simply enter in your browser IP/owncloudby substituting IP for the static IP you have. For example:
A screen will appear on which you have to enter your username and password. If we click on AdvancedTo complete the installation, we can enter the path to our USB drive, for example /media/pendrive/owncloud/data (bearing in mind that in the case of using a hard disk or SD card, we must replace the path with the appropriate one for that memory) in section Storage directory. The field localhost We leave it as it is and press the button Complete installation.
Once you've done that, enjoy your own cloud made with Raspberry Pi.