Getting Started with Raspberry Pi: Personal Cloud Setup

Getting Started with Raspberry Pi (Part Two)

Smart Embedded Apprentice, WeChat Official Account: Smart Embedded Apprentice Getting Started with Raspberry Pi (Part Two)

After the previous article, our NAS server has a downloader function, but it is limited to the local area network. Therefore, the following is based on the internal network penetration technology to achieve personal cloud storage functionality;

(3) Personal Cloud Storage

How to achieve internal network penetration?

To allow other devices not on the same network as the Raspberry Pi to remotely access the mounted SSD content, internal network penetration (public to private) is needed; solutions include virtual networking/FRP, etc.;

  • Virtual Networking

zerotier: No cost; low speed; client needs to be downloaded;

curl -s https://install.zerotier.com |sudo bash
sudo zerotier-cli join NetworkID
  • FRP, Fast Reserve Proxy Reverse Proxy

Tencent Cloud/Alibaba Cloud: Just buy it; (no money, don’t buy; even if you have money, don’t buy; you can buy it later when you know how to use it)

Cherry Blossom FRP: Check-in for traffic; ordinary nodes/copper nodes/silver nodes;

🌸Link: https://www.natfrp.com/

Register and log in to verify your identity; HTTP(S) requires identity verification and ICP filing;

Help document for creating a launcher: https://doc.natfrp.com/launcher/usage.html#login

After having a simple understanding of internal network penetration, we will continue with personal cloud storage;

How to set up personal cloud storage?

Personal cloud storage will use a database, recommended solutions include nextcloud/Kodcloud/seafile, etc.;

Following the previous steps, you should directly install a single container image, then learn to use docker-compose to install a container group; the benefit is easy configuration management of multiple containers;

1) pull

mariadb is a good database service based on mysql;

adminer is a good graphical database management tool, with a .php file that allows you to manage the database via the web page;

sudo docker pull linuxserver/mariadb:arm32v7-10.6.13
sudo docker pull adminer
sudo docker pull nextcloud

2) deploy

Use docker-compose to install and configure multiple containers

#docker-compose.yml
version: '3.8'
services:
  portainer:
    image: "portainer/portainer-ce:latest"
    ports:
      - "9000:9000"
    volumes:
      - "portainer_data:/var/lib/docker/volumes/portainer_data/_data"

  db:
    image: "postgres:alpine"
    environment:
      MYSQL_DB: "mydb"
      MYSQL_USER: "user"
      MYSQL_PASSWORD: "passwd"

volumes:
  portainer_data:
#######################
services:
  mariadb:
    image: lscr.io/linuxserver/mariadb:arm32v7-10.6.13
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
      - MYSQL_ROOT_PASSWORD=mariadb123456
      - MYSQL_DATABASE=db_test
      - MYSQL_USER=user
      - MYSQL_PASSWORD=db123456
      - REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql#optional
    volumes:
      - /data/mariadb/config:/config
    ports:
      - "3306:3306"
    restart: unless-stopped

http://RaspberryPiIP:443

Bind the database;

Create a database in Adminer;

Create a user and grant all permissions;

Link to the database;

Resolve untrusted domain names;

# Edit the configuration file to change to trusted links
cd /srv/dev-disk-by-uuid-8ef4dd5d-322d-4e8c-b11a-b878ea0ed7c6/myHub/nextcloud/config/www/nextcloud/config/
sudo vi config.php

Getting Started with Raspberry Pi: Personal Cloud Setup

Install nextcloud in shared files for easy file management;

You can see the set users in the data directory, and the directory structure is consistent with that on the cloud storage;

No more to say, my phone album automatically syncs to my SSD, how great!!!

ShareFavoritesLikeView

Leave a Comment

×