Tuesday, April 2, 2013

Cloud storage on the Raspberry Pi



I recently started playing around with cloud storage on the Raspberry Pi. I'm already using it as a web server and a media server, why not this as well.

I started hacking up something to make Dropbox work and then decided that was stupid and found some open source solutions instead.

I found two options that were easy to install and seemed to work decently.

The first one is Owncloud


If you already have apache installed and running, this one is easy (If not see here).

All you have to do is install the packages required, download the files and do some simple setup.

sudo apt-get update && sudo apt-get install curl libcurl3 php5-curl sqlite3 php5 php5-sqlite php5-gd php-xml-parser php5-intl

cd /var/www/
sudo wget http://download.owncloud.org/community/owncloud-5.0.2.tar.bz2
sudo tar -xvf owncloud-5.0.2.tar.bz2
sudo chown -R www-data:www-data owncloud
sudo nano /etc/apache2/sites-enabled/000-default
Then change the line AllowOverride None to AllowOveride All in the /var/www/ section.
sudo a2enmod rewrite
sudo a2enmod headers
sudo service apache2 restart

Now just go to your http://ip-address/owncloud/ with a separate computer or go to http://localhost/owncloud/ on the Raspberry Pi and pick a username and password.

Pros:

  • Can access local data from your external drives easily.
  • Can access your dropbox data.
  • Doesn't require its own service.
  • Password protected (storing the salted hash of the password!).
Cons:
  • Unencrypted SQL database that anyone can download.
  • Slow!
  • Doesn't automatically sort through your data like its features imply. You have to manually upload everything.


The second one is Seafile


This one is also pretty easy to install and has a Raspberry Pi specific version.
I put my stuff in a directory in my home folder but you could put it wherever. For more security, consider creating a special user for seafile.

sudo apt-get update && sudo apt-get install python2.7 python-setuptools python-simplejson python-imaging sqlite3
cd
mkdir cloud
cd cloud
wget http://seafile.googlecode.com/files/seafile-server_1.5.1_pi.tar.gz
tar -xzf seafile-server_*
mkdir installed
mv seafile-server_* installed
cd seafile-server-*
./setup-seafile.sh

The last script will install it and ask some easy questions for you to answer to set up things.
To run the seafile server, you have to do the following:

sudo ./seafile.sh start
sudo ./seahub.sh start

This has to be done every time your Raspberry Pi restarts, which is fairly easy using a cron script
crontab -e

then add:
@reboot sudo /home/pi/cloud/seafile-server-1.5.1/seafile.sh start
@reboot sudo /home/pi/cloud/seafile-server-1.5.1/seahub.sh start

Then save and exit.
For more help, see here.
Now just go to your http://ip-address:8000 with a separate computer or go to http://localhost:8000

Pros:

  • Fast!
  • Doesn't run if you don't want it to.
  • Doesn't have all of it's files accessible over the normal webserver.
  • Requires username and password.
Cons:
  • Takes time to start up and sometimes seahub.sh doesn't start properly
  • Unencrypted SQL database (Though I haven't found a way to easily grab this db).
  • Can't access your dropbox data..

After a quick trial with the two of them, I'm going with seafile. I haven't removed OwnCloud but I'm seriously considering it do to the speed and security issues.

Please let me know your experiences with the two of them and any more options to try out!


Consider donating to further my tinkering.


Places you can find me

No comments:

Post a Comment