Saturday, August 24, 2013

Installing ownCloud on Raspberry Pi

Presenting a ready-to-install image of ownCloud for Raspberry Pi 

A small introduction to ownCloud
ownCloud is an application which enables users to share their data without giving control to any third party posing as a facilitator. While sharing the data without loosing control is the main objective, ownCloud is much more than that. It can also rapidly sync the data, contacts, calendar events etc from several devices. It can work with several custom backends and it is highly flexible.

Many of us have a Raspberry Pi with us and we love playing with it. In past I have written posts on how to install Arch Linux on it and how to install OpenELEC to convert the Raspberry Pi into a Media Centre. This time I plan to go a little further. This time I have made a custom image which comes preinstalled with ownCloud and some tweaks to improve the ownCloud experience with Raspberry Pi. This image is based on Raspbian Wheezy.

Just follow the steps below and you'll be good to go in no time:
  1. Download the archived image from in either zip format (usually for Windows) or gunzip format (usually for Linux and Unix like platforms)
    Since I am running on Linux, I would download gunzip format.
  2. Extract it and put it on a SD card using dd or any other tool or command. Check out this article on elinux if you need any help for this. Although 2 GB SD card would be fine but I would recommend using 4 GB or more.
    I would run the following commands:
    $ gunzip owncloud-raspberrypi-0.1.img.gz # to extract the gz archive
    $ sudo dd bs=1M if=owncloud-raspberrypi-0.1.img of=/dev/mmcblk0 # to write to the SD card. /dev/mmcblk0 can be obtained by the output of df command.
  3. Put this SD card in your Raspberry Pi and boot. The default credentials are:
    user: pi
    password: owncloud
  4. Run raspi-config and follow the directions to expand the filesystem to enjoy maximum disk space. Reboot, if required.
  5. Run ifconfig to get the ip address of the Raspberry Pi.

That is it. Just open http://<ip_address>/owncloud and create the admin user and explore ownCloud on Raspberry Pi.

This image PHP execution time increased to 60 seconds and the upload limit has been bumped up to 500M. The Apache is set to allow .htaccess for the protection of data directory. Also SSH has been enabled by default.

The official page for the image can be found at ownCloud on Raspberry Pi. A Hacker News discussion is also going on here.

If you like this image and you are interested in knowing more about ownCloud, then please consider buying my book, Getting Started with ownCloud. It is available from Amazon.com, Amazon.co.uk, Barnes & Nobles and on Kindle.

20 comments:

  1. Your image file worked great. Thanks. You might also want to add the necessary entries to autoboot a USB harddrive since this thing is pretty useless without storage. And how to change the data directory over to the hard drive.

    ReplyDelete
    Replies
    1. Hi Richard,
      Thanks for the comments. I'll try to add these in the next release for sure.

      Delete
    2. Do you happen to know when this new release is coming out. I have having the same problem with the data directory, I need to switch it from an sd card on my raspberry pi to a hard drive that I have plugged into the pi through an external usb port (on a powered usb hub because the pi could not supply enough power).

      Delete
  2. Would you mind posting what changes/optimizations you made for people who might want to do something similar on a Raspian or some other pi distro?

    ReplyDelete
    Replies
    1. You find the detailed steps of optimizations done on a normal Raspbian Wheezy and installations steps for the same here http://www.techjawab.com/2013/09/how-to-setup-your-own-cloud-on.html

      Delete
  3. I would also like the changes/optimizations for learning experience.

    ReplyDelete
  4. Hi, can a network share / NAS be pointed at by the cloud?
    Ie I want to make my network share available from outside my home, and my mobile to sync all pics to my network share...

    ReplyDelete
    Replies
    1. I am not entirely sure what you mean by the above comment but as far as ownCloud goes, you can use a NAS as a storage backend for ownCloud.

      Delete
    2. Yes a NAS can be pointed by a cloud. You will just have to make sure that the "data" folder of the cloud is pointing on NAS. But one word of caution, any existing files in NAS will not automatically show up in cloud, you will have to manually upload them in cloud. This is because owncloud maintains a sqllite db for its operations. You can follow the guide here http://www.techjawab.com/2013/09/how-to-setup-your-own-cloud-on.html

      Delete
  5. Hi The default credentials do you change that?

    ReplyDelete
    Replies
    1. Yes. I have mentioned that in step 3.
      user: pi
      password: owncloud

      Delete
  6. Hi, can I add an usb HD to use usefully your image?
    Thanks

    ReplyDelete
    Replies
    1. Yes. Most of the times, as soon as you add the USB, it'll be mounted automatically.

      Delete
  7. it might be a stupid question but I only can use owncloud in my own net work.
    only with the ip 192.168.0.....
    what have I to do to get access over the internet

    ReplyDelete
    Replies
    1. Probably you have to open incoming connections from the internet to your owncloud in your router settings (all ports for the desired services). Additionally a dynamic DNS might simplify connecting your owncloud from the outer web world.

      Delete
  8. I've tried twice just now and both times the pi shows zero activity.

    ReplyDelete
  9. An update of the image would be awesome, with the Raspberry Pi 2 & ownCloud 8 out and all that. Contact me if you don't have a Rasberry Pi 2 and want one - for an update to the image and blog post, I would send you one ;-)

    ReplyDelete
    Replies
    1. Hi Jos,

      Thanks for the offer. I have got the new RPi2 recently. I'll get the image out in next few days. Dealing with day job at the moment. :)

      Delete

Note: Only a member of this blog may post a comment.