How to get started with NCP docker

image

Install Docker

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:

  1. 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
DOMAIN should be your trusted domain: the URL or IP that will be used to access.

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
That's it. Visit https://DOMAIN//activate/ copy and save auto generated passwords, and start using your Nextcloud instance.

Check and manage

Check for and list running containers with:
  • docker ps
Check for and list created containers with:
  • docker ps -a
Stop, start and remove an existing container
  • docker stop nextcloudpi
  • docker start nextcloudpi
  • docker rm nextcloudpi

Update to latest NCP version with:

  • docker exec -it nextcloudpi ncp-update

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 0 0
  • mount the drive
sudo mount -a
Now you can :
  • 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:

**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