New to NextCloud, A few Questions

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • nextcloud:31.0.8-apache
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian GNU/Linux 12 (bookworm) x86_64
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • caddy:latest and dnsmasq for local DNS
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • Not Yet

Hello,

Because my university has reduced my OneDrive from 1 TB to 100 GB and I’ve been asked to delete the “excess” to free up space (I’ve started downloading everything to a 1 TB 3.5" HDD I have at home),

I’ve taken on the task of implementing my own cloud storage. In this case, I’ve chosen Nextcloud. So, I decided to give it a try. I opted to use the community Docker version (https://github.com/nextcloud/docker) since I only need file management.

My laptop specs:

specs
OS: Debian GNU/Linux 12 (bookworm) x86_64
Kernel: Linux 6.1.0-37-amd64
Shell: bash 5.2.15
DE: Xfce4 4.18
WM: Xfwm4 (X11)
WM Theme: Default
Theme: Adwaita-dark \[GTK2/3/4\]
Icons: Adwaita \[GTK2/3/4\]
Font: Sans (10pt) \[GTK2/3/4\]
Cursor: Adwaita
Terminal: xfce4-terminal 1.0.4
CPU: Intel(R) Core™ i3-3227U (4) @ 1.90 GHz
GPU: Intel 3rd Gen Core processor Graphics Controller @ 1.10 GHz \[Integrated\]
Memory: 4.38 GiB / 7.46 GiB (59%)
Swap: 5.24 GiB / 14.90 GiB (35%)
Disk (/): 32.65 GiB / 63.62 GiB (51%) - ext4
Disk (/home): 108.04 GiB / 139.67 GiB (77%) - ext4
Disk (/media/familia/HBCD_PE_x64): 902.29 GiB / 920.39 GiB (98%) - fuseblk
Disk (/media/familia/HDD): 453.42 GiB / 465.76 GiB (97%) - fuseblk
Disk (/media/familia/HHD1TA): 92.25 GiB / 915.82 GiB (10%) - ext4
Local IP (enp2s0): 192.168.1.19/24
Locale: es_MX.UTF-8

For the test, I decided to create a folder at /mnt/Nextcloud (27 GB free). Here’s my docker-compose.yml:

services:
  nextcloud:
image: nextcloud:31.0.8-apache
container_name: nextcloud
restart: unless-stopped
ports:
      - "8087:80"
environment:
      - NEXTCLOUD_ADMIN_USER=admin
      - NEXTCLOUD_ADMIN_PASSWORD=adminpass
      - SQLITE_DATABASE=nextcloud.db
      - NEXTCLOUD_TRUSTED_DOMAINS=files.nehemiasfeliz.com
      - OVERWRITEHOST=files.nehemiasfeliz.com
      - OVERWRITEPROTOCOL=https
      - PHP_MEMORY_LIMIT=1G
      - PHP_UPLOAD_LIMIT=0
      - APACHE_BODY_LIMIT=0
volumes:
      - nextcloud:/var/www/html
      - /mnt/Nextcloud:/var/www/html/data
deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 512M
volumes:
  nextcloud:

To access the service, I use dnsmasq as the local DNS and Caddy (in Docker) as the reverse proxy. Here’s the configuration:

# dnsmasq.conf
interface=lo,eth0
listen-address=127.0.0.1,192.168.1.19

address=/files.nehemiasfeliz.com/192.168.1.19

server=/nehemiasfeliz.com/8.8.8.8
server=/nehemiasfeliz.com/148.103.0.73

server=148.103.0.73
server=8.8.8.8
services:
  caddy-local:
    image: caddy:latest
    container_name: caddy-local
    ports:
    - "80:80"
    - "443:443"
    volumes:
      - ./Caddyfile.local:/etc/caddy/Caddyfile:ro
      - caddy_local_data:/data
      - caddy_local_config:/config
    environment:
      - CLOUDFLARE_API_TOKEN=<TOKEN>
    restart: unless-stopped

volumes:
  caddy_local_data:
  caddy_local_config:
# Caddyfile.local
{
	email juniornff@gmail.com
	acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN}
	http_port  80       
	https_port 443
	ocsp_stapling off
}

# Redirección HTTP → HTTPS
:80 {
	redir https://{host}:8444{uri} permanent
}

files.nehemiasfeliz.com {
	reverse_proxy 192.168.1.19:8087
}

After starting the container, the configuration shows errors related to the setup.

Errors

There are several configuration-related errors.
[Red] - The reverse proxy header configuration is incorrect. This is a security issue and could allow an attacker to spoof an IP address visible to Nextcloud. For more details, check the documentation (Reverse proxy — Nextcloud latest Administration Manual latest documentation).

[Yellow] - The server does not have a maintenance window start time configured. This means that resource-intensive daily background jobs will run during regular usage hours. We recommend setting it to a time of low usage to reduce the impact on users caused by these intensive tasks. For more details, check the documentation (Background jobs — Nextcloud latest Administration Manual latest documentation).

[Yellow] - One or more MIME type migrations are available. New MIME types are typically added to handle certain file types more appropriately. Migrating MIME types can take considerable time on large instances, so this is not done automatically during updates. Use the command occ maintenance:repair --include-expensive to perform the migrations.

[Yellow] - Some headers are not properly configured in your instance - The HTTP header Strict-Transport-Security is not configured (it should be at least 15552000 seconds). For enhanced security, it is recommended to enable HSTS. For more details, check the documentation (Hardening and security guidance — Nextcloud latest Administration Manual latest documentation).

[Yellow] - SQLite is currently being used as the primary database. For larger installations, we recommend switching to a different primary database. This is particularly recommended when using the desktop client for file synchronization. To migrate to another database, use the command-line tool: “occ db:convert-type”. For more details, check the documentation (Converting database type — Nextcloud latest Administration Manual latest documentation).

[White] - The database is being used for transactional file locking. To improve performance, please use memcache if available. For more details, check the documentation (Transactional file locking — Nextcloud latest Administration Manual latest documentation).

[White] - Your installation does not have a default phone region selected. This is necessary to validate phone numbers in user settings that do not include an international code. To allow numbers without an international code, add the “default_phone_region” setting with the corresponding ISO 3166-1 code in your configuration file. For more details, check the documentation (ISO 3166-1 alpha-2 - Wikipedia).

[White] - You have not entered or verified your email server settings yet. Please go to “Basic Settings” to configure it. Then, use the “Send email” button below the form to verify your settings. For more details, check the documentation (Email — Nextcloud latest Administration Manual latest documentation).

But I can check that later. Also, I have some questions:

  • When I start the container and access Nextcloud, I see that it creates some “example” files and folders. If I use my HDD for Nextcloud instead of the created folder, will all the files on that HDD be deleted? Or will those example files simply be added to the HDD?

  • I’m using SQLite as the database. The use I intend for Nextcloud is mostly personal, and maybe for a few family members/friends. Should I switch to another database? Would that change significantly affect resource consumption?

Later, I plan to use my Cloudflare domain to make it accessible outside my local network, using cloudflare-ddns in Docker (https://github.com/timothymiller/cloudflare-ddns) as my DDNS and another Caddy in Docker for the reverse proxy:

services:
  cloudflare-ddns:
    image: timothyjmiller/cloudflare-ddns:latest
    container_name: cloudflare-ddns
    network_mode: "host"
    security_opt:
      - no-new-privileges:true
    volumes:
      - ./config.json:/config.json:ro
    restart: unless-stopped
# config.json
{
  "cloudflare": [
    {
      "authentication": {
        "api_token": "TOKEN"
      },
      "zone_id": "ID",
      "subdomains": [
        { "name": "files", "proxied": true } # i will paste that
      ]
    }
  ],
  "a": true,
  "aaaa": true,
  "purgeUnknownRecords": false,
  "ttl": 300
}
services:
  caddy:
    image: caddy:latest
    container_name: caddy-reverse
    ports:
      - "8081:80"
      - "8443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - ./cloudflare-origin/cert.pem:/etc/caddy/cloudflare-origin/cert.pem:ro
      - ./cloudflare-origin/key.pem:/etc/caddy/cloudflare-origin/key.pem:ro
      - caddy_data:/data
      - caddy_config:/config
    restart: unless-stopped

volumes:
  caddy_data:
  caddy_config:
# Caddyfile
:80 {
  redir https://{host}{uri} permanent
}

files.nehemiasfeliz.com {
    tls /etc/caddy/cloudflare-origin/cert.pem /etc/caddy/cloudflare-origin/key.pem
    reverse_proxy 192.168.1.19:8087
}

Should I do anything else besides that?

1Tb is not large at all and has even less monetary value, I would certainly just copy everything over instead the risk of mounting it in the same box as your Nextcloud.

There’s also the option of having your 1Tb drive on another box for a SMB share, which Nextcloud can use as External Storage, and you can choose to just leave things as-is, or again copy everything over to the Nextcloud box.

Yes, for now I’ll leave it as a backup of everything.

I have two other drives, and I plan to use one for NextCloud and use the backup drive as external storage, as you mentioned.

But for that, I’ll need to buy a rack for the hard drives, since for now the drive is connected to the laptop with an adapter borrowed from a friend.

I use nc as a frontend for my External Storage, I don’t like having multiple copies of my stuff, and my smb share is primarily used by my desktop workstation. This allows me to keep nc as a vm with only enough drivespace for itself.

I do know that nc can indeed be a file server and offer a share to workstations on the lan, but I have been using Veritas Backup Exec to backup from my smb for decades and really gotten used to how it works.

Yes, I don’t have enough space to keep it full of copies of the same thing :sweat_smile:.

My goal with NC is to have my own online Drive, since I share a lot of files with my family/friends. If I can do it using the drives as external storage, it will be much easier.

Can you show me how you’ve implemented it?

If you keep nc stricly as a frontend with zero data on it, then yes, you can share everything off External Storage only. I’m not crazy throwing everything to be stored by nc because I am fairly new to nc and that thing can die anytime after an update, whatever.

My smb External Storage is a Windows fileserver.

I have nc setup from the start as a standalone appliance without joining a domain, you know, the beginning part where it asks you what city you are in and keyboard, etc.

Logging in as administrator, I add a second ldap server. I realized nc can both use its built-in user groups as ldap from my Windows Domain. I do this so each user in my household has their own login.

When a user logs into nc, each user mounts their own External Storage by themselves.

Ok, I think I got the part about adding external storage for other users. Although my NC is in Docker, since the connection is via a network, I think it will be able to detect it without having to mount it in the container. It’s better that way. Thanks.

What I didn’t understand was the LDAP part. I’m very new to self-hosting. My entire setup is a laptop with docker, a USB drive and connected hard drives :sweat_smile:. But I understand that part is for managing the other users on your network with your Windows Domain. I don’t think I need it for now.

I think I managed to add external storage. I did it locally so I wouldn’t have to create an SMB server since I don’t need it.

But I’m unable to create links to share the folder/files. Is that expected, or do I need to adjust something in the settings?

Edit: Yes, just activate the option in the mounting options.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.