My Raspberry Pi Project
I‘ve had my Raspberry Pi now for a few weeks, so I thought it was about time that I started my first project. As a regular user of cloud storage, I have concerns over privacy and I also do not want to become dependant on any one provider, so to try and solve these two issues, I thought that I would set up my own cloud server. Configuring ownCloud would be the perfect challenge.
Before I Began
Before I began however, I had a list of criteria that my own cloud installation would need to satisfy:
- I would need access from outside my home network
- I would also need easy access via my mobile/tablet
- It would need to be configured such that I could leave it largely unattended or with minimal remote management/administration
After I studied the ownCloud website and documentation, I soon realised that all of the features that I required were available and fairly easy to setup, but I did have one issue. My ISP currently provides me with a dynamic IP address (one that changes, sometimes several times a day), so I would need a way of overcoming this if I wanted my ownCloud data to be accessible from outside my home network. Fortunately, that problem is easy to solve using a dynamic DNS service like no-ip, which points a website address at your current IP address and updates as soon as the IP address changes. I simply installed their update client on my Pi and configured it to run at startup, which updates the no-ip servers every 30 minutes (or more or less frequently if I choose).
Installation and Setup
Once I had the no-ip service up and running, the next step was to install ownCloud and its dependencies. I wont go into all the steps here, but I followed this excellent guide, which took me less than an hour. I also followed this guide, to ensure I had enabled HTTPS (so that only secure connections could be made to and from my ownCloud web interface).
I could access ownCloud successfully from other computers on my home network, but what about accessing when I’m away from home? To enable this, I would need to configure NAT or port forwarding on my router. I logged into my router and set ports 80 (HTTP) and 443 (HTTPS) to forward to the internal IP of my Pi. Now, when I entered my website address (the one no-ip assigned to by current IP address), or my current externally facing IP address, my ownCloud web interface would display – bingo! The only limitation of this, is that port forwarding does not work within my home network, so in order to access ownCloud there, I have to use the IP address of my Raspberry Pi.
Overcoming Some Issues
Whilst the whole process was surprisingly easier than I had thought, I did run into two particular issues. The first was that if the Raspberry Pi was rebooted, the USB memory stick I had connected to it (to be used as the storage device for my ownCloud data) would not mount until I logged into the Pi. I did not want to have to do this every time, so to solve this, I added the USB memory stick into my /etc/fstab file to ensure that it mounted on boot.
The second issue, was that I received an ‘operation not permitted’ error when trying to change the ownership of the USB memory stick, so that ownCloud could become the owner. I discovered that it was due to me having inadvertently formatted the drive to FAT instead of one of the EXT formats.
The final step was to install and configure the ownCloud clients on my mobile, tablet and other PCs. This was nice and straight forward, as it was just a case of installing the provided packages from the ownCloud website / app stores.
I now have a Dropbox or Google Drive replacement and what’s more, it’s open source and it’s running on my hardware, so I feel more in control of my data. Of course, I now have to burden any security risk and ensure that my software stays up-to-date, but as an educational exercise and for the benefit of having the data under my control, I’d say it is well worth the effort!