Personal cloud storage on the Orange Pi

Set up the personal cloud service

One cool and practical project you can do on an Orange Pi or a Raspberry Pi is to set up a free, personal and “on-premise” version of Dropbox. This will allow you, among other things, to share files between your different devices. Additionally, you can automatically upload any new pictures from your phone to the cloud storage. In this tutorial you will learn to install the private cloud server software, configure it and sync files from a mobile device. I tested these steps on the Orange Pi and I assume this will also work on the Raspberry Pi. We will store the data on and external device, like a USB flash drive or external HDD, connected to the Orange Pi.

The could server software we will use is Nextcloud. Nextcloud is very similar to Dropbox, the main difference being that Nextcould is open source and completely free. The next steps are loosely based on a Nextcloud installation guide for the Raspberry Pi. Also, I used the official Nextcloud documentation. Before installing Nexcloud, we need to install some dependencies. We will basically create a LAMP server. First update the package list:

sudo apt-get update

Then we need to install apache:

apt-get install apache2

To check the installation, type in the IP address of your Orange Pi in the browser of any device connected to your home network. You should see this page:

Next, install PHP and a database system. We have a few choices of databases: SQLite, MySQL and MariaDB. Here I will use MariaDB. You can also use MySQL. To install MySQL on the Orange Pi, please see this post. To install MariaDB:

sudo apt-get install mariadb-server

MariaDB will ask you to create a root password, which you will need further in the Nextcloud installation. Then, to install PHP:

Now type in the IP of your Orange PI, followed by “/nextcloud” (e.g. 192.168.0.12/nextcloud) in the browser of any device on your home network. You should see the Nextcloud configuration screen:

Type in a username and password, that you will need later to connect from your phone. Expand “Storage & database”. Under “Data folder” put “/disk/nextcloud/data”. In the database section type in the root credentials and pick a database name of your choosing.

Synchronize files from the phone

To transfer files from the phone you need to install the Nextcloud client app from the App Store or Google Play, depending on your device. After installation, open the app and type in the server address as before (e.g. 192.168.0.12/nextcloud) and your username and password:

Allow the app access to SD, if asked. Once logged in, you can either upload files manually or choose to auto-upload files to the cloud. To enable auto-upload touch the burger menu to the top left and select “Auto upload”: