In this segment we are going to "Install NextCloud on RaspberryPi inside OpenMediaVault"
What is OpenMediaVault ?
OpenMediaVault (OMV) is a free Linux distribution designed for Network-Attached Storage (NAS).
The project's lead developer is Volker Theile, who instituted it in 2009. OMV is based on the Debian operating system, and is licensed through the GNU General Public License v3.
Equipment Required :
Raspberry Pi 3 Model B +
Micro SD Card "Minimum 4 GB"
Ethernet Cord for LAN Connection
External Hard Drive or USB Drive
Raspberry Pi Case
What is NextCloud ?
Nextcloud is a suite of client-server software for creating and using file hosting services. It is functionally similar to Dropbox, although Nextcloud is free and open-source, allowing anyone to install and operate it on a private server.
In contrast to proprietary services like Dropbox, the open architecture allows adding functionality to the server in the form of applications and enables users to have full control of their data.
The original ownCloud developer Frank Karlitschek forked ownCloud and created Nextcloud, which continues to be actively developed by Karlitschek and other members of the original ownCloud team.
Access OpenMediaVault Web Interface
- To access the OpenMediaVault Web Interface we need to find the IP Address of our Raspberry PI.
- To find out the IP we will use the Wireless Network Watcher and it will display the IP as shown below.
- Type this IP Address to your browser and it will open the login page for your OpenMediaVault.
- Now, you need to enter the username and password and login to your OpenMediaVault.
- OpenMediaVault Address = Your Raspberry Pi IP Address
In my case 192.168.1.73
- Default Username : admin
- Default Password : openmediavault
- First of all from General Settings, under Web Administration change Port to 90 or any other port that you want.
- Change Auto logout to Disabled.
- Now, Change the Web Administrative Password.
- After that we need to navigate to services to SSH enable Permit root login.
Accessing SSH Console
- Now, we need to Login to SSH.
- Default Username : root
- Default Password : openmediavault
- On the first login you need to change the password.
- Once the password is changed we need to go ahead with NextCloud Installation.
OpenMediaVault Apache and PHP Installation
/> Updating and Upgrading OpenMediaVault
apt-get update apt-get upgrade
/> Installing Apache Web Server
apt-get install apache2
/> Installing Mariadb DataBase
apt-get install apache2 mariadb-server libapache2-mod-php7.0
/> Installing PHP Packages
apt-get install php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring apt-get install php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip
/> Restarting Apache Web Server
service apache2 restart
OpenMediaVault NextCloud Installation
/> Navigate to HTML Directory
/> Downloading and Extracting NextCloud using Curl command
curl https://download.nextcloud.com/server/releases/nextcloud-14.0.3.tar.bz2 | sudo tar -jxv
/> Creating Data Directory for NextCloud to save the Information
sudo mkdir -p /var/www/html/nextcloud/data
/> Providing Control of NextCloud folder to Correct User and Group.
sudo chown -R www-data:www-data /var/www/html/nextcloud/
/> Providing right permissions to NextCloud DATA folder.
sudo chmod 750 /var/www/html/nextcloud/data
Access NextCloud from Internet
- To access the NextCloud from Internet, we need to complete 3 steps.
- Port Forwarding
- Setup Dynamic DNS [In case you don't have a Static Public IP Address]
- Add website to Trusted Domains
Setting up Port Forwarding on Router
- To forward the port on the router, we need to know the IP Address of our router.
- To check the router IP Address we can use the Wireless Network Watcher.
- It will display the router IP Address as shown below.
- Type this IP Address to your browser and it will open the login page for your router.
- Now, you need to enter the username and password and login to your router.
- If you don't know the username and password of your router you can always ask your ISP.
- For personal routers you can always check online for default username and password for the router.
- In my case i need to navigate to services and then move to Port Forwarding, Your's might be different.
- Then you need to forward Port 80 and 443, to the Raspberry Pi IP Address.
Setting up Dynamic DNS
- First of all we need to visit DUCKDNS website to create a Free Dynamic DNS Domain for us.
- You can use any of the above method to login to DUCKDNS website and create a sub-domain for your website.
- Once you logged in then create a sub-domain for your NextCloud and can visit NextCloud by that address.
- For example in my case i have created omvpcmac as my subdomain.
- So, i can access it as omvpcmac.duckdns.org.
- You can create 5 subdomains on Duck DNS account for free.
Add website to Trusted Domains
- To add our website to Trusted Domain's we need to edit NextCloud Configuration file.
- We can either use WinSCP and we can use nano command to edit the file.
/> Edit NextCloud’s Configuration File
sudo nano /var/www/html/nextcloud/config/config.php
'trusted_domains' => array ( 0 => '192.168.1.73', ),
'trusted_domains' => array ( 0 => '192.168.1.73', 1 => 'omvpcmac.duckdns.org', ),
Add External HDD to NextCloud
- Connect the External HDD to Raspberry Pi
- From the NextCloud Menu select Apps and then enable "External Storage Support".
- After that we need to open Putty, login with root user and type these commands.
sudo chown -R www-data:www-data /path/to/localdir sudo chmod -R 0750 /path/to/localdir
If you come across any issues or have some feedback related to this tutorial, Please share your thoughts.