Getting started with NextCloudPi on Proxmox

,

Warning, use this “How to” with caution, it’s not yet final.

  • I hope to put together a beginner-friendly tutorial on how to get NCP running on Proxmox.
  • Please give feedback if you have issues
  • Thanks in advance for any help & contributions.

The goal

  1. Running NCP on a Proxmox (obviously)

    There are 4 ways achieving this:

    1. Debian Buster LXC and install NCP using the curl installer

    2. Debian Buster VM and install NCP using the curl installer

    3. Create a VM and use the official ncp-VM image

    4. Create a VM, install docker-ce and run the docker NCP image inside the VM.
      (As I have no Idea about Docker and don’t have the time and interest to inform myself I will not write a turorial. Feel free to contribute one yourself)

      Note: There is a LXC turnkey-nextcloud in the Proxmox Container Repo. This is a ready NC installation. However, it is not NextcloudPi and as this How to focuses on NCP we wil not consider that option.

  2. Pass through a drive that is used for NCP data only.

  3. Restore NCP Backup from external USB Drive


1. Running NCP on a Proxmox

Option 1

This option seems to be the most resource friendly option. However, I have tried and failed, but obviously, I’m not the first to try. @gmiller01 @AlexanderSch90 @johnnypea @luciandf
How did you eventually succeed? Would you mind posting how you did it?

The drawback of this option might be problems with updates as @luciandf has experienced? Is there anyone using this option and can recommend it?


Option 2 :white_check_mark:

Worked well and easy. However, the drawback here, as I understand it, is that this is not yet a BTRFS file system that would allow nc-snapshots.

  1. Download debian-10.9.0-amd64-netinst.iso
  2. upload the .iso to Proxmox
  3. set up a new VM
  4. boot and install Debian Buster (10)
  5. run: apt updates && apt upgrade -y
  6. run: apt install curl
  7. run: curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash
  8. Access & Activate NCP using the browser

Option 3 :white_check_mark:

Using the VM image from NCP is the easiest and most straightforward option.

  1. Create a new VM on your Proxmox server and chose the option “Do not use any media” in the OS section.

  1. In the main Proxmox terminal

    1. Change directory: cd /var/lib/vz/images/

    2. Use the wget command to download the latest VM image from ownyourbits.com
      Currently, (April 2021):
      wget https://ownyourbits.com/downloads/NextCloudPi_VM_11-30-20/NextCloudPi_VM_11-30-20.tar.bz2

    3. When finish, use the tar -xf command to extract the download.
      Currently, (April 2021):
      tar -xf NextCloudPi_VM_11-30-20.tar.bz2

    4. Finally create a VM disk using
      qm importdisk VIRTUAL-MACHINE-NUMBER NextCloudPi_VM_XX-XX-XX.img DRIVE-NAME
      (Example: qm importdisk 104 NextCloudPi_VM_11-30-20.img local-zfs)

  2. Close the terminal and in the Proxmox Web interface:

    1. Go to your VM you wish to use and select Hardware

    2. Find the disk you have just created (usually disk-1)

    3. Use the Edit function to add it to your VM

    4. On the left go to Option and set boot to the new disk

    5. Start the VM and run updates.

  3. Access & Activate NCP using the browser


2. Pass through a drive that is used for NCP data. :white_check_mark:

In this case, we are going to pass through an entire, physical drive. If you wish to only pass through only part of a drive, as virtual drive commands will be slightly different. (Check out this and the official Proxmox docs)

  1. Use the main Proxmox Terminal and type: ls /dev/disk/by-id/ a list of all your drives, physical and virtual will appear.

  2. Find the drive you wish to pass through to your VM and copy the full drive name.

  3. Use this command to add it: qm set VM-ID-NUMBER -scsi2 /dev/disk/by-id/FULL-DRIVE-NAME

  4. Leave the Terminal and navigate to your VM

  5. In the Hardware section you should now see the drive.

  6. Boot your VM and open it’s Terminal.

  7. With the lsblk command you should see your drive listed.

    NOTE: If you are coming from e.g. a RaspberryPi setup and want to use the data drive do not follow the steps below. Simply let your NCP VM instance know where your data directory is & restore your NCP by loading a data-less backup. (How to restore backups)

  8. Delete all data on the drive you want to use as data drive.

    (sda as example!)

    1. Type fdisk -c /dev/sda (This will delete all data on sda
    2. Type g to create a gpt partition table
    3. Type n to create a new partion, just hit enter to all (defaults to Linux and max size)
    4. Type w to save and exit
    5. Run mkfs.ext4 /dev/sda1 (alternatively you can format as btrfs)
  9. Create a mountpoint, mount it and set auto-mount

    1. Type mkdir /media/MY-MOUNT-NAME create mountpoint
    2. Type mount /dev/sda1 /media/MY-MOUNT-NAME mount drive to system
    3. Type df -hT to see if it is mounted (if it is listed, it’s mounted)
    4. Type nano /etc/fstab and add the following line:
      /dev/sda1 /media/ncdata ext4 4,nofail 0 0 (if you use BTRFS please see here how to mount and edit fstab)

3. Restore NCP Backup from external USB Drive

(This section needs some love (work), but here is a summary:)

  1. Let your NCP VM instance know where your data directory is & restore your NCP by loading a full backup (How to restore backups).

:white_check_mark: = Successfully tested

Credit to @OliverV
for helping out.

Yes, you add the drive later.
In terminal:

From Proxmox Web interface

  • add the unused disk to the VM
  • In VM options set boot to the new disk
  • start the VM

I see a 4th way and that is to create a VM install docker-ce and run docker NCP image inside the VM.

1 Like

Thanks @OliverV forgot about wget, that makes it more easy.

But it seems I’m still doing something wrong.
I can see the unused disk, and I’m able to add it, but the VM does not boot.

Go to Options and edit the boot device and set to scsi1, then boot.
(edit) edited earlier comment also, to add this step.

1 Like

Thanks, I added it to the guide and followed the steps myself.

I now work on post installation, which I also want to document.

But I once again reach my technical knowledge limit.

I want to add a drive just for data to the VM.
I was able to passthrough the secondary internal drive to the VM and with lsblk it shows up as sda in the ncp-VM

Should I format manually to BTRFS so I can use snapshots?
If so, how to do that, I struggle to find information on how to go about it.

in vm terminal run
(this will destroy any data on the drive!!!)

fdisk -c /dev/sda

(g)create a gpt partition table
(n)create a new partion, just hit enter to all (defaults to Linux and max size)
(w)save and exit

run
mkfs.ext4 /dev/sda1

You can now create a mountpoint and mount it
mkdir /media/mymount
mount /dev/sda1 /media/mymount

Check with
df -hT

1 Like