Create your own cloud thanks to Raspberry Pi

OwnCloud logo

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.

Materials needed

  • 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.

Raspberry Pi Terminal

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:

OwnCloud from the browser

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.

16 thoughts on “Crea tu propia nube gracias a Raspberry Pi”

  1. Very good, I had it installed and working more or less well for a couple of weeks, but after a few days of personal use it asked me for a licence key and I uninstalled it.
    Same luck with its "natural" successor Nextcloud. In the end all that has been made pay-as-you-go, but for individual personal use I feel as if I have been "kicked out" of the RPi cloud idea.
    I tried it with Seafile, for free, but I'm not the only person who has given up because the latter is always missing something to work or is very unstable (when it wants to work), even on the 8GB RPi.
    Any alternative ideas? I would appreciate a tutorial with a reliable alternative for personal use.
    Greetings and thank you in advance.

  2. Hi.... when I dial in the browser IP/owncloud I get a 404... however if I just type in the IP I do get an answer with the default apache cover...????... any help please????? Thanks!

    1. Ok... in my case it was enough to move the owncloud folder inside the html folder... that is... sudo mv /var/www/owncloud/ /var/www/html ... Greetings

  3. Hi, I'm trying to do what you explain here but my problem comes when I write in the text editor the php.ini file because it says that the file cannot be opened for writing.

  4. Very good, simple and very concise this article, I have mounted an external disk of 500Gb and it goes of fabula, I will put a disk of 2Tb and already I will count, the consumption of the invention is only 32 W that clear if you have it put all the day because it will weigh in the receipt, little but it will weigh.

Leave a Comment

Your email address will not be published.

Scroll to Top