Wednesday, July 29, 2020

Set up nextcloud on digitalocean - 1 Basic setup (snap)

I've always wanted to setup a private file share family and friends that is secure. Looks like Nextcloud have the best feature set, and I've decided to give it a shot. If all goes well I will have a simple, efficient setup to use as a file backup on cloud with mobile access.

Once the functional aspects are setup properly, I will have time to worry about non functional requirements (security / backup, restore / monitoring / performance / cost efficiency / high availability / etc..)

heres the steps I followed:
  1. https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04
    I didnt worry about UFW as I will be using DigitalOcean cloud firewall rules to secure hosts at a network level for now. host level firewall is a possible future addon
  2. https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-nextcloud-on-ubuntu-18-04
  3. Have the block storage attached to the droplet 
  4. sudo snap stop nextcloud
  5. https://www.digitalocean.com/community/questions/configuring-volumes
    1. sudo mkdir -p /media/nextcloud_data
    2. sudo mount -o discard,defaults,noatime /dev/disk/by-id/<disk-id> /media/nextcloud_data
    3. sudo echo '/dev/disk/by-id/<disk-id> /media/nextcloud_data ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab
  6. read through https://askubuntu.com/questions/882625/nextcloud-snap-with-data-directory-on-external-harddrive
    1. sudo mv /var/snap/nextcloud/common/nextcloud/data ./nextcloud_data/data
    2. sudo vi /var/snap/nextcloud/current/nextcloud/config/config.php
  7. sudo snap start nextcloud
  8. go to the application and do a quick sanity check as admin. 
  9. This is a good time to take a backup for droplet as you may want to restart the journey from here in case

Additional reading material:

No comments: