Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

This article documents the operations and pitfalls of installing NextCloud on a Raspberry Pi.

NO.1
Prerequisite Devices

Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

  1. Raspberry Pi 4 (4GB)

    1. Many applications cannot be installed with less than 4GB. For a smooth installation, 4GB is recommended, theoretically 1GB can also work.

    2. NextCloud is memory-intensive, for a smooth experience, starting with 4GB is advisable.

    3. Use whatever Raspberry Pi you have, the above two points can be ignored.

  2. SD Card (32GB) [A1]

    1. NAS storage is affected by IO performance, Raspberry Pi’s SD card has weak IO, A1 performance is slightly better.

  3. Hard Drive Enclosure (independent power supply)

    1. For external hard drive use, relying on the SD card’s capacity. Installing a system will fill it up.

  4. 2.5-inch Hard Drive (500GB) (old hard drive)

    1. Start with an old drive, later add a new NAS hard drive to increase capacity.

NO.2
Preparation Work

Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

  1. Install Ubuntu 20.04 server version on the Raspberry Pi.

    1. For performance and stability, do not use the desktop version.

  2. Set up Raspberry Pi WiFi (must be able to access Google to avoid download source issues).

    1. Snap installation relies on being able to download third-party image sources.

  3. Connect Raspberry Pi, PC, and mobile phone to the same WiFi (stay on the same subnet for IP access).

    1. Convenient for SSH.

    2. Convenient for accessing NextCloud web.

    3. Access NextCloud via mobile app.

NO.3
Start Installation
Update Ubuntu
sudo apt-get update
Install Snap
sudo apt-get install snap
Install NextCloud
sudo snap install nextcloud
Change Default Ports

Remember to open the ports.

sudo snap set nextcloud ports.http=81 ports.https=444
Access NextCloud

Address: ip+port

Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

Enable Plugin

Plugin Name: External storage support

This plugin is disabled by default after installing NextCloud. Enable this plugin to use external storage.

Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

After installing NextCloud via Snap, there may be an error as follows:

Fix “smbclient” not installed. Unable to mount “SMB / CIFS”, “SMB / CIFS uses OC login information”. Please contact the administrator for installation.

Follow the steps below to resolve:

Install Samba Client
sudo apt install samba-client
Input smbclient

Verify if installation was successful.

smbclient

Refresh the external storage page; the warning will still be displayed, but it can actually be used.

Disk Partitioning

Partition the disk to the specified size and format.

This time, the partition is specified as 25G and ext4 file system.

View Existing Partitions
df -l
Check Service Disk Status
fdisk -l
Add New Partition
fdisk /dev/sdb

Enter the following in sequence:

N 回车
P 回车
1 回车
两次回车
W 回车
Format the Partition

/dev/sdb1 is the newly partitioned disk (modify according to your path).

Format it as ext4 file system.

sudo mkfs -t ext4 /dev/sdb1
Mount the Partition

NextCloud needs to mount to /media.

sudo mount /dev/sdb1 /media

Connect NextCloud to media.

sudo snap connect nextcloud:removable-media
Add External Storage

Configure to the absolute path, which is /media here.

Directory can be arbitrary, here it is labeled as 24G.

Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

You can see the file function, with an additional 24G soft link target identifier.

Click to enter the directory and upload files.

At this point, the installation of NextCloud and the configuration of the external hard drive are basically complete.

Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

NO.4
Tips

There will be a lot of pitfalls when mounting media.

After investigation, if the partition is larger than 50G, there will be inexplicable problems (after changing to a partition of 25G, there are no issues).

  1. Prompt that the partition is damaged and cannot be mounted (using fsck to repair does not help) (error: Structure needs cleaning).

  2. Prompt invalid partition cannot be mounted (actually already partitioned and formatted successfully).

  3. Prompt other errors, cannot mount.

Pitfalls after successful mounting:

  1. NextCloud uses USB 2.0 to mount the hard drive, speed is only 4M/S.

  2. After changing to USB 3.0, it prompts insufficient power, unstable voltage, system freezes (temporarily changed back to USB 2.0).

  3. Changed sockets, power banks, USB power supply, currently cannot stably support USB 3.0 (needs further investigation).

  4. Connecting the Raspberry Pi to an HDMI display also affects power voltage.

END.

Raspberry Pi Ubuntu 20.04 NextCloud Installation Guide

Leave a Comment