Debian-10 OMV-5 NextCloud-DuckDNS PLEX TRANSMISSION (Full-fledged NAS and CLOUD device)

Post Reply
User avatar
istanbulls
Posts: 605
Joined: Tue May 14, 2019 10:18 pm
languages_spoken: Turkish
ODROIDs: ODROID; N2, C4, XU4, N2+, CH4
Location: Istanbul-Turkey
Has thanked: 370 times
Been thanked: 101 times
Contact:

Debian-10 OMV-5 NextCloud-DuckDNS PLEX TRANSMISSION (Full-fledged NAS and CLOUD device)

Post by istanbulls »

I have tried many things with HC4 for 3-5 months, I have decided to bring the meaning of the HC4 initials to life.
The HC4 is touted as HomeCloud, but I could not find a useful topic or discussion about the Cloud in the Odorid-Forum.
I hope this article fills that gap.
I watched a lot of videos, read a lot of tutorial articles. I have had very painful and difficult experiences. But finally I have a perfectly working NAS and HOME CLOUD.
I decided to make an article as rookie instructional narrative as possible. A rookie best understands the rookie's problems. :)

I will try to explain the OMV5-NextCloud-DackDNS setups and tweaks, respectively, when my tongue turns.
Since I don't speak English and I don't know anything about networking, I will have mistakes. People who have knowledge of the subject will be appreciated to help this tutorial.

I have done a lot of experiments, I will tell you the method by which I reached the result. There may be many different methods but this is the method that worked for me and I know.

Let's get started :)
I want to start with the Debian 10 installation. I installed it with @tobetter's Netboot installer.
I plugged in all the hardware of the HC4 (HDMI, SSD, HDD, Keyboard-Mouse) and pressed the power button.
I'm at the Petitboot screen that welcomes me, Now come to the Exit Shell tab and Enter.

Code: Select all

#netboot_default
#exit
When we return to Petitboot, we will have a few extra options.
We select Debian 10 (Buster) and continue.
This video from @tobetter will help you for details: https://www.youtube.com/watch?v=ugDcoqfb4Xw

I assume that the Debian 10 (Buster) Minimal installation has been completed and I switch to the OMV-5 setup.
Video from @tobetter in OMV-5 will be helpful for details: https://www.youtube.com/watch?v=LkespR5AOrI
What you really need is to log in as root and only 3 commands:
A note for installing with SSH: With ssh, you cannot root login without omv installed. Log in with the user you specified and give him root permission only with the "su" command. I discovered that "sudo su" does not work in this environment.

Code: Select all

wget https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install
chmod + x install
sudo ./install -n
@ tobetter's Debian-10 and OMV5 install smoothly and work stably. We can discuss the fine tuning of the OMV5 here, but it is not a subject that I am an expert on, I just explained the installation part and completed it.

And now Netcloud;
Nextcloud that turned my life into a dungeon. Nextcloud is the killer of my sleepless nights.

Let's get started.
We have to get Duckdns done first. For this, we go to https://duckdns.org, create a subdomain and get the TOKEN.
There are 3 things we need for nextcloud in duckdns.org
1. TOKEN
2.SUBDOMAIN
3. E-MAIL (the e-mail we use in ducksdns membership.)
We're done with duckdns.

Now we can start the NEXCLOUD setup.
For this we need:
1. OMV5
2. DUCKDNS
3.DUCKER (available in OMV5, we will install in OMV5)
4. PORTAINER (Available in OMV5, we will install in OMV5)
5. COCKPIT (available in OMV5, we will install in OMV5)

Note and Tip:
We must do the port forwarding correctly.
This is what got me in trouble.
If we do not make the correct port forwarding via modem or router, we cannot come to a conclusion.


First, we install Docker on OMV5, after docker we install Portainer. Again I installed Cockpit over OMV5, Cockpit is more useful for me than PuTTY SSH.
Screenshot_20210327_133901.png
Screenshot_20210327_133901.png (167.16 KiB) Viewed 1264 times
Most of the transactions we will do after this will be through Portainer.

On the Portainer, we come to the Stacks tab and click Add Stack
portainer.png
portainer.png (61.61 KiB) Viewed 1264 times
I want to express it again! I watched many youtebers and read articles in many forums. I finally came to the conclusion.
Later, I came across the article that I want to talk about and which I refer to both in this article and in my institutions.
It's like an undiscovered jewel, hidden for Nextcloud.
I will share that article and its link in addition.

A lot of information on this subject will continue at the copy-paste level as an excerpt from that article, for your information!

https://forum.openmediavault.org/index. ... post264468
QUOTE from OMV-Forum @ KM0201:
OK, here's how I do it. not saying it's the only way, it's just simple and should have you up and running in about 15min. Everything that starts with a # needs to be adjusted for your system and then the # erased. Nothing other than those lines need to be changed despite what you've seen in other tutorials. All of the below assumes you have a basic understanding containers and command line (config paths, data paths, PUID/PGID, changing directories, nano, etc.)
You can use this in docker-compose or in a stack in portainer (I'd recommend using a stack as it will show if you have formatting errors):

Code: Select all

version: "2"
services:
  nextcloud:
    image: ghcr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      #- PUID=1000
      #- PGID=100
    volumes:
      #- /path/to/nextcloud/config:/config
      #- /path/to/nextcloud/data:/data
      - /etc/localtime:/etc/localtime:ro
    depends_on:
      - mariadb
    ports:
      - 450:443
    restart: unless-stopped
  mariadb:
    image: ghcr.io/linuxserver/mariadb:latest
    container_name: nextclouddb
    environment:
      #- PUID=1000
      #- PGID=100
      #- MYSQL_ROOT_PASSWORD=YOUR_MYSQL_PASSWORD
    volumes:
      #- /path/to/mariadb/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
  swag:
    image: linuxserver/swag
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      #- PUID=1000
      #- PGID=100
      - DNSPLUGIN=duckdns
      - URL=duckdns.org
      #- DUCKDNSTOKEN=YOUR_TOKEN
      #- SUBDOMAINS=YOUR_SUB_DOMAIN
      - ONLY_SUBDOMAINS=true
      - VALIDATION=http
      #- EMAIL=YOUR_EMAIL
    volumes:
      #- /path/to/swag/config:/config
      - /etc/localtime:/etc/localtime:ro
    depends_on:
       - nextcloud
    ports:
      - 457:443
      - 91:80
    restart: unless-stopped
This first part doesn't seem absolutely necessary, but for some reason I could never get it to work right unless I set it up locally first. I'm sure it was something I'm doing, I just can't figure out what..

1. Create all the directories and make all adjustments you need in docker-compose (you might want to delete old directories from previous attempts if you've been at this several times), then deploy the stack/docker compose file. If you use this set up exactly, in your router you'll need to make sure port 457 is forwarded to 443 and port 91 is forwarded to 80 (note: 457/91 are internal ports, 443/80 are external)
2. When done, go to nextcloud UI (https://your.omv.ip:450 , must use https and accept security risk)
3. Enter an admin user/password
4. Click setup database then mysql database
user root
password (see docker-compose, line 24 above)
database name: nextcloud
localhost: nextclouddb
5. Click Finish (this will take a few minutes as it downloads apps and sets up the database, be patient)

Once you're logged in you can complete a basic setup of Nextcloud, or move on to set it up with duckdns subdomains.

6. Navigate to /config/swag/nginx/proxy-confs
7. nano nextcloud.subdomain.conf.sample
8. Change subdomain to duckdns subdomain name (ie.. yoursubdomain.*, line 20 below)

Code: Select all

## Version 2020/12/09
# make sure that your dns has a cname set for nextcloud
# assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
#  'trusted_proxies' => ['swag'],
#  'overwrite.cli.url' => 'https://nextcloud.your-domain.com/',
#  'overwritehost' => 'nextcloud.your-domain.com',
#  'overwriteprotocol' => 'https',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
#  array (
#    0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
#    1 => 'nextcloud.your-domain.com',
#  ),

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name yoursubdomain.*;
    include /config/nginx/ssl.conf;
    client_max_body_size 0;
    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app nextcloud;
        set $upstream_port 443;
        set $upstream_proto https;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
        proxy_max_temp_file_size 2048m;
    }
}
9. Save (Contrl x ) then Enter and and use backspace to erase the ".sample" extension. Hit enter then Y to save..
10. Restart swag container (docker restart swag)
11. Navigate to: /config/nextcloud/www/nextcloud/config
12. nano config.php
13. Under trusted domains array add your domain (you should see your local IP address there as 0), be sure to add it before the ),

Code: Select all

1 => 'yoursubdomain.duckdns.org', 
14. Add or edit the lines below, after the ), and before the );

Code: Select all

'overwrite.cli.url' => 'https://yoursubdomain.duckdns.org',
'overwritehost' => 'yoursubdomain.duckdns.org',
'overwriteprotocol' => 'https',
When you're done, your config.php will look something like this (11, 23, 24, 25 are the lines I added in. A couple of those lines will already be there.. so you can either edit them as appropriate or delete them and add them in at the end like I did, either way just make sure there are no duplicates and it looks similar to the below)

Code: Select all

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'oc3wozk6kai4',
  'passwordsalt' => '2snos3M0EllfFy1CQH0Lah6kOEPyFC',
  'secret' => 'it8C+qSyNcafTBLDp8nHQCAq9o/Fs9nUOgd/gYNFN5/Ro4pW',
  'trusted_domains' => 
  array (
    0 => 'YOUR_LOCAL_IP:450',
    1 => 'yoursubdomain.duckdns.org',
  ),
  'dbtype' => 'mysql',
  'version' => '20.0.6.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextclouddb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => 'YfPeqGJ8LlsOIkXpgiEtf3bejjLtUK',
  'installed' => true,
  'overwrite.cli.url' => 'https://yoursubdomain.duckdns.org',
  'overwritehost' => 'yoursubdomain.duckdns.org',
  'overwriteprotocol' => 'https',
  );
15. Save and close (Cntrl x then Y to save)
16. Restart the Nextcloud container docker restart nextcloud
17. Navigate to https://yoursubdomain.duckdns.org and log in.

This is optional, but once you're done and you can log in to your subdomain properly and securely... If you want to disable insecure access from your local network, go back to your docker-compose file or stack and make this adjustment under the "nextcloud" portion

Code: Select all

    ports:
      - 450:443
to this
    #ports:
      #- 450:443
Then redeploy the stack or docker-compose file and you'll no longer have local access.

You're done.
Note:
I do not know if these quotes, which I made with the permission of the owner, comply with the Odroid-Forum rules.
If this is a problem, Odroid Forum admins can delete or edit the topic.

If we go back to my narrative again.
Add Stack
and
1- We give the stack a name for example: nextcloud
2- We paste the code into the web editor.
We organize the lines marked with # according to our own information.
3- Deploy the stack, we click.
stack.png
stack.png (109.91 KiB) Viewed 1264 times

Code: Select all

version: "2"
services:
  nextcloud:
    image: ghcr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      #- PUID=1000
      #- PGID=100
    volumes:
      #- /path/to/nextcloud/config:/config
      #- /path/to/nextcloud/data:/data
      - /etc/localtime:/etc/localtime:ro
    depends_on:
      - mariadb
    ports:
      - 450:443
    restart: unless-stopped
  mariadb:
    image: ghcr.io/linuxserver/mariadb:latest
    container_name: nextclouddb
    environment:
      #- PUID=1000
      #- PGID=100
      #- MYSQL_ROOT_PASSWORD=YOUR_MYSQL_PASSWORD
    volumes:
      #- /path/to/mariadb/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
  swag:
    image: linuxserver/swag
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      #- PUID=1000
      #- PGID=100
      - DNSPLUGIN=duckdns
      - URL=duckdns.org
      #- DUCKDNSTOKEN=YOUR_TOKEN
      #- SUBDOMAINS=YOUR_SUB_DOMAIN
      - ONLY_SUBDOMAINS=true
      - VALIDATION=http
      #- EMAIL=YOUR_EMAIL
    volumes:
      #- /path/to/swag/config:/config
      - /etc/localtime:/etc/localtime:ro
    depends_on:
       - nextcloud
    ports:
      - 457:443
      - 91:80
    restart: unless-stopped
If you follow the tutorial I quoted from @ KM0201 to continue after this stage, it will be more understandable for you.
His narrative will be more understandable than I did with Translate.
Last edited by istanbulls on Tue Mar 30, 2021 4:54 pm, edited 2 times in total.
These users thanked the author istanbulls for the post (total 3):
odroid (Mon Mar 29, 2021 9:36 am) • joshua.yang (Mon Mar 29, 2021 12:31 pm) • Grimaldi (Wed Mar 31, 2021 3:01 am)

joshua.yang
Posts: 526
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 37 times
Been thanked: 162 times
Contact:

Re: Debian-10 OMV-5 NextCloud-DuckDNS (Full-fledged NAS and CLOUD device)

Post by joshua.yang »

Great guide. :)

Looks like the NextCloud is just an example, this guide can be applied for all of the Docker-based web services, e.g, Plex, Transmission, Code, Bookstack, ... so to speak, all the listed images here: https://fleet.linuxserver.io/
Because the basic usage described here will generally be the same to build using a Docker image that is for serving something through the Internet. As the guide says, the Portainer's Stack is known as docker-compose in conventional usage.
These users thanked the author joshua.yang for the post:
istanbulls (Mon Mar 29, 2021 5:35 pm)

User avatar
istanbulls
Posts: 605
Joined: Tue May 14, 2019 10:18 pm
languages_spoken: Turkish
ODROIDs: ODROID; N2, C4, XU4, N2+, CH4
Location: Istanbul-Turkey
Has thanked: 370 times
Been thanked: 101 times
Contact:

Re: Debian-10 OMV-5 NextCloud-DuckDNS (Full-fledged NAS and CLOUD device)

Post by istanbulls »

joshua.yang wrote:
Mon Mar 29, 2021 12:31 pm
Great guide. :)

Looks like the NextCloud is just an example, this guide can be applied for all of the Docker-based web services, e.g, Plex, Transmission, Code, Bookstack, ... so to speak, all the listed images here: https://fleet.linuxserver.io/
Because the basic usage described here will generally be the same to build using a Docker image that is for serving something through the Internet. As the guide says, the Portainer's Stack is known as docker-compose in conventional usage.
Yes, you are quite right.
For example, I set up Transmission like this.

https://hub.docker.com/r/linuxserver/transmission

You must replace the lines starting with the # sign with your own information.

Code: Select all

version: "2.1"
services:
  transmission:
    image: ghcr.io/linuxserver/transmission:latest
    container_name: transmission
    environment:
     # - PUID=1000
      #- PGID=100
      #- TZ=Europe/Istanbul
      - TRANSMISSION_WEB_HOME=/combustion-release/ #optional
      - USER=xxxxx #optional
      - PASS=yyyyyy #optional
    volumes:
      #- /srv/dev-disk-by-uuid-7fa24677-2653-4d81-ac1a-76ebb2a2c7a8/appdata:/config
      #- /srv/dev-disk-by-uuid-7fa24677-2653-4d81-ac1a-76ebb2a2c7a8/Film:/downloads
      #- /srv/dev-disk-by-uuid-7fa24677-2653-4d81-ac1a-76ebb2a2c7a8/Film:/watch
    ports:
      - 9091:9091
      - 51413:51413
      - 51413:51413/udp
    restart: unless-stopped
These users thanked the author istanbulls for the post:
joshua.yang (Mon Mar 29, 2021 6:13 pm)

User avatar
istanbulls
Posts: 605
Joined: Tue May 14, 2019 10:18 pm
languages_spoken: Turkish
ODROIDs: ODROID; N2, C4, XU4, N2+, CH4
Location: Istanbul-Turkey
Has thanked: 370 times
Been thanked: 101 times
Contact:

Re: Debian-10 OMV-5 NextCloud-DuckDNS (Full-fledged NAS and CLOUD device)

Post by istanbulls »

Docker-compose Source Code for Plex:

https://hub.docker.com/r/linuxserver/plex

Here is my working docker-compose Source Code example:
Everything that starts with a # needs to be adjusted for your system and then the # erased.

Code: Select all

---
version: "2.1"
services:
  plex:
    image: ghcr.io/linuxserver/plex:bionic  #For stable releases with bionic base images it should remain "bionic". It should be changed to "latest" for other images.
    container_name: plex
    network_mode: host
    environment:
      #- PUID=1000
      #- PGID=100
      - VERSION=docker
      - PLEX_CLAIM= #optional
    volumes:
      #- /srv/dev-disk-by-uuid-7fa24677-2653-4d81-ac1a-76ebb2a2c7a8/appdata:/config
      #- /srv/dev-disk-by-uuid-7fa24677-2653-4d81-ac1a-76ebb2a2c7a8/Series:/tv
      #- /srv/dev-disk-by-uuid-7fa24677-2653-4d81-ac1a-76ebb2a2c7a8/Film:/movies
    restart: unless-stopped
your.local.ip:32400/web

User avatar
istanbulls
Posts: 605
Joined: Tue May 14, 2019 10:18 pm
languages_spoken: Turkish
ODROIDs: ODROID; N2, C4, XU4, N2+, CH4
Location: Istanbul-Turkey
Has thanked: 370 times
Been thanked: 101 times
Contact:

Re: Debian-10 OMV-5 NextCloud-DuckDNS PLEX TRANSMISSION (Full-fledged NAS and CLOUD device)

Post by istanbulls »

If you cannot reach HC4 NAS device with TV OS (eg LG TV), you can install MiniDLNA via OMV. Thus, you can access all the folders you have shared on the TV.
These users thanked the author istanbulls for the post:
odroid (Mon Nov 08, 2021 4:28 pm)

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: No registered users and 0 guests