Unsurprisingly, this is the last blog post of 2020, and I want to share something fun with you. Having said that, I bought a Raspberry PI 4 with 4GB ram and a 64GB mini solid state for double 12. But after days of not figuring out how to use it, I had an Epiphany when USING oneDrive and was frustrated by its super-slow synchronization. I installed my own cloud disk.

So, the conclusion is that the installation of Raspberry PI 4 nextCloud is completely feasible, and its performance is very low. There are four cores, and there is only less than one core for a long time. The temperature of Raspberry PI is about 40 degrees Celsius, and the memory usage is about 600 M, which is far below the load capacity of Raspberry PI.

chaoqun@pi4:~$top top-13:36:42 up 8 days, 21:05, 1 User, load Average: 0.74, 0.87, 0.78 Tasks: 179 total, 2 running, 177 sleeping, 0 stopped, 0 zombie %Cpu0 : 0.7us, 1.sy, 0.0ni, 0.7id, 0.0wa, 0.0hi, 0.0si, 0.0st %Cpu1: 4.3US, 2.7sy, 0.0ni, 93.0ID, 0.0wa, 0.0hi, 0.0si, 0.0st %Cpu2: 3.3us, 2.7sy, 0.0ni, 94.0 ID, 0.0wa, 0.0hi, 0.0si, 0.0st %Cpu3: 0.7US, 1.0SY, 0.0Ni, 98.0ID, 0.3WA, 0.0Hi, 0.0Si, 0.0ST MiB Mem: 3740.1 total, 172.9 Free, 570.4 used, 2996.9 buff/ Cache MiB Swap: 1024.0 Total, 1023.0 Free, 1.0 used. 3093.4 Avail Mem chaoqun@pi4:~$sudo vcgencmd measure_temp Temp =38.0'C
Copy the code

Nextcloud effect

Nextcloud is an open source cloud disk system, which can not only build private cloud storage and synchronize data, but also provide contact and schedule management functions. The Web side also provides private voice and video call functions. Data in the cloud can be encrypted. As well as Android and ios two mobile platforms, it is fully enough for family or small and medium-sized team cooperation.

Mobile terminal

Mobile phone compared to Baidu cloud disk network disk is the biggest characteristic is no advertising, may be some of the functions are not complete, but the common functions are still some.

  • Photo album automatic upload
  • Upload and download files
  • File sharing, encrypted sharing, time-limited sharing, etc

The computer side

The computer side is a bit like oneDrive, the main function is to automatically synchronize folders, like downloading files, browsing web disk files and other functions are realized through the web side.

Web side

Web side functions more, but the first use will be some not used (layout logic and Baidu network disk is different. After simple use, I found that NextCloud can also achieve a lot of functions that could not be achieved by installing plug-ins. I installed a PDF reading function, which allows you to read PDFS directly on the web without downloading files to the computer.

Nextcloud also supports the WebDAV protocol, which allows some software to be used as cloud backup space.

Installation and Configuration Methods

The hardware configuration

  • Raspberry sent 4
  • USB solid state drive (TF card reads and writes are too weak and can seriously affect the experience

The software configuration

  • The official Ubuntu or Raspberry PI system
  • Mysql Database (optional)
  • Nginx, PHP environment
  • Redis (optional)

The configuration process

Since I am using UBtuntu 20.10, I just installed APT

sudo apt update
sudo apt upgrade

# Video decoding
sudo apt install ffmpeg

# database
sudo apt install mariadb-server redis

# Web server and PHP
# If the source is not PHP 7.4, configure this by versionSudo apt install nginx PHP -common PHP -igbinary PHP -imagick PHP -mysql PHP -pear PHP -redis php7.4-bz2 php7.4-cli Php7.4 -common php7.4-curl php7.4-dev php7.4- FPM php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql Php7.4 -opcache php7.4-readline php7.4- XML php7.4-zip php7.4Copy the code

Download the nextCloud deployment program nextCloud-20.0.4.tar.bz2 from the official website

Follow-up configuration procedure Refer to installing Raspberry PI on NextCloud to Set up private cloud configuration.

External access

Here is a brief description of how to access NextCloud from the outside. Normally, after configuring NextCloud, it can only be accessed from the inside, so you need to configure FRP and other Intranet penetrating tools to access the outside. I bought aliyun cloud server and configured FRPS service on it. Through configuring port mapping in Raspberry PI, I mapped 127.0.0.1:80 port to any port of the server xxx.mcoder.cc:7999.

Then, configure a DNS resolution to the cloud server, for example, mycloud.mcoder. Cc. Then add a proxy server record to nginx and you can access your private cloud from the extranet via myCloud.mcoder. Cc.

server {
        listen 80;
        listen[: :] :80;

        server_name mycloud.mcoder.cc;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                #try_files $uri $uri/ =404;
                proxy_pass_header Server;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Scheme $scheme;

                proxy_pass http://127.0.0.1:7999/;
                index index.html index.htm index.jsp index.php;
        }

        # set the maximum upload file size
        client_max_body_size 4192M;
        fastcgi_buffers 64 4K;
}
Copy the code

Note: It is important to note that the maximum file upload size needs to be set in several places: NextCloud, raspberry PI’s Nginx server, and cloud proxy nginx server.

Private cloud disk needs small partners can try oh, pretty fun.

Refer to the link

  1. Raspberry PI 4 Usb boot
  2. Raspberry PI installed NextCloud to build a private cloud