The LinuxServer.io team brings you another container release featuring:
Find us at:
Nextcloud gives you access to all your files wherever you are.
Where are your photos and documents? With Nextcloud you pick a server of your choice, at home, in a data center or at a provider. And that is where your files will be. Nextcloud runs on that server, protecting your data and giving you access from your desktop or mobile devices. Through Nextcloud you also access, sync and share your existing data on that FTP drive at the office, a Dropbox or a NAS you have at home.
We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.
Simply pulling lscr.io/linuxserver/nextcloud:latest
should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
The architectures supported by this image are:
Architecture | Available | Tag |
---|---|---|
x86-64 | ✅ | amd64-\<version tag> |
arm64 | ✅ | arm64v8-\<version tag> |
armhf | ❌ |
This image provides various versions that are available via tags. Please read the descriptions carefully and exercise caution when using unstable or development tags.
Tag | Available | Description |
---|---|---|
latest | ✅ | Stable Nextcloud releases |
develop | ✅ | Beta Nextcloud pre-releases only |
Access the webui at https://<your-ip>:443
, for more information check out Nextcloud.
Note: occ
should be run without prepending with sudo -u abc php
or sudo -u www-data php
ie; docker exec -it nextcloud occ maintenance:mode --off
Updating Nextcloud is done by pulling the new image, and recreating the container with it.
It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.
Since all data is stored in the /config
and /data
volumes, nothing gets lost. The startup script will check for the version in your volume and the installed docker version. If it finds a mismatch, it automatically starts the upgrade process.
Nextcloud's built-in collaborative editing packages (Collabora/CODE and OnlyOffice) only work on x86_64 systems with glibc, and therefore they are not compatible with our images. You should create separate containers for them and set them up in Nextcloud with their respective connector addons.
If (auto) installed, those built-in packages may cause instability and should be removed.
In order to enable HEIC image preview generation you will need to add the following to your config.php
file in your `config/www/nextcloud/config' directory;
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
'OC\Preview\PNG',
'OC\Preview\JPEG',
'OC\Preview\GIF',
'OC\Preview\BMP',
'OC\Preview\XBitmap',
'OC\Preview\MP3',
'OC\Preview\TXT',
'OC\Preview\MarkDown',
'OC\Preview\OpenDocument',
'OC\Preview\Krita',
'OC\Preview\HEIC',
),
You may need to log out and back in for the changes to come in to effect.
This fix was sourced from Nextcloud Documentation
Nextcloud state that HEIC preview is disabled by default due to performance or privacy concerns, so enable this at your own risk.
If you are using custom app directories you will need to make the custom folder(s) you are using available to the web server. The recommended way to do this with our container is to add a volume. Ex:
volumes:
- /path/to/your_custom_apps_folder:/app/www/public/your_custom_apps_folder
Afterwards, you can set "path" => OC::$SERVERROOT . "/your_custom_apps_folder",
in your config.php
file, per the official documentation.
This image uses a self-signed certificate by default. This naturally means the scheme is https
.
If you are using a reverse proxy which validates certificates, you need to disable this check for the container.
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
---
services:
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
volumes:
- /path/to/nextcloud/config:/config
- /path/to/data:/data
ports:
- 443:443
restart: unless-stopped
docker run -d \
--name=nextcloud \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-p 443:443 \
-v /path/to/nextcloud/config:/config \
-v /path/to/data:/data \
--restart unless-stopped \
lscr.io/linuxserver/nextcloud:latest
Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal>
respectively. For example, -p 8080:80
would expose port 80
from inside the container to be accessible from the host's IP on port 8080
outside the container.
Parameter | Function |
---|---|
-p 443 |
WebUI |
-e PUID=1000 |
for UserID - see below for explanation |
-e PGID=1000 |
for GroupID - see below for explanation |
-e TZ=Etc/UTC |
specify a timezone to use, see this list. |
-v /config |
Persistent config files |
-v /data |
Your personal data. |
You can set any environment variable from a file by using a special prepend FILE__
.
As an example:
-e FILE__MYVAR=/run/secrets/mysecretvariable
Will set the environment variable MYVAR
based on the contents of the /run/secrets/mysecretvariable
file.
For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022
setting.
Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.
When using volumes (-v
flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID
and group PGID
.
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
In this instance PUID=1000
and PGID=1000
, to find yours use id your_user
as below:
id your_user
Example output:
uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)
We publish various Docker Mods to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.
Shell access whilst the container is running:
docker exec -it nextcloud /bin/bash
To monitor the logs of the container in realtime:
docker logs -f nextcloud
Container version number:
docker inspect -f '{{ index .Config.Labels "build_version" }}' nextcloud
Image version number:
docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/nextcloud:latest
Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.
Below are the instructions for updating containers:
Update images:
All images:
docker-compose pull
Single image:
docker-compose pull nextcloud
Update containers:
All containers:
docker-compose up -d
Single container:
docker-compose up -d nextcloud
You can also remove the old dangling images:
docker image prune
Update the image:
docker pull lscr.io/linuxserver/nextcloud:latest
Stop the running container:
docker stop nextcloud
Delete the container:
docker rm nextcloud
Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your /config
folder and settings will be preserved)
You can also remove the old dangling images:
docker image prune
tip: We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
If you want to make local modifications to these images for development purposes or just to customize the logic:
git clone https://github.com/linuxserver/docker-nextcloud.git
cd docker-nextcloud
docker build \
--no-cache \
--pull \
-t lscr.io/linuxserver/nextcloud:latest .
The ARM variants can be built on x86_64 hardware using multiarch/qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static:register --reset
Once registered you can define the dockerfile to use with -f Dockerfile.aarch64
.
config.php
required - see above./config/nginx/site-confs/default.conf
- Security fix for real ip settings.output_buffering
as per [nextcloud docs](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html/config/nginx/site-confs/default.conf
and restart the container). Fix LDAP connection.php8
tag for testing./config/nginx/site-confs/default.conf
and restart the container)./config/nginx/site-confs/default.conf
and restart the container)./config/nginx/site-confs/default.conf
and restart the container)./config/nginx/site-confs/default.conf
and restart the container)./config/nginx/site-confs/default.conf
and restart the container)./config/nginx/site-confs/default.conf
and restart the container).