Nextcloud

From SoftwareGuy
Jump to navigation Jump to search

General info[edit | edit source]

[1] nextcloud-snap

Changing port numbers[edit | edit source]

/var/snap/nextcloud/current/nextcloud/config/config.php

sudo snap set nextcloud ports.http=81
sudo snap set nextcloud ports.https=444
sudo snap set nextcloud ports.http=81 ports.https=444

Note: Let's Encrypt will expect that Nextcloud is exposed on ports 80 and 443. If you change ports and don't put Nextcloud behind a proxy such that ports 80 and 443 are sent to Nextcloud for that domain name, Let's Encrypt will be unable to verify ownership of your domain and will not grant certificates.

Also note: Nextcloud's automatic hostname detection can fail when behind a proxy; you might notice it redirecting incorrectly. If this happens, override the automatic detection (including the port if necessary), e.g.:

sudo nextcloud.occ config:system:set overwritehost --value="example.com:81"

Can not login, too many requests[edit | edit source]

Seems to be caused by the app.

sudo /snap/bin/nextcloud.occ security:bruteforce:reset 127.0.0.1

Letsencrypt renew[edit | edit source]

Change port forwarding on router to point both 80, 443 to 192.168.1.109. Turn off 80 to 192.168.1.108

sudo snap set nextcloud ports.http=80
sudo snap set nextcloud ports.https=443

Now update letsencrypt

sudo nextcloud.enable-https lets-encrypt

Revert port forwarding

sudo snap set nextcloud ports.http=81
sudo snap set nextcloud ports.https=444

Restore the port forward back to 81, 444 to 192.168.1.109. Turn on 80 to 192.168.1.108