• Cut down fixed monthly expense: Google recently announced that High Quality pictures stored on Google Photos will start counting towards the free Google Account storage (15 GB) starting from June 2021. I’m a great fan of Google Photos & have promoted it a lot back in the days when it was still a new thing but I’ve been opposing the subscription based model to cut down on my fixed monthly expenses.

  • Increased sense of privacy: All of our data resides with half a dozen of companies who’s name change per country (Google, vk, wechat, Tencent, Microsoft). They know a lot about us :) and power might get abused.

  • Cool to have your own domain associated with your cloud: At times it’s good for an individual/SME to have their cloud sharing links associated with their domain. ( ->

What is Nextcloud?

Nextcloud is an open source application which you can host on any machine to make your own private cloud with your control. It allows domain association. So your file storage can be accessed using

Where to host?

You can host Nextcloud on any linux machine (or perhaps on Windows as well). I’ll strongly suggest to take this decision based on

  • Your storage needs &
  • Data transfer limits (if any)

Hetzner, DigitalOcean & Linode are some cheap and quality hosting providers which I’ll suggest to go with.

Since I had a 1TB Hard disk along with a raspberry pi 3b+ lying around, I decided to save on some money and use these stuff.

How to host?

I decided to use mariadb server along with Nextcloud. So I started two docker containers with mariadb-server and Nextcloud images respectively. Here’s the docker-compose file you can use to set Nextcloud & Mariadb. I went ahead using mounted 1TB HDD with Nextcloud container.

version: '3.9'
    image: nextcloud:apache
    restart: always
      - 8080:80
      - /mnt/hdd/nexctcloud_data:/var/www/html
      - nextcloud-network
      - MYSQL_HOST=db
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=nextcloud
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
      - /mnt/hdd/mariadb_data:/var/lib/mysql
      - nextcloud-network
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_ROOT_PASSWORD=nextcloud
      - MYSQL_PASSWORD=nextcloud


I had apache2 installed on my pi running pi-hole. So I decided to set a reverse proxy going to the Nextcloud container which was being exposed on port 8080. Here’s the Apache’s VHost Configuration. Note I make sure the /.well-known/acme-challenge path is not proxied. This comes in handly to use certbot for SSL certificate generation from Let’s Encrypt.

<VirtualHost *:80>
    ProxyPass /.well-known/acme-challenge ! #For DNS verification by Let's Encrypt
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

RewriteEngine on
RewriteCond %{SERVER_NAME}
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

The very first time when you’ll try opening Nextcloud, it will prompt you to set your credentials and configurutation for the database server instance. Once done, your personal cloud should be ready.

Example image

Apps to install on Nextcloud hub

Nextcloud hub is filled with great apps. Some of the apps which I’ll personally recommend are:

  • Contacts
  • Calendar
  • Phonetrack
  • Notes

Applications for Android

DAVx5 - Syncs contacts & calendars bidirectionally from my phone & pi

Nextcloud - The official nextcloud app. You’ll have to enter your credentials and things are good to go. Provides functionality to auto upload images (similar to Google Photos - Auto Backup).

Phonetrack - Find my Phone like functionality with just Google not storing or knowing where your phone is.

Notes - A Google Keep alternative. A note-taking app where all your notes are stored on your nextcloud server as .txt

Downsides of nextcloud or the whole process

  • Internet speed: I have a DSL at home with slow speed which means whenever I’m trying to access a file, it is trying to upload it at the rate of 9.75 Mbit/s.
Retrieving configuration...
Testing from ISP (
Retrieving server list...
Selecting best server based on ping...
Hosted by Proximus [7.34 km]: 14.73 ms
Testing download speed.................................................
Download: 92.74 Mbit/s
Testing upload speed...................................................
Upload: 9.75 Mbit/s

To solve this partially, I added the local IP of my raspberry pi in the local DNS (alternatively you can add this in your /etc/hosts file). This makes sure that when I’m accessing nextcloud from within my network, the speed is faster (my network speed at play rather than Internet’s).

To streamline this, we can utilise caching, or move to a better internet or host it with any of the IaaS cloud providers.

  • Conflicts while auto-uploading images

This error keeps appearing back. The impact isn’t much because it does upload all files but the notification is annoying. I’ll update you once I’ve figured out the root cause here.

Nextcloud issues


Nextcloud is free, open-source & has a huge community of developers. My current issues are mostly related to my efforts to save costs. If I’d be hosting this on Linode or DigitalOcean the experience should be smoother.

I’m still happy that my data is in my control and I’m able to associate my domain with my cloud storage.

Next steps

  • Setup caching: APCu, Redis or Memcached. APCu should be best for my setup as it’s single node.

  • Buy another 1TB HDD and setup RAID1 using mdadm.

  • Setup daily backups to an archival service like S3 glacier.

  • Setup monitoring and logging.

Please feel free to contact me via Twitter for suggestions or improvements.