Skip to main content
  1. Apps/


apps docs nextcloud

Details #

This is a template to add this container to your nas setup full functional with matching permissions and settings that of lochnas repo. If you havent already done so you must enable nginx container first.

Original maintainer Nextcloud, mariadb

How to enable>

How to enable #

Add the domain ssl replacing with the root domain you entered in your config.yml

/lochnas/server.bin -domain add cloud.{}

Edit your /lochnas/docker-templates/nextcloud/.env file and enable this container then run service lochnas restart

Setup nextcloud>

Setup nextcloud #

Navigate in a browser to configure nextcloud at

First enter a personal username and password to login to nextcloud. Then before hitting next hit the advanced option.

  • Click MySQL / MariaDB
  • Leave data path default
  • Database User: nextcloud
  • Database Password: password from .env MYSQL_PASSWORD=
  • Database Name: nextcloud
  • Change localhost to mariadb:3306
  • Click Next

Note: If you get the error 504 Gateway timeout, edit the file docker-data/nextcloud/html/config/config.php and remove :3306 from dbhost and add it to dbport as 3306. This is an unfortunate bug in the nextcloud installer but shouldnt be an issue past this.

After you get to the welcome screen go to settings -> basic settings. Change the cron settings to webcron.

Go to apps and disable the app called Deleted Files. This application causes issues with External Storage plugin.

Go to External storage in settings and create a storage under /raid for your users.

You will need to make some tweaks to improve this nextcloud docker setup. Type the following commands:

docker exec -u www-data -it nextcloud ./occ db:add-missing-indices
docker exec -u www-data -it nextcloud ./occ db:convert-filecache-bigint
docker exec -u www-data -it nextcloud ./occ config:app:set text workspace_available --value=0

Make one last addition to the config file to fix a login redirect issue.

nano docker-data/nextcloud/html/config/config.php

  'overwrite.cli.url' => '',
  'overwritehost' => '',
  'overwriteprotocol' => 'https',
Stuck in Maintenance mode>

Stuck in Maintenance mode #

Sometimes Nextcloud finds itself stuck unable to update due to an issue. You can run the command to determine why its stuck.

docker exec -it -u 33 nextcloud php occ upgrade

If you see an error like “Cannot skip major versions”. You will need to download the previous version and upgrade incrimentally. The following example goes from 23 -> 24. You will need to repeat this for multiple major versions.

cd /lochnas/docker-data/nextcloud
cat html/config/config.php | grep version
mv html nextcloud
unzip -o
mv nextcloud html
docker exec -it -u 33 nextcloud php occ upgrade