NextCloud Config I use for my server
- Use NextCloud's fastest configs
- Easy to use
- Modular
Important
Do not open issues without first reading the entirety of this readme, especially the FAQ. You should also consider checking the NextCloud docs
This is an example file and it will not be read. You should copy it to
.env
and make applicable changes there.
### YOU SHOULD CHANGE THE FOLLOWING CONFIGS ###
# Trusted Domains (The domains NextCloud will be accessed from)
NEXTCLOUD_TRUSTED_DOMAINS=localhost
# Database Password
POSTGRES_PASSWORD=$0m3_R@nd0m_$+r1ng
### CONFIGS BELOW THIS LINE WILL WORK BY DEFAULT ###
# Volume locations
DATA_VOLUME=./volumes/nextcloud/data
CONFIG_VOLUME=./volumes/nextcloud/config
THEME_VOLUME=./volumes/nextcloud/themes
APP_VOLUME=./volumes/nextcloud/apps
WEB_VOLUME=./volumes/nextcloud/web
# Database
POSTGRES_DB=nextcloud
POSTGRES_USER=nextcloud
# PHP
PHP_MEMORY_LIMIT=4096M
# PROXY
SERVE_PORT=80
# Environment docs: https://hub.docker.com/_/nextcloud
After the first run, you should do the following:
- In
Administration>Basic Settings
you should setBackground jobs
to run usingCron (Recommended)
. This will ensure background tasks will run regardless of the frontend being used. - In
Administration>Overview
you should review all error and warnings underSecurity & setup warnings
. You can view how to fix some common ones in the warnings FAQ. The default install generally will have some issues.
fixIndexes.sh
- FixesThe database is missing some indexes.
maintenanceOff.sh
- Disables maintenance mode. (This commonly auto-enables after updates)shell.sh
- Access the docker container's shellupdate.sh
- Pull and build images
There are several reasons you may want to add to the base image. You can modify the base image by running extra commands using config/dockerfile
with standard dockerfile commands
Included in the git repo is a dockerfile that will override the standard image to include bz2. Without this, you will get a notice in the NextCloud overview:
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2
-
Config files are only applied at container start. This is an optimization from the NextCloud tuning guide. (Specifically
opcache.revalidate_freq = 0
in thephp.ini
file) -
Instead of using Redis for caching, Dragonfly is used.
Note
Anything involving a change under ./volumes/*
will require the containers to have been run at least once, as the volumes
folder is only generated on first run.
Caution
This should be done BEFORE you run the container for the first time. Otherwise, NextCloud will be confused and try to reinstall.
Solution: In docker-compose.yml
under app
and volumes
replace ./volumes/nextcloud/data:/var/www/html/data
with /path/to/data:/var/www/html/data
. The second part after the colon should always be the same
Solution: Ensure you copied example.env
to .env
in the head of the repository and looked over the config.
There are a few warnings you will get with the default install using this configuration.
The reverse proxy header configuration is incorrect. This is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud
Solution: Add 'trusted_proxies' => array('127.0.0.1/32'),
to volumes/nextcloud/config/config.php
.
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically
Solution: Run bash config/fixIndexes.sh
Solution: Add 'default_phone_region' => 'US',
to volumes/nextcloud/config/config.php
. Replace US
with your country's corresponding ISO 3166-1 Alpha-2 code
You are accessing your instance over a secure connection, however your instance is generating insecure URLs
Solution: Add 'overwriteprotocol' => 'https',
to volumes/nextcloud/config/config.php
.
Solution: Add 'maintenance_window_start' => 1,
to volumes/nextcloud/config/config.php
. Set this to a time that is best for you. Documentation
Solution: With a proper setup, this should resolve itself over time, and if it does not, you can check Administration>Logging
.
Important
If something seems abnormal, make sure you read over the FAQ in it's entirety, as well as referring to the NextCloud docs. Consider opening an issue if you believe it is directly related to this config.
Solution: Setup and send the test email (NextCloud Email Documentation)