I experienced a small bit of frustration recently when Dropbox thought it was a good idea to delete about a third of my about 10 GB of data. Fortunately, with a bit of effort I could perform a restore on the lost data, one file at a time.
Now we use services such as Dropbox because of the convenience, however, if it is no longer convenient, or even safe, then perhaps it is time to investigate alternative diy options. Don’t get me wrong though, I will probably never get rid of Dropbox, however, I will still want to use my own service for items I consider a security risk, such as work documents.
I have been toying with the idea of hosting a backup service for my data, specifically the stuff I usually backup manually and keep in sync between my various desktops and laptop. So why not just spin up something that will replace all the cloud storage I currently use on my own server.
In comes ownCloud promising many features:
- File sync through a webdav interface,
- sync contacts, calendars and bookmarks,
- web access to said services,
- and an api to build your own apps around ownCloud.
It seems simple enough. For the server on ubuntu it’s as simple as
apt-get install owncloud
This installs the server environment on your server, in my case, a droplet in Amsterdam.
On your workstation their instructions are simple enough to add the ppa to your repository.
# echo ‘deb http://download.opensuse.org/repositories/isv:ownCloud:devel/xUbuntu_12.04/ /’ >> /etc/apt/sources.list.d/owncloud-client.list
# wget http://download.opensuse.org/repositories/isv:ownCloud:devel/xUbuntu_12.04/Release.key
# apt-key add – < Release.key
# apt-get update
# apt-get install owncloud-client
The above is valid for 12.04 LTS, so just change the 12.04 in the first instruction to your version, e.g. xUbuntu_12.04 becomes xUbuntu_13.04. Now you have both a client and server installed. There are also windows and mobile clients – I’m not that concerned with them for the moment.
Its a breeze to use ownCloud as Ubuntu has already done all the work for you. Just point to your domain, http(s)://yourdomain/owncloud
First step is to create your administrator account, but that will fail. The database needs to be configured.
# mysql -u root -p
CREATE DATABASE owncloud;
GRANT ALL ON owncloud.* TO ‘owncloud’@’localhost’ IDENTIFIED BY ‘some_password’;
Under the advanced selection you can enter the db details as configured above. Choose a suitable username and password and Bobs your uncle, you have an ownCloud server.
I’m not sure yet where the data is stored, must be somewhere sensible. I also expect to be able to change the target folder once I add more storage to the system. We’ll explore that in a follow up post.