Selected for you
Articles Hierarchy
Banana Pi M2 Berry: Your cloud service on your server - nextcloud
Cloud services are very popular and the offer is big.
Not all your data you want to save on thirt-party servers. So, then you can use own cloud service on your server.
This tutorial will be working on Banana Pi M2 Berry (SBC with SATA interface), but the tutorial is the same for another SBC like Raspberry Pi, Orange Pi or Nano Pi.
I used this tutorial which I modified for my setting.

Other articles about BananaPi M2 Berry:
Banana Pi M2 Berry: first start, iperf, sysbench and thermal imaging picture
Banana Pi M2 Berry: SATA interface and speed test (dd, hdparm, rsync)
Banana Pi M2 Berry: Your cloud service on your server - nextcloud

The OS is running on microSD card, but as I mentioned the Banana Pi M2 Berry contains SATA interface. So I used it.
The HDD is used like storage only for Nextcloud data.

If you have some single-board computer and HDD we can start.
Is not neccessary to use HDD with SATA, you can use the bridge for SATA-to-USB.

The first and also important step is format of HDD. Use some usable filesystem. E.g. don not use NTFS. It is complicate for next using. You can choose EXT4 filesystem. There is no problem.

Ok, let's update & upgrade the OS
sudo apt-get update
sudo apt-get upgrade

Install the Apache 2:
sudo apt-get install apache2

If you have OS based on Debian Jessie, use this command:
sudo apt-get install php5 php5-gd sqlite php5-sqlite php5-curl

If Debian Stretch, then this:
sudo apt-get install php7.0 php7.0-gd sqlite php7.0-sqlite php7.0-curl

Restart the Apache 2:
sudo service apache2 restart

Link to a new folder:
cd /var/www/html

Download the nextcloud:
Maybe now is available the newer release, so check the website
If there is a new version of nextcloud, change the path from e.g. to
curl | sudo tar -jxv

Link to /nextcloud folder:
cd /var/www/html/nextcloud

Change the owner:
sudo chown www-data:www-data config apps

Plug in the HDD and make the folder /SATA to /var
sudo mkdir -p /var/SATA

Mount the HDD partition (e.g.. dev/sda1) to /var/SATA/ folder
sudo mount /dev/sda1 /var/SATA/

The HDD should be connected to folder. So, make the /nextcloud folder:
sudo mkdir -p /var/SATA/nextcloud

Change the owner:
sudo chown www-data:www-data /var/SATA/nextcloud

Change the rights:
sudo chmod 770 /var/SATA/nextcloud

Open your webrowser and write the IP address of the server:
IP address you can find by ifconfig command or in the setting of your router.

Fill up the user and password, from the Storage & database combo-box (drop-down menu) fill up the path to nextcloud data /var/SATA/nextcloud/data

And that's all. Nextcloud shows you the possibility to install App to Android and laptop.
There is address of your nextcloud for App: