I Made My Own ownCloud!
Have you heard the saying, "There is no cloud — it's just someone else's computer"? Ever thought about what would happen if that computer disappeared overnight? The chances of Google or Dropbox vanishing are slim, but it does happen. After my wife and I got married, we started thinking about how to preserve all those digital wedding photos. We had them on a flash drive and in Google Drive, but I wanted more control. Time to build a Helmers Family Dropbox.
⚠️ Historical note: This post was written in 2017. Since then, the ownCloud project forked and Nextcloud has become the more actively maintained and community-supported option — it's what I'd recommend today. ownCloud also had a serious security vulnerability (CVE-2023-49103) disclosed in 2023. If you're starting fresh, use Nextcloud instead.
Why ownCloud (at the time)? It was open-source, free, and transparent. It had a Google Play app for phone backups. I liked the interface. And there was a large community to lean on for help.
For this project I used a Raspberry Pi 3 (built-in WiFi, 4 USB ports, more powerful processor than the Zero) and a 1TB Seagate external hard drive to store all the data.
Steps to Follow
- Raspberry Pi prep
- Build a web server
- Add SSL to web server
- Install ownCloud
- Prep and mount the hard drive
- Configure access from phone and internet
1. Raspberry Pi Prep
I used Raspbian Jessie Lite (no GUI) to save resources. After the initial setup, I ran:
sudo apt-get update
I also set a static local IP for the Pi using my router's DHCP Reservations feature — in my case, 192.168.1.143.
2. Build a Web Server
sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5 -y
sudo service apache2 restart
This installs Apache and PHP, which form the foundation for accessing ownCloud. To confirm it worked, navigate to the Pi's IP address in a browser — you should see the Apache default page.
3. Add SSL to the Web Server
HTTPS ensures that no one can intercept my data in transit, whether I'm accessing ownCloud from home or anywhere else in the world.
Create a folder for the certificate:
sudo mkdir /etc/apache2/ssl
Generate a self-signed certificate:
sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 \
-out /etc/apache2/ssl/server.crt \
-keyout /etc/apache2/ssl/server.key
Edit the SSL config to point to the new certificate:
sudo nano /etc/apache2/sites-available/default-ssl.conf
Replace the placeholder certificate lines:
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
With:
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
Enable SSL and restart Apache:
sudo a2enmod ssl
sudo service apache2 reload
4. Install ownCloud
sudo wget -nv https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo sh -c "echo 'deb https://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' > /etc/apt/sources.list.d/owncloud.list"
sudo apt-get install owncloud
Redirect Apache's default page to ownCloud:
sudo nano /etc/apache2/sites-enabled/000-default.conf
Change DocumentRoot to /var/www/owncloud.
Increase upload limits so ownCloud can handle large files (up to 2GB):
sudo nano /var/www/owncloud/.htaccess
php_value upload_max_filesize 2000M
php_value post_max_size 2000M
php_value memory_limit 2000M
sudo nano /var/www/owncloud/.user.ini
upload_max_filesize=2000M
post_max_size=2000M
memory_limit=2000M
5. Prep and Mount the Hard Drive
The Pi's 16GB SD card isn't nearly enough storage. I needed to mount a 1TB external drive for ownCloud to use.
Install NTFS support (so the drive can also be read on Windows if needed):
sudo apt-get install ntfs-3g
Format the drive:
sudo mkfs.ntfs /dev/sda1 -f -v -I -L untitled
Create a mount point:
sudo mkdir /media/ownclouddrive
Find the drive's UUID:
sudo blkid
Add a persistent mount entry so the Pi always reconnects the drive on boot:
sudo nano /etc/fstab
Add the following line (replacing YOUR-UUID with the value from blkid):
UUID=YOUR-UUID /media/ownclouddrive auto nofail,uid=33,gid=33,umask=0027,dmask=0027,noatime 0 0
6. Configure Access from Phone and Internet
Navigate to https://192.168.1.143 or https://192.168.1.143/owncloud in a browser. You'll get a certificate warning — that's expected, since the certificate is self-signed. Click through it.
Create your admin account, then go to Storage & Database and point ownCloud at /media/ownclouddrive.
To enable access from outside your home network, forward TCP port 443 (HTTPS) on your router to the Pi's local IP. You can then reach ownCloud from anywhere using your external IP address.
Download the ownCloud (or Nextcloud) app from your app store of choice, enter your server address, and you're syncing.
Desktop clients are also available if you want to sync to a computer.
Takeaways and Future Thoughts
Unexpected problems: I made a lot of mistakes — editing wrong files, mistyping commands. At one point I wanted to start fresh but needed to overwrite files I'd already mangled. Eventually found this:
sudo -o Dpkg::Options::="--force-overwrite" apt-get install apache2
Future concerns: The usual — what happens if my IP address changes? I also want to verify that the NTFS-formatted drive is actually readable from a Windows machine, but I don't want to risk data I've already stored on it.
Future enhancements: I want to sync my existing Google Drive and Photos into this setup someday.