mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
4.9 KiB
4.9 KiB
NextCloud
Redis is recommended to prevent file locking problems.
Table of contents
TL;DR
Setup
Helm
helm repo add 'nextcloud' 'https://nextcloud.github.io/helm/'
helm repo update
helm inspect values 'nextcloud/nextcloud' > 'values.yaml'
helm upgrade -in 'nextcloud' --create-namespace --atomic 'nextcloud' 'nextcloud/nextcloud' -f 'values.yaml'
Real world use cases
docker compose exec -ti -u 33 app /var/www/html/occ db:add-missing-indices
docker compose exec -ti -u 33 app /var/www/html/occ maintenance:repair --include-expensive
Containerized
Use environment variables to inform Nextcloud about internal configuration:
| Name | Default | Description |
|---|---|---|
NEXTCLOUD_ADMIN_USER |
(not set) | Name of the Nextcloud admin user |
NEXTCLOUD_ADMIN_PASSWORD |
(not set) | Password for the Nextcloud admin user |
NEXTCLOUD_TRUSTED_DOMAINS |
(not set) | Optional space-separated list of domains |
REDIS_HOST |
(not set) | Name of the Redis container, or FQDN of the Redis service |
REDIS_HOST_PORT |
6379 | Port for Redis services that run on non-standard ports |
Official helm chart
Installation:
-
add the repository to helm
helm repo add nextcloud https://nextcloud.github.io/helm/ helm repo update -
get the default values from the updated chart
helm inspect values nextcloud/nextcloud > "$(git rev-parse --show-toplevel)/kubernetes/helm/nextcloud/values.yaml" -
edit the values to your heart's content
-
install the server
helm install --namespace nextcloud nextcloud nextcloud/nextcloud --values kubernetes/helm/nextcloud/values.dev.yaml helm install --atomic --create-namespace --namespace nextcloud nextcloud nextcloud/nextcloud --values kubernetes/helm/nextcloud/values.dev.yaml
Update the release after changes are made to the values:
helm upgrade --atomic --namespace nextcloud nextcloud nextcloud/nextcloud --values kubernetes/helm/nextcloud/values.dev.yaml
Connect to the server (install with default values):
export POD_NAME=$(kubectl get pods --namespace nextcloud -l "app.kubernetes.io/name=nextcloud,app.kubernetes.io/instance=nextcloud" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace nextcloud port-forward "${POD_NAME}" 8080:80
default admin user: admin
default admin password: changeme
Update the external database connection parameters (install with default values):
export APP_HOST=127.0.0.1
export APP_PASSWORD=$(kubectl get secret --namespace nextcloud nextcloud -o jsonpath="{.data.nextcloud-password}" | base64 --decode)
helm upgrade nextcloud nextcloud/nextcloud \
--set nextcloud.password=$APP_PASSWORD,nextcloud.host=$APP_HOST,service.type=ClusterIP,mariadb.enabled=false,externalDatabase.user=nextcloud,externalDatabase.database=nextcloud,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST
Delete everything:
helm delete --namespace nextcloud nextcloud
kubectl delete namespace --ignore-not-found nextcloud
Snappy
To configure Nextcloud from snap:
- use
nextcloud.occ - edit
/var/snap/nextcloud/current/nextcloud/config/config.php - use the extra configuration options via the
snap setcommand
Further readings
- Website
- Self-hosting
- The docker version's README
- The snap version's README
- How to install and configure Nextcloud on Ubuntu 18.04
Providers: