NextZen-Doc/Instructions for use by features/NextCloud/Setup NextCloud.md
2025-01-21 18:05:13 +07:00

18 KiB

1. Create a new domain name using Portainer

  • Before you create a new domain name, you need to transfer the domain name to Cloudflare management and get GLOBAL API KEY Domain name management - CloudFlare
  • Step 1: Access Portainer through the system Dashboard or directly via the link: app.local-> Log in to your account and password . App Manager

!t41.png

  • Step 2: In the interface Portainer -> NextWeb Apps -> Select App Templates -> NextZen Cloudflare DDNS

!t43.png

  • Step 3: Enter the information:
    • Enter Name: Enter the full domain name.
    • Enter DOMAIN: Enter the main domain name (Ex: cstsoft.com).
    • Enter SUBDOMAIN: Enter the subdomain if any (Ex: cloud.cstsoft.com, only enter cloud).
    • Enter Email: Enter the email registered to the Cloudflare domain management account.
    • Enter GLOBAL API KEY: Enter Cloudflare GLOBAL API KEY according to account.

!t44.png

  • Step 3: After entering the information -> select Deploy the container to complete

!Por_6.png

After successful Deploy, the interface displays the newly created cloud.cstsoft.net application

!t45.png

!Instructions for use by features/Z_Tài Nguyên/z_DataImg/t1.png

  • Step 2: Select "Create a PHP website"

!Instructions for use by features/Z_Tài Nguyên/z_DataImg/t2.png

  • Step 3: Select application: NextZen-Nextcloud

!Instructions for use by features/Z_Tài Nguyên/z_DataImg/t3.png

  • Step 4: Enter information:
    • Domain name: Domain name you connected to Portainer (cloud.cstsoft.net)
    • PHP version
    • Site User: The primary SSH account for the site
    • Website user password: Can be self-generated or randomly generated Then -> Generate

!Instructions for use by features/Z_Tài Nguyên/z_DataImg/t4.png

  • Step 5: After you have successfully created it, you need to issue an SSL certificate -> Select the nextcloud website you just created -> Click website domain name: cloud.cstsoft.net

!Instructions for use by features/Z_Tài Nguyên/z_DataImg/t5.png

  • Step 6: Issue SSL certificate to keep the website absolutely secure -> Select SSL/TLS

!Por_37.png

  • Step 7: In the Certificates section -> Select Actions -> Select the certificate

    • Added new Let's Encrypt certificate

    !Instructions for use by features/Z_Tài Nguyên/z_DataImg/t6.png

    • Select Create and install to complete the certificate and automatically renew after 3 months.

    !Instructions for use by features/Z_Tài Nguyên/z_DataImg/t7.png

Domain is linked to Nextcloud

3. Set up NAS for Nextcloud

  • Initially, the system does not have a hard drive set up, so you need to log in to the NextNAS to set up NextNAS - Hard Drive Management
  • Set up new hard drive
  • Step 1: Select Storage -> File Systems

!Instructions for use by features/Z_Tài Nguyên/z_DataImg/t8.png

  • Step 2: Select + -> BTRFS to add a new hard drive

!t9.png

  • Step 3: In Profiles, select Single to create a single hard drive -> In Devices: select the drive to  format into BTRFS format to mount in the system -> Save !t10.png

After the success notification, select close to turn it off

!t11.png

  • Step 4: After formatting, the system will automatically switch to the Mount section (attach the drive to the operating system)
    • In the File System section, select the drive you just formatted
    • In the section Usage Warning Threshold, you choose the warning level that the drive is almost full. You can leave the default at 85% (when it reaches 85%, we will receive a warning that the drive is almost full). then -> Save

!t12.png

  • Step 5: Select the v icon to apply these changes -> Yes

!t13.png !t14.png

  • Step 6: Select the drive as default storage -> Services -> Symlinks -> Default storage location -> Edit

!t15.png

  • Step 7: Select the icon as shown -> dev-disk-by-uuid -> Choose

!t16.png !t17.png

  • Step 8: After choosing a storage location -> Save to complete.

!t18.png !t19.png

  • Step 9: Restart the NAS to update the new hard drive -> Reboot -> Confirm -> Yes

!t20.png !t21.png

4. Create NextCloud AIO using Portainer

  • Create NextCloud AIO application using NAS Apps
  • Step 1: After NAS Apps Online (UP) -> Select NAS Apps

!t22.png

  • Step 2: In NAS Apps interface -> Select App Templates -> NextZen Nextcloud AIO NAS

!t23.png

  • Step 3: Enter the information (recommended to keep the default parameters):
    • Name: Enter the application
    • CLOUD FOLDER: Enter the directory path containing data, default: /DATA/cloud
    • MAX UPLOAD SIZE: Enter the maximum upload file size, default: 1000 GB per file
    • MAX UPLOAD TIME: Enter the maximum upload time, default: 36000 seconds per file
    • TALK PORT: Enter the Port used for Nextcloud talk, default: 58743 Then select Deloy the stack

!t24.png

After installation is complete, the interface displays the nextcloud-aio-mastercontainer application in heathy status, meaning you have successfully installed it.

!t25.png

5. Access Nextcloud AIO

!t26.png

You can access directly via the link: or https://cloud.local/ or https://10.0.0.4:8080/

  • Step 2: After customers access Nextcloud AIO setup, they will provide you with an administrative password -> Select Open Nextcloud AIO login

!t27.png

  • Step 4: Enter the password you are provided -> Login

!t28.png

  • Step 5: After successfully logging in, the nextcloud custom interface appears

!t29.png

  • Step 6: After accessing the nextcloud custom interface, you need to enter the domain name you created on the webserver: cloud.cstsoft.net -> Submit domain

!t30.png

  • Step 7: You need to customize the parameters you need to use for the system
    • ClamAV (Antivirus backend for Nextcloud): Antivirus for Nextcloud, only supported on x64, requires additional ~1GB of RAM.
    • Collabora (Nextcloud Office): Allows use of the Nextcloud Office online office suite.
    • Fulltextsearch: Full text search, requires ~1GB more RAM.
      • All text in files: Fulltextsearch will extract all text in supported files, including text in headings, paragraphs, tables, images, and captions.
      • File Attributes: Fulltextsearch will also index file attributes such as file name, file type, creation date, and modification date.
    • Imaginary (for previews of heic, heif, illustrator, pdf, svg, tiff and webp): Allows previews of heic, heif, illustrator, pdf, svg, tiff and webp files. Imaginary is currently incompatible with server-side encoding.
    • Nextcloud Talk: Allows use of Nextcloud Talk voice calling and video conferencing features. Need to open/forward port 58743/TCP and 58743/UDP on your firewall/router.
    • Nextcloud Talk Recording-server: Record calls for Nextcloud Talk. Needs to enable Nextcloud Talk, add ~1GB RAM, and ~2 additional vCPUs.
    • Docker Socket Proxy: Required for Nextcloud App API. Then select Save changes

!t31.png

  • Step 8: Then you need to enter your time and time zone. For example: Asia/Ho_Chi_Minh

!t32.png

You can see the time zone here

  • Step 9: Next, select Download and start containers

!t33.png

  • Step 10: Then select Reload to relaunch

!Pasted image 20240503234020 1.png

  • The interface shows you have successfully created, the container is in Running state and Admin Account for you to access

!t40.png

  • AIO password change You can change your AIO password (Minimum 24 characters) here

!t78.png

6. Visit Nextcloud

!t46.png

  • Step 3: After successfully logging in, the Nextcloud Interface displays

!t47.png

7. Where to store Nextcloud

!t34.png

You can access directly via the link: or https://ad.local/ or http://10.0.0.4/#/login

  • Step 2: Log in to Admin to check

  • Step 3: Select manage Files

!t36.png

  • Step 4: Here you will see the cloud folder, all download and upload data of Nextcloud is contained here.

!t37.png

Note: Nextcloud has a control mechanism: File management in the nextcloud system, when you use external managers, you will not be allowed to write, edit or delete data, you will be able to check, read, copy copy, move to another place. If you want to have an impact, you need to go through the system's administrative interface. Administrators accessing the cloud will see each person's folder, each created user will see the folder with that user's name.
Ex: The admin account is stored in the admin folder.

!t38.png

  • Where to store nextcloud source code: Go to Root>DATA> AppData> Docker> volumes

!t60.png

8. Backup NextCloud

    1. Select the path to save the system backup
    • Step 1: Access Admin -> File

    !t48.png

    • Step 2: Here you create a new folder to save the backup For example, create a backup folder !t49.png
  1. After creating a backup location, return to the Nextcloud AIO settings page and enter the path to the backup location (/DATA/backup) -> Submit backup location !t50.png

  2. After successful submission, you will see backups will be created in the folder on the server: /DATA/backup/borg

!t51.png

  1. You can select Create backup to backup system data at that time

!t52.png

While backing up, the systems will be paused and after the backup is complete, applications will continue to be launched -> Reload

!t53.png

After a successful backup: you will see the date and time you created the backup

!t54.png

  • If you want to copy or transfer the backup to another place or read it on another system, you need to copy the backup you just created and need a password to decrypt it.

!t55.png

  • Backup check: To check the integrity of backups, This is an option that verifies that your backup is intact.

!t56.png

  • Backup restore: Select a version you want to restore

!t57.png

  • Daily backup and automatic updates: Automatic backups and updates, and automatic deletion after 7 days

!t58.png

  • Back up additional directories and docker volumes of your host: Back up additional folders and Docker volumes of the server

!t59.png

Things You Might Not Know

Borg Backup Mechanism: Borg is an open-source, decentralized backup tool that uses the "deduplicated archive" storage model to optimize efficiency and storage space.

  • Here are the key points about the Borg backup mechanism: 1. Decentralized Storage:
  • Borg does not store data as a single backup copy but divides it into multiple smaller "archives."
  • These archives are distributed across multiple storage servers, which can be internal hard drives, network-attached storage (NAS), or cloud storage services.
  • Data distribution enhances data protection and reduces the risk of data loss due to hardware or software failures. 2. Deduplication:
  • Borg employs deduplication technique to eliminate duplicate data among archives.
  • When creating a new backup, Borg stores only new data portions instead of storing the entire data.
  • Deduplication reduces the storage space needed for backups, especially when you have multiple backups of the same data. 3. Encryption:
  • Borg supports data encryption to enhance security.
  • You can use various encryption algorithms, such as AES-256.
  • Data encryption safeguards data from unauthorized access, even if the data is stolen. 4. Backup Schedule:
  • Borg allows you to create automatic backup schedules.
  • You can set backup schedules by day, hour, or minute.
  • Automatic backups ensure that your data is always up-to-date and protected. 5. Data Restoration:
  • Borg provides multiple options for data restoration.
  • You can restore all data or only specific portions of the data.
  • Data restoration can be performed quickly and easily. Learn more here

9. Using Nextcloud Talk

  • To use Nextcloud Talk, you need to open the Nextcloud Talk firewall to the Internet, otherwise, you cannot make calls.
  1. Access Nextzen Router -> Log in
  2. Select Network -> Choose Firewall - > Port Forwarding
  3. Enable Nextcloud Talk Port 58743 -> Save and Apply

!t91.png

10. Uninstalling Nextcloud and Reinstalling

Steps to Remove Nextcloud from the System

  1. Portainer -> Nas Apps
  2. Select Container -> Check the boxes for containers related to Nextcloud -> Click Remove to delete the containers (Uninstall the application)
  3. Select Volumes -> Check the boxes for volumes related to Nextcloud -> Click Remove to delete the volumes (Delete application data)
  4. Select Stack -> Check the box for nextzen-nextcloud-aio-nas -> Click Remove to delete the Stack
  5. Completing the removal of Nextcloud
  • Access Portainer

!t61.png !t62.png

  • Dekete container

!t63.png

!t64.png

  • Delete Volumes

!t65.png !t66.png

  • Delete Stack

!t67.png !t68.png

After deleting application data, you can delete personal data by:

  1. Access Admin -> File
  2. In the Data folder -> Select the cloud folder -> Delete cloud folder
  3. Complete deletion of all user data

!t69.png

Regenerate the Nextcloud application

  1. Go to Portainer -> NAS Apps
  2. Select App Template -> NextZen Nextcloud AIO NAS
  3. Set parameters
  4. Deploy the stack
  5. Complete the installation of the container nextcloud-aio-mastercontainer to setup and run nextcloud
  6. Access Dashboard -> Nextcloud AIO -> Get new Password
  7. Access Open Nextcloud AIO login ↗ -> And you can completely create or restore nextcloud

Details of operations

  1. Access NAS Apps

!t70.png

  1. Set parameters -> Deploy the stack

!t71.png

  1. Access Nextcloud AIO

!t72.png 4. Create or restore Nextcloud

!t73.png

For example: You want to backup old nextcloud data

  1. Enter the path where to save the backup data: (DATA/backup)
  2. Enter the backup Password
  3. Submit location and password ->Test path and password -> Reload
  4. Check data integrity -> Check backup integrity
  5. Select backup -> Restore selected backup
  6. Select Start and update containers to launch

!t77.png !t76.png

Note: Is your data safe?

  • Nextcloud initialization creates a completely random, extremely strong password.
  • Your data is completely secure and private.

11. How to access nextcloud AIO while the system is running

  • When the system is running, you will not be able to access nextcloud AIO through the Dashboard as well as the links: https://10.0.0.4:8080/*

!t79.png

To access Nextcloud AIO

  1. Access the nextcloud application using the domain name you created.
  2. Go to account-> Administration settings
  3. At overview -> Open Nextcloud AIO interface -> You will access Nextcloud AIO without entering a password

!t81.png !t80.png !t82.png

  • To access Nextcloud AIO another way (Do not use the domain cloud.local or from the dashboard) you need to close the container nextcloud-aio-apache (Because this container will block you from accessing updated when Nextcloud is running)
  1. Go to Portainer -> NAS Apps
  2. Select Container -> nextcloud-aio-apache -> Stop
  3. You can access Nextcloud AIO via Dashboard etc

!t83.png

12. Change the domain name to have Nextcloud

  1. Create a new domain name using Portainer [Detailed instructions here]
  2. Link domain name to NextCloud application using Webserver [Instructions here]
  3. Go to Nextcloud -> Administration settings
  4. Chat -> Delete old configuration (If you use Nextcloud Talk)
  5. After deletion -> Overview -> Open Nextcloud AIO interface
  6. At Nextcloud AIO -> Stop containers
  7. Move to Optinal containers -> Turn off all installed applications -> Save changes
  8. Go to Admin -> File -> App Data -> Docker -> Volumes -> nextcloud_aio_mastercontainer
  9. In nextcloud_aio_mastercontainer -> _data -> configuration.json
  10. Change domain: to new domain (cloud2.cstsoft.net) -> Save
  11. Go to Portainer -> NAS Apps -> Containers -> Restart nextcloud-aio-mastercontainer .
  12. Start container -> After the container is running -> Stop containers
  13. Access Nextcloud AIO: Go to Optinal containers -> enable all desired services -> Save changes
  14. Start containers -> Changed successfully.
  • Delete old Nextcloud talk configuration (Step 4)

!t90.png

  • Stop containers

!t84.png

!t85.png

!t86.png

  • Access configuration.json

!t87.png

  • Modify domain name

!t88.png

  • Start container

!t89.png

13. Access Nextcloud using local network

  • Use Nextcloud in the internal network
  1. Block webserver from going out to the Internet
    • Go to Nextzen Router -> Sign in
    • Select network -> Select firewall -> Port forwarding
    • Turn off Webserver TCP Port 80 and Web server TCP Port 433 -> Save and Apply

!t92.png

  • Now you cannot access the web via the Internet
  1. Adguard Home

    • Go to Adguard Home -> Sign in
    • Select filter -> Select DNS rewrite - > Add DNS rewrite
    • Enter your domain name and IP address: 10.0.0.3 -> Save

    !t93.png!t94.png

  2. Complete Nextcloud in the local network