Docker has been discontinued for the time being, please read the announcement here: NextcloudPi planning to discontinue its docker version with nc 25
The following text is only valid for older installations and is intended as an information archive.
Install Docker
Quick Edit: For users of Raspbian
on raspberry devices, please install using the script at https://get.docker.com
Use this only once and without prior docker installation, afterwards use the package manager
Here is the docker documentation explaining this, scroll up to the top and read down for more info
I used the docker documentation for Debian which worked fine, but you’ll find instructions for other Linux flavors, MacOS and Windows there too.
Download and start
The x86 version of NextCloudPi docker container features the latest Nextcloudpi networking and system management extras.Download it with:
-
docker pull ownyourbits/nextcloudpi (Should now work for all architectures) Leaving the original pull commands below, just in case, they can be used with :version, if older versions are needed
-
docker pull ownyourbits/nextcloudpi-x86
-
docker pull ownyourbits/nextcloudpi-armhf (If using RPI ot other armfs SBC)
Run it with:
-
docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /path/to/ncdata:/data --name nextcloudpi ownyourbits/nextcloudpi DOMAIN
Any folder can be used instead of the volume ncdata to hold the Nextcloud data. Without full PATH ncdata will be in /var/lib/docker/volumes/ of the host.
Optionally for nc-backups you can insert:
-
-v /path/on/your/host/to/ncp-backups:/path/inside/the/container/to/ncp-backups
Check and manage
Check for and list running containers with:-
docker ps
-
docker ps -a
-
docker stop nextcloudpi
-
docker start nextcloudpi
-
docker rm nextcloudpi
Update to latest NCP version with:
- Edit: For docker it's recommended to update by pulling the new image, stopping the old & starting the new, then removing the old else they will start to pile up after a while. And not use the internal updater for ncp, the docker image must be updated in the docker registry on the docker hub and then you update with that.
Run NCP-config to access all NCP apps with:
-
docker exec -it nextcloudpi ncp-config
Make sure container re-start, unless manually stopped with:
-
docker update --restart=unless-stopped nextcloudpi
View other options with:
-
docker help
Start docker with custom storage volume with:
-
sudo mkdir /media/myUsbDrive/ncdata
-
docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/myUsbDrive/ncdata:/data --name nextcloudpi ownyourbits/nextcloudpi sub.domain.tld
Add IP or domain to trusted domains array with:
-
docker exec -it nextcloudpi ncc config:system:set trusted_domains 9 --value="sub.domain.tld"
Reload apache2 webservice with:
-
docker exec -it nextcloudpi service apache2 reload
Docker Commandline Reference
-
https://docs.docker.com/engine/reference/commandline/docker/
Mounting an external drive
As nc-datadir and nc-automount are not available in ncp’s docker image
This is how I mount ncdata persistently.
Preparations:
- Create a mountpoint for the external drive and ncdata
sudo mkdir /media/ncp
- Find UUID of external drive
ls -lh /dev/disk/by-uuid/
(Mine looks like this) total 0 lrwxrwxrwx 1 root root 15 Aug 11 09:10 29075e46-f0d4-44e2-a9e7-55ac02d6e6cc -> …/…/mmcblk0p2 lrwxrwxrwx 1 root root 10 Aug 11 09:10 35e98a80-8895-41f4-93e7-39940a1fda70 -> …/…/sda1 lrwxrwxrwx 1 root root 15 Aug 11 09:10 9304-D9FD -> …/…/mmcblk0p1
- Add a ligne to /etc/fstab
sudo nano /etc/fstab
add line for your drive (copy/paste your drive’s UUID and change ext4 to btrfs if needed):UUID=YourDrive’sUUID /media/ncp ext4 rw,users,exec 0 0
- mount the drive
Now you can :sudo mount -a
- remove existing container,
docker rm nextcloudpi
- create a new directory for ncdata as for example
sudo mkdir /media/ncp/ncdata
- then create and start the container with
docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/ncp/ncdata:/data --name nextcloudpi ownyourbits/nextcloudpi-armhf 192.168.n.nn
- wait for init done with
docker logs -f nextcloudpi (ctrl+c to exit log)
extended quide to getting stared with docker is available on the forum at
https://help.nextcloud.com/t/guide-to-getting-started-with-nextcloudpi-docker-in-2020/93396
NOTE
In the NCP Docker container the following NCP Apps are NOT available:
**UPDATES**
- nc-autoupdate-ncp
- nc-update
**BACKUPS**
- nc-restore-snapshot
- nc-snapshot-auto
- nc-snapshot-sync
- nc-snapshot
**CONFIG**
- nc-database
- nc-datadir
- nc-init
- nc-nextcloud
**NETWORKING**
- NFS
- SSH
- nc-static-IP
- samba
**SECURITY**
- UFW
- fail2ban
- nc-audit
**SYSTEM**
- nc-automount
- nc-hdd-monitor
- nc-ramlogs
- nc-swapfile
- nc-zram
**TOOLS**
- nc-format-USB
We hope this doc was helpful, if you encounter any issues please reach out to the community.
These docs are written by volunteers, please consider becoming one of them.
Contact the wiki team at Matrix or Telegram