Geschätzte Lesezeit: 9 minutes

NextCloudPi (NCP) made my life easier after a year with my Raspberry Pi 3 (RPI3) and a lot of stress related to Homecloud. I have now decided to go one step further and become more powerful. In the following section I briefly tell you about my experience with the RPI3.

I bought the RPI3 with the aim of having a better media player than Kodi on the FireTV, which was very slow in its first version at the time. To cut a long story short, I tried and used it for a long time, but the new FireTV sticks were simply stronger. Then I found out that you can create your own cloud with the device what awakened my interest. I started with OwnCloud until I realized that there was a lot to pay for and that NextCloud was the better alternative and that the original co-founder of OwnCloud had migrated there.

The installation and maintenance of NextCloud on Raspbian, however, was so difficult that it was not nice and was by no means beginner-friendly with PHP configurations or memory caches. With every update there were new requirements and bugs and especially for a Linux newbie like me that was horrible. So I came across the NextCloudPi project from NachoParker through forums. This offers everything that NextCloud also offers, only much easier and better.

The main advantage is the web interface with easily configurable functions such as Let’s Encrypt for an always working SSL certificate or automatic backups.

NextCloudPi WebPanel
NextCloudPi WebPanel

Why the ODROID N2?

The ODROID N2 is currently (June 2020) still one of the strongest SBC’s (single board computers) and relatively good value for its money. I bought the device directly from the manufacturer for the equivalent of 115 euros with 4GB RAM. Included: power supply, suitable housing and a 16GB eMMC module. Experience has shown that eMMC modules are much more stable than microSD cards and also much faster. 8GB are a minimum requirement for the project. The performance difference between RPI3 and, for example, the ODROID N2 is considerable. If you want to spend even more money, you can also use an ODROID H2, as it can be increased to 32GB RAM. The N2 contains a passive cooler and therefore makes no loud noises or no noises at all.

According to NCP developer NachoParker, there is no technical reason to stay with an RPI3. The RPI3 enjoys a large community and is well known and is therefore often used and supported by him, but in his words: HW is
worse, SW is worse…

The biggest disadvantage of all Raspberry Pi’s is that they do not support Gigabit LAN and are connected to the same controller as the USB ports, which often slows down data transfers. However, it should also be pointed out that the ODROID N2 does not have a built-in WLAN or Bluetooth module for this and must be retrofitted via USB if necessary, even if I strongly advise against it for WLAN for a cloud.

ODROID N2
ODROID N2 (Source: Hardkernel (June 21, 2020))

NAS system

Here it depends a lot on personal preferences, what exactly you want to do and also on your available budget. So it is possible to build a RAID system with several HDD’s, but also just to hang one SSD on the single-board computer. This depends on what the cloud is used for and to what extent.

Basically there are only a few limits. If you have the money, the ideal occupation is probably to save the data on an SSD and thus have super-fast access, but to save it on an HDD to ensure the backup. I finally decided on a future-proof variant, consisting of a RAID housing and two 4 TB NAS HDDs.

The high price that has resulted for me is due to the security that I wanted to have guaranteed with RAID 1. If you want to know more about RAID, you should read the article "RAID im Überblick".
It is not necessary to buy two hard drives, depending on the purpose, a hard drive or even an SSD does it and thus also reduces the purchase price.

RAID Gehäuse
IcyBox RAID housing
IcyBox RAID housing connectors

Installation

In general there is currently only the Docker version for NextCloudPi with the ODROID N2 (at least I am not aware of anything else). Armbian is currently not officially supported. The great advantage of Docker is that in the event of a device reset, a corrupt system or other problems with Docker installation, all files and databases including all users with their NextCloudPi settings are saved on the hard drive. The systems can also be exchanged seamlessly and work again immediately after installing the Docker image and connecting the corresponding hard drive (s).

First place the eMMC on the board. Make sure that the switch is aligned to the right. Next we have to connect the N2 to the power and wait until it configures itself for the first time. Then it has to be disconnected from the power and then reconnected. You can now connect the RAID system to the N2 via USB. The easiest way to reach the N2 for configuration is with the program PuTTY, with which you can reach the device via SSH. To do this, you need to find out the device's IP address and enter it in the program. You can often find these out via the web interface of your router, such as a FritzBox. Log in with the following standard data:

User: root
Password: odroid

Before we can really get started, we first have to release the required ports in our router. With the FritzBox this happens under the tab Internet -> Forwarding -> Port Forwarding and then click on the button "Add device for forwarding". The ports are 80, 443 and 4443. Choose the right device, so make sure it's the N2!
With the FritzBox, the forwarding is possible with the designation HTTP server, HTTPS server and then a manually created release for port 4443.

Linux system updates

The first step that should definitely be done is to update the Linux OS, which in my case is Ubuntu. Execute the following commands in this order.

sudo apt upgrade
sudo apt full-upgrade
sudo reboot

Docker installation

Since we want to install NextCloudPi in a Docker container, we first need Docker itself. It should be mentioned that BTRFS with Docker is hardly or only very difficult, for example using the snapshot function. The following commands are necessary for this.

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

Mount the RAID system

After the Docker installation script, we set up the access / write rights for our RAID system. Before we can do that, we first have to give the RAID system a file system. With the fdisk command you can find out what the system is called. In my case /dev/sda. Replace this with the location that is shown to you. Now we mount the system anywhere on our N2. In my case, simply the folder storage with subfolder data, if other projects should also store data on the system.

fdisk -l
mkfs.ext4 /dev/sda
mkdir /media/storage
mkdir /media/storage/data
mount /dev/sda /media/storage
chmod +x /media/storage/data

Since the hard drive is now mounted, we also have to ensure that it stays that way every time we restart and that we don't have to mount it manually from the command line again and again. With blkid all /dev devices are listed again. Make a note of the UUID. Add a new line in the editor that results from the third command and make sure that the last line is an empty line! Please replace the UUID with your own. You can find a more detailed explanation here: WikiUbuntu – fstab

sudo blkid
sudo nano /etc/fstab
UUID=bbf85ecb-cc61-40ed-ba7b-d7b804ee845e /media/storage ext4 defaults 0 2

NextCloudPi installation & start

Now we come to the actual installation of NextCloudPi with the following command. Please change the IP to the IP that your N2 was assigned by the router! It is the same one that you used to log in via SSH and thus to find out via the router. Do not continue with the next steps until you see “Init Done” in the console. You can exit the logs with the key combination Ctrl + C.

IP=192.168.178.47
docker run --restart=always -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/storage/data:/data --name nextcloudpi ownyourbits/nextcloudpi-armhf $IP
docker logs -f nextcloudpi

Then you almost made it! Now call up your cloud in the browser:
https://ip_or_domain (the IP of the N2)
Make a note of the data displayed for the web panel and login. Then go to the web panel to make the first settings.
https://ip_or_domain:4443 (the IP of the N2)

Publish the cloud

In order to make your instance of NextCloudPi accessible to the internet, you need a DDNS provider and Let's Encrypt. But one after another. Depending on whether you really only want to have ncp as a user for administration, you should log into the account once and set up a new account for yourself with administrator rights. Back in the web panel (:4443) we go to the DDNS provider we selected under the Networking tab. I personally chose spDYN . You will receive your chosen domain and your token, which you enter and the thing is done. For a functioning SSL certificate, go to letsencrypt in the same tab. Enter the same domain, your email and the admin to be informed in the cloud yourself, and you are done!

In order for this to work, the DynDNS function must also be activated in the router. I explain it again using the FritzBox as an example. Under the tab Internet -> Forwarding -> DynDNS. Depending on the selected DynDNS provider, select accordingly or create it yourself. With spDYN you have to create it yourself. Enter the following data:

Update-URL: https://update.spdyn.de/nic/update?hostname=&myip=<ipaddr>
Domain name: your chosen domain, which you also specified in the web panel
User name: your email
Password: your password

You made it! Everything set up ready. Now you can make any settings in the web panel and install all apps of your choice. NextCloudPi will offer you real value! The performance or the speed is incomparable with an RPI3.

  • ODROID-N2 with 4GB RAM, power supply, housing & 16GB eMMC module Linux for 115 €
  • ICY BOX IB-RD3662-C31 RAID case for 2X 3.5 inch SATA hard drives for 95 €
  • 2x Western Digital WD Red 4TByte (3.5 inches) for € 107 each = € 214

a total of 424 € for the listed setup on my purchase date about a year ago


Summary

With this setup you are very well positioned. I have at least 15 Docker containers active all the time and both load and loading times are good. If you are not sure whether this is a little too much to start with, start with RaspberryPi 4 and an external hard drive or a USB stick to learn about the possibilities of NextCloud.

Sascha Brockel

Interested but lacking time or knowledge?

No problem. Contact me and we will discuss your requirements. No matter whether for business or private belongs.


0 Comments

Leave a Reply

Avatar placeholder
You have to agree to the comment policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_US