Introduction: Raspberry Pi Owncloud (dropbox Clone)

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. 

Step 1: What You Need

Picture of What You Need

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

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

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

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

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

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

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

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.


FlyingHazard (author)2017-01-25

Hey everyone! Not trying to hijack this post, just trying to be informative. It's been stated before that this Instructable is outdated. I recently posted one that is current with the latest version of OwnCloud-9.1.3, and I will update it as new versions come out. If you want to check it out, it's here!

FrankSimons12 (author)2016-12-07

Many Thanks. Very good instruction. I use Nextcloud and owncloud for free by

T0BY (author)2016-11-28

Thanks for this!

WaldenB (author)2016-10-06

An update (I expect); where it says to "change Allow over ride to All from none" in:

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

You might need to instead change it in:

$ sudo nano /etc/apache2/conf-available/serve-cgi-bin.conf

johnw354 (author)2016-03-25

I will update this post with a much easier and clear instructional since it is outdated.

This will help you install owncloud 8.x on an existing Raspbian Jessie install.

You will need a 64gb SD card. class 10 minimum write speed of 20 recommended.

Use this instructional video... However instead of typing version 6 in the Download use version8.

use this

Red_Ranger_ (author)2016-02-04

How do you "partion and format the drive"? I can do everything else I just can't figure out this part!!!

19b89 (author)2016-02-04

i could not get the php apc install

every time i try its came with error "makefile:186: recipe for taget 'apc)cache.lo' faild "

anyone could help me to fix this error please

DavisP2 (author)2016-01-29

Nice little instructable! I noticed a little typo, that might be vital if someone is just copy and pasting. In step 5 it says to use gparted and then the command says
$ sudo gprarted
There is an extra 'r' in there.

mvanbooven (author)2016-01-12

would this instructable work with a raspberry pi zero

mnc (author)mvanbooven2016-01-20

Pi Zero have no network interface. As far as I know; it is not yet tested with external network. but if you do all this, it should work.

michael_nonan (author)2016-01-12

can you stream video over the network?

fbaeta (author)2016-01-06

My major issues were about permissions and extras.

This link did not solved my problems all alone since I had to edit some config files.

The good thing was that it saved me a lot of time not doing things manually.


fbaeta (author)2016-01-05

Thank you for this tip.

I was having problems since upgraded to Jessie.

This link solved my issues!

RichGags (author)2015-03-30

This is great! Thanks so much. It works perfectly, except, when I install the desktop client, OwnCloud wants to connect to https. If I try my site with https, it fails. With regular http, it works fine. How do I enable https on my RPi?

scienceguy42 (author)RichGags2015-12-28

you need to set up a self signed certificate, turn on ssl in one of the config files, try look at the below link

QaadirK (author)2015-04-23

So will this let me login from anywhere even from outside my network?

scienceguy42 (author)QaadirK2015-12-28

set up port forwarding in your router and get external ip by going to

then type in http(s)://[external ip]/owncloud to access

DevB1 (author)2015-05-26

Great article. thanks. Also recommend looking at the owncloud installation via apt-get. Easier than downloading the link and handling ownership permissions for a begineer :-)

DbC1 (author)2015-02-07

hi i can access my owncloud login page fine from my local network,using my noip address. but when i try to go to my logon page in a browser from a remote computer. then i just get a white screen. have got any ideas on this please?

Gemcc (author)DbC12015-04-17

Have you port forwarded?

Gemcc (author)Gemcc2015-04-17

sorry, didn't see the other comments :)

MGl1 (author)DbC12015-03-26

Try to open ports on your router

DbC1 (author)MGl12015-04-02

Its ok. My fault. Another program on my pc was blocking the ports. All works great now. :-)

MGl1 (author)DbC12015-04-03

No problem :D... I'm glad to hear, that my advice helped you :D

harvsch (author)2015-03-31

So, what's your point?

How have your comments added to the effort put in by the author?

Why don't you write an instructable on how to build a personal cloud server based on the bannanapi?

RichGags (author)2015-03-30

MGl1 (author)2015-03-10

in the march 2015 you can get version 8.0.0 working on your raspberry pi

you have to do:


and to untar downloaded file

sudo tar -xjf owncloud-8.0.0.tar.bz2

Enjoy :D

fboteroh (author)MGl12015-03-14

Hi MGI1, I got a question. I want to do it for the first time. Should the image be installed before doing wget... ? Tks

MGl1 (author)fboteroh2015-03-16

What image? Raspbian?

fboteroh (author)MGl12015-03-16

Yes. It could be... or the one you've setup (Clouddit.iso)...


MGl1 (author)fboteroh2015-03-16

You need to have Raspbian installed!! And then just follow all the instructions until the 4th step. Then you replace first two commands with commands i gave you, and then continue :D...

fboteroh (author)MGl12015-03-16

Thank you very much!

willrob2015 (author)fboteroh2015-03-26


New here... I'm looking to do this process, but I struggle with a some steps. First is on step 2. I don't find a ip address. I can do ifconfig and see I have one, and can use the browser as well. But when I use the command nothing shows up. Second, on step 3 I seemed to do well and find everything until I try following the "find extension=section". Where do I put this command/extension? From there I figured I'll wait until I can really get those things working. If you could let me know that would be amazing! Thanks!

tony.steinbock (author)2015-03-03

On the Banana Pi you can also create an Cloud System with more power:

BrianM10 (author)2015-02-07

externsion = section doesn't exist in the file. extension = section doesn't exist in the file.

DaveH4 (author)BrianM102015-02-21

i think he means extention

MariusB1 (author)2015-02-11

Great instructable. Thank you

ed.torres.359 (author)2014-12-31

I'm getting the error "chown: cannot access `/media/owncloud': no such file or directory" even though I've followed your steps to the T. Help is appreciated

ThomasE2 (author)ed.torres.3592015-01-24

the reference directory for the owncloud server is no longer there. (return error 404). with this info, if I had to guess, the owncloud directory is never created. Checkout the link below for updated installs.

sverkerw (author)ed.torres.3592015-01-03

when do you get this response?

BryceThomas (author)sverkerw2015-01-07

I'm getting the same error, after attempting to partition the drive - it's likely that I'm doing that step wrong, but since there's no direction in the step, I don't know how to change that.

DbC1 (author)2015-01-14

thanks loads!! it works great! your tut has helped me so much.


gcheintz (author)2015-01-09

Thanks for the guide! I was thinking about buying a pi and doing this. Just one question, will it work equally well with say a banana pi or cubieboard? They seem to have a lot faster network speed and general specs.

Also, I didnt understand if this is like an independent OS or if you like install it on raspbian or whatever is the OS on the pi? I kinda would like to use owncloud on the pi together with OTHER usages too if possible.

tony.magliulo (author)2014-12-18

For folks looking for a dead simple (and free) way to roll your own Dropbox, check out odrive. The SFTP integration gives you the Dropbox experience on anything that runs SSH which, of course, can include the Raspberry Pi.

Full disclosure: I work for odrive. The reason I work here is because I am passionate about this stuff. I fought hard for the SFTP integration because I think it will open up a whole new world of possibilities for your existing storage and devices, so I am trying to get the word out. Overlaying sync on top of SSH gives you that "Dropbox experience" against your own storage, pretty much instantly.

sverkerw (author)tony.magliulo2015-01-03

You are spamming for a product that doesn't even exist for linux? Fresh.

tony.magliulo (author)sverkerw2015-01-03

I realize that it will not be for everyone, and certainly isn't a 1-to-1 replacement for Owncloud, which is a great product. We are looking into client integration to Owncloud, as a matter of fact.

I am simply trying to offer up an easy way to achieve dropbox-like access to your own storage, because I know how difficult it can be for some, as evidenced in these comments.

A linux client actually does exist, it is just in private beta right now. Windows and Mac clients, however, are already available to the public for free.

sverkerw (author)tony.magliulo2015-01-06

Mhm. Quick feedback: you currently do not have the product you are trying to sell. This is a site for how-to's and instructables. You are not supplying it. This is spam, and not what I'm looking for.

DominicG1 (author)tony.magliulo2015-01-04

Tony, when will the linux client be made available?

tony.magliulo (author)DominicG12015-01-05

Hi Dominic,

We are shooting to have something out in March, if not sooner. Since the client will allow linking to not only SFTP but many other sources like OneDrive, Google Drive, Dropbox, etc.., there is a lot to work through, as you can imagine. You can keep up-to-date on our blog and forums, though.

DominicG1 (author)tony.magliulo2015-01-05

Excellent. I use odrive to access multiple Google Drive accounts on my Windows PC and there are a few files that I would like to back up to Google Drive from my Raspberry Pi. If you need any beta testers for the Google Drive integration on Linux let me know! Thanks.

About This Instructable




Bio: Making Stuff since the 80's
More by koff1979:Raspberry Pi Owncloud (dropbox clone)Solar Powered Raspberry PiRaspberryPi Media center - XBMC
Add instructable to: