Instructables
Picture of Raspberry Pi Owncloud (dropbox clone)
What I'm going to show you is how to build a your own personal dropbox like service using a raspberry pi and some software called OwnCloud. ownCloud gives you freedom and control over your own data. It's a personal cloud which runs on your own server.

If you don't want to go through the steps for downloading and setup up the software you can download the image I have setup from here. While I have done everything I can to check this is working it should be understood that you use at your own risk. If you do download the image you can skip to step 5. 




 
Remove these adsRemove these ads by Signing Up

Step 1: What you need

Picture of What you need
IMGP8155.JPG
IMGP8151.JPG
IMGP8157.JPG
A Raspberry Pi
An Usb External Harddisk or a USB Drive
An Enclosure for the Raspberry Pi and Hard Disk
Wireless network card (optional)




Step 2: Setting up the network download the software

Picture of setting up the network download the software
So first off we need to give the Pi a fix IP address we do this by editting the network interfaces file

$ sudo nano /etc/network/interfaces

Once open we need to make the file look like this (your IP address might be different)

auto eth0
iface eth0 inet static
       address 192.168.1.118
       gateway 192.168.1.1
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255

The file then needs to be saved by pressing ctrl o and ctrl  x to exit

once exited the networking need to be restarted

$ sudo /etc/init.d/networking restart

After that is done we need to update the Pi and download the software. This will take a little while to complete

$ sudo apt-get update

We are going to install Apache with SSL, PHP5, PHP APC which will load pages faster

$ sudo apt-get install apache2 php5 php5-json php5-gd php5-sqlite curl libcurl3 libcurl4-openssl-dev php5-curl php5-gd php5-cgi php-pear php5-dev build-essential libpcre3-dev php5 libapache2-mod-php5 php-apc gparted

Step 3: Configuor php & Apache

Picture of Configuor php & Apache
Screen Shot 2012-10-27 at 16.18.07.png
Screen Shot 2012-10-27 at 16.18.32.png
Screen Shot 2012-10-27 at 16.18.53.png
Screen Shot 2012-10-27 at 16.19.49.png
Screen Shot 2012-10-27 at 16.20.49.png
Now we have download the software we need to configor it.

First off we need to install PHP apc

$ sudo pecl install apc
 
After that is done we need to create the apc.ini

$ sudo nano /etc/php5/cgi/conf.d/apc.ini

In to that file we need to add the following

extension=apc.so
apc.enabled=1
apc.shm_size=30

Once added the file needs saving

Next up we have to change the PHP.ini to change the max upload file so we can add large file and add the APC externsion to PHP

$ sudo nano /etc/php5/apache2/php.ini

In this file we need to find upload_max_filesize and then change the value to 1024M which will allow files of upto 1GB to be uploaded

The we need to find post_max_size and then chaged the value to 1200m which will allow files to upto 1 gb to be uploaded

We need to find externsion= section and add in the extension=apc.so

After we have done that save and exit

next up we need to config apache and enable SSL

$ sudo nano /etc/apache2/sites-enabled/000-default

inside the file we need to change Allow over ride to All from none 

Next up we need to setup SSL

$ sudo a2enmod rewrite
$ sudo a2enmod headers


After the follow command you will be asked to provide information

sudo openssl genrsa -des3 -out server.key 1024; sudo openssl rsa -in server.key -out server.key.insecure;sudo openssl req -new -key server.key -out server.csr;sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt;sudo cp server.crt /etc/ssl/certs;sudo cp server.key /etc/ssl/private;sudo a2enmod ssl;sudo a2ensite default-ssl

Once all that is done the apache need restarting

$ sudo service apache2 restart

Step 4: Download and install own cloud

Picture of download and install own cloud
Now we have Apache and PHP setup we need to download own cloud

$ wget http://mirrors.owncloud.org/releases/owncloud-4.5.1.tar.bz2

once download it needs unziping

$ sudo tar -xjf owncloud-4.5.1.tar.bz2

And then copying in to the web root

$ sudo cp -r owncloud /var/www

After it's been copied we need to give the webserver permission to access the owncloud directory

$ sudo chown -R www-data:www-data /var/www/owncloud/

We also need to edit the .htaccess file to change the max upload file these values need to changed to the same values as you set in you php.ini

$ sudo nano /var/www/owncloud/.htaccess

Step 5: Setup own cloud

Picture of setup own cloud
Screen Shot 2012-10-27 at 18.25.06.png
Screen Shot 2012-10-27 at 18.25.25.png
The easy way to setup the external drive is to use gparted on the Pi

$ startx

and the from inside the  GUI open a ternmail and type

$ sudo gprarted

from here you can partion and format the drive

Once done give the web-server permission 

$ sudo chown -R www-data:www-data /media/owncloud

All that needs to be done now is to setup owncloud

in a web browser type in https://IPADDRESS/owncloud

Choose a user name and password by typing then in to the user name and password box

click advanced and changed the data location to the place of your external drive in my case it's /media/owncloud

The click finish and you are done.

You should now be able to upload files. To play video files you'll need to enable the video player app.

To setup external access to your device I would suggest using DyDns or Noip.

Step 6: Placing it in the encloser

Picture of Placing it in the encloser
IMGP8172.JPG
IMGP8171.JPG
IMGP8170.JPG
IMGP8163.JPG
IMGP8161.JPG
Now the software is setup the Pi just needs placing in to the box. I would drill some hole in the box to allow a little air flow.

And that's it done.
1-40 of 58Next »

My Install failed with

pi@raspberrypi ~ $ sudo pecl install apc

Package "apc" does not have REST info xml available

install failed

mbalfour125 days ago

hey,
I'm having trouble with $ sudo pecl install apc

i get: $ sudo: pecl: command not found

any help??

remove the $

senavi11 months ago
hi,
i am going to setup this with a sata hdd. i am currently using dropbox and it is the best cloud which i have used. Is there any specific differences between dropbox and owncloud?
Thank you.

4Chan / Obama (NSA) are checking out your pervy pr0n in Dropbox; Owncloud on your pi-box at home is YOURS and yours only.

village761 year ago
Hi, thanks for this, got it up and running nicely. But at the end of your project you say that it would be possible to access the Rpi remotely using noip. Would this allow me to use the Rpi from a remote computer as if I was sat in front of it? Or would this just be another way of access owncloud?

Following these instructions (http://www.stuffaboutcode.com/2012/06/raspberry-pi-access-from-internet-using.html) I've set up the no-ip account, got a host and set the client running on the Rpi (which has a fixed internal IP address) but all I'm seeing when I put in http address in the browser (http://myname.no-ip.org) is the home page of my router. I see from other posts I need to set up port forwarding but I'm a bit new at this and can't work out which port I need to forward. I guess I'm then forwarding that port to the fixed IP address of my RPi. Once I've done this, what shoud I expect to see? Grateful for your views

you would be seeing a basic file server, not a desktop.

Is there a way to install a usenet client?

lionwang1 month ago

http://www.bananapi.com http://www.banana-pi.com

Banana PI is an Open Source hardware platform which was produced to run the Elastos.org open source OS among others. Banana PI a dual core, Android 4.2 product which is much better than the Raspberry Pi.
The Banana Pi hardware runs Android, Debian Linux, Ubuntu Linux, OpenSuse linux and images that run on the Raspberry Pi and Cubieboard.
Banana PI has a Gigabit Ethernet port and a SATA Socket. It can run with Android 4.2.2 smoothly. The size of Banana PI M1 is about the same size as a credit card,
It can easily run games as it supports 1080P high definition video output. The GPIO is compatible with Raspberry Pi and can run Raspberry Pi images directly.

thursday75 months ago

Is there any reason why I should use this guide, instead of using aptitude?

Call me late, but here's my two cents: the difference between apt-get and aptitude are mainly personal. I grew into Linux using aptitude and know all of the switches, ergo I convert the majority of the tutorials from apt-get as I come across them. I know that deep down there are a few rather significant differences in the way that the two applications operate, but I'm just not that concerned with them to know ;)

TommyT11 month ago

Latest own cloud download link

https://download.owncloud.org/community/owncloud-7.0.1.tar.bz2

to replace the broken

($ wget http://mirrors.owncloud.org/releases/owncloud-4.5...


Cole Pearson2 months ago

These first few steps are just turning the pi into a web server. You can watch a more in-depth tutorial on youtube on how to set up an apache server on a pi. www.youtube.com/watch?v=WgcNBjIJNYs

    michaelmorar4 months ago

    Thanks for a great little tutorial! Just a hint from my experience - say NO to "Enable internal debugging" when installing APC or the server doesn't work.

    Also - the Android App is excellent!

    michaelmorar4 months ago

    Thanks for a great little tutorial! Just a hint from my experience - say NO to "Enable internal debugging" when installing APC or the server doesn't work.

    Also - the Android App is excellent!

    derekiswise5 months ago

    hello, the link on here for owncloud is broken. It is old and it isn't up anymore. Instead go to http://owncloud.org/install/ and scroll down to the help testing ownclloud dailly build. select the tar file and use that file in place of the one listed here. it will be called owncloud_daily_master.tar.bz2 and is changed often. Hope this helps anyone who it having trouble.

    By the way thank you hackitbuildit for this tutorial. at first i used your image than i set up my own. This is very helpful

    HackaCracka8 months ago

    Hi.

    I really like the sound of this project, it seems like a great way of using dropbox, without leaving my files in someone else's care. Can anyone tell me if i would be able to use this with a smartphone (specifically an iPhone) to store photos and such like, much as i do with dropbox at the moment.

    OwnCloud does have an iPhone app as well as an Android. I know that the one for Android works very nicely and even has an instant upload feature.

    Enjoy.

    https://itunes.apple.com/us/app/owncloud/id543672169?mt=8

    malakesher8 months ago

    When I create the admin account on owncloud and click finish set up the page say "Your web server is not yet properly setup to allow files synchronisation because the WebDAV interface seems to be broken." any idea what I did wrong?

    I ran into this problem the other night while building a Pi ownCloud box. Not knowing what this image looks like on the inside, my advice should be taken with a grain of salt, but what you can do (on a Debian-base such as Raspbian) is simply apt-get (or aptitude) install owncloud. This will give you a working, if old, version of owncloud. You can also go to the ownCloud web site link way below and add the repository to your sources.list and install the latest version. I can vouch for the Debian version working on the Pi as I finished it last night 2/11/2014 and it's working fine.

    Best of luck.

    http://software.opensuse.org/download/package?project=isv:ownCloud:community&package=owncloud

    francofool9 months ago
    It's not often I make a new account to leave a comment, but I felt I had to with this tutorial. Although I cheated by using the image you supplied, I really enjoyed the way you explained everything, as I am just sprouting out of my raspberry pi noob stage. Thanks for showing me how to get this up and running because now I have a 1T cloud at my disposal which is so awesome.

    To anyone else who is trying to keep the windows files system on their hard drive, I eventually just gave up on mounting it that way and did what the guide told me to do. I reformatted so 500GB were in NTFS and 500GB were in ext4. I went through several rewrites trying to keep it in windows and it just was not working. But reformatting and mounting the ext4 partition did the trick for me.

    Thanks again for the help, you did a great job
    vladcoolv10 months ago
    i will try it
    bugmeidareyou10 months ago
    The current location seems to be:
    wget http://download.owncloud.org/community/owncloud-latest.tar.bz2
    ypelster11 months ago
    Hi. I've downloaded the image and used win32diskimager to write it to SD card.
    Now I've inserted the card into PI, and plugged on (in that order) Ethernet and power.
    As I'm running headless and used to work with remote desktop connection up to now, I cannot see why, but I do not seem to have an Ethernet Connection. The controlling LEDs are off and I cannot see PI in my router as I used to. Any hints or ideas ?
    lau1406 ypelster11 months ago
    have you tried a different ethernet port on your router?
    ypelster lau140610 months ago
    yes, I've tried that. I have even borrowed a monitor, and pi doesn't seem to boot at all - I've attached HDMI cable, usb keyboard and usb mouse, then power. No signs of life from pi. On a different SD Card I have set up a system with NOOBS which runs just fine. Any Ideas ?
    lau1406 ypelster10 months ago
    You can try it without the image, doing steps 1 to 5 in stead of using the image.
    ridopc11 months ago
    Thanks for the tutorial! I have used and modified to make it one in Italian!
    shywolf9111 months ago
    Could this be used outside my local network?
    chizpa shywolf9111 months ago
    yes, just enter your public ip instead of your local ip (local: 192.168.x.x), global ip varies unless you have static ip or are using no-ip.

    Be sure to forward port 22 for SSH access and port 80 for HTTP access.

    Here's a link (if You want to know your global ip right now):
    http://www.whatsmyip.org/
    ps0ram11 months ago
    very good idea and tech http://esyncsecurity.com
    Fabi2801 year ago
    What's the average speed for a file transfer?
    Wouldn't using nginx speed it a bit up?
    koff1979 (author)  Fabi2801 year ago
    The file transfer speed is about 5-10 seconds to upload a 10MB mp3 file and about 3 Minutes to upload a 350MB video file.

    Using nginx might speed it a bit but it seems to be going at an acceptable speed and I've been using apache for about 12 years so am just more use to it.
    Topssot koff197912 months ago
    A very, very, good guide. A few spelling mistakes, but with an existing Pi I was up in 20 minutes. I didn't notice any point about changing the default .htaccess in /etc/apache2/apache2.conf to allow overrides, then the if needed the .htaccess in the default directories. However, small, stuff easily solved.

    NOTE: The stupid captcha (why are we doing this?) won't show on FF in safemode so I went this route.
    I'm also curious about the pi's performance. Did you test this on the new 512 MB Pi or the older 256 MB?
    koff1979 (author)  unholythree1 year ago
    Its with the 256MB Pi the performance is good. The thing to point out is I'm the only user of it which means it doesn't have to multi task at any point.
    Topssot koff197912 months ago
    A very, very, good guide. A few spelling mistakes, but with an existing Pi I was up in 20 minutes. I didn't notice any point about changing the default .htaccess in /etc/apache2/apache2.conf to allow overrides, then the if needed the .htaccess in the default directories. However, small, stuff easily solved.
    hey, great tutorial! Thank you so much!

    I just installed transmission on my pi, because it has a nice webui for adding torrents.

    Now I have a remote cloud storage/torrent seedbox that I can add torrents to from my iphone. It wasn't that hard, I just ended up:
    - copying (-p to keep permissions/ownership) the whole /var/www/owncloud/username/data to a USB thumb drive.
    - changing transmission user to "pi" (superuser) and making it part of the www-data group.
    - changing permissions of progress, torrentwatch and /data/files folders to 770 (so the "pi" user can write to them from www-data group)
    -opened some ports, did a test run, put a slash after /transmission/web url and....voila!

    I'll post a tutorial about how to modify to add transmission later if anyone is interested...or even if they're not xD.

    Thanks again for tut.
    TXTCLA551 year ago
    Hi, I used your image file to set mine up. However I dont have my external drive just yet, is there a way I can test this part out without the drive?
    You can follow this guide to try out what you are asking here:
    http://www.techjawab.com/2013/09/how-to-setup-your-own-cloud-on.html
    1-40 of 58Next »