Skip to content

Nextcloud Installation

Brief description: Install Nextcloud on VM-102 using Snap and configure for reverse proxy.

What You'll Learn

  • How to install Nextcloud via Snap
  • How to configure trusted domains and proxies
  • How to verify the installation

Prerequisites

  • [ ] VM-102 created with Ubuntu 24.04 LTS
  • [ ] Nextcloud snap selected during Ubuntu installation (or install manually below)
  • [ ] IP address: 192.168.192.102
  • [ ] Nginx Proxy VM (192.168.192.20) installed
  • [ ] Domain: cloud.yourdomain.com

Estimated Time

30-45 minutes

Snap Already Installed

If you selected Nextcloud during Ubuntu installation, the snap is already installed. Skip Steps 2-4 if already done.

Step-by-Step Instructions

Step 1: SSH to Nextcloud VM

ssh admin@192.168.192.102

Step 2: Update System

sudo apt update && sudo apt upgrade -y

Step 3: Install Snap (if needed)

sudo apt install -y snapd

Verify:

snap version

Step 4: Install Nextcloud

sudo snap install nextcloud

This will take 10-15 minutes. Monitor progress:

sudo snap changes

Wait until status shows "Done".

Step 5: Create Admin Account

sudo nextcloud.manual-install admin <strong-password>

Replace <strong-password> with a secure password.

Step 6: Configure for Reverse Proxy

Configure trusted domains and trusted proxies:

# Add your domain
sudo nextcloud.occ config:system:set trusted_domains 1 --value=cloud.yourdomain.com

# Add nginx-proxy IP as trusted proxy
sudo nextcloud.occ config:system:set trusted_proxies 0 --value=192.168.192.20

# Set URL overwrite
sudo nextcloud.occ config:system:set overwrite.cli.url --value=https://cloud.yourdomain.com/

# Set protocol overwrite
sudo nextcloud.occ config:system:set overwriteprotocol --value=https

Restart Nextcloud:

sudo snap restart nextcloud

Verify configuration:

sudo nextcloud.occ config:system:get trusted_domains
sudo nextcloud.occ config:system:get trusted_proxies

Step 7: Verify Installation

Check Nextcloud status:

sudo nextcloud.occ status

Expected output:

  - installed: true
  - version: 28.0.x.x
  - versionstring: 28.0.x
  - edition: 

Step 8: Configure Background Jobs

Set cron for background tasks:

sudo nextcloud.occ background:cron

Add cron job:

echo "*/5 * * * * root /snap/bin/nextcloud.occ background:cron" | sudo tee /etc/cron.d/nextcloud

Step 9: Configure Memory Caching

Enable APCu for better performance:

sudo nextcloud.occ config:system:set memcache.local --value='\OC\Memcache\APCu'

Step 10: Adjust PHP Memory Limit

sudo snap set nextcloud php.memory-limit=512M

Step 11: Test Access

After configuring Nginx reverse proxy:

  1. Open browser: https://cloud.yourdomain.com

  2. Login with:

  3. Username: admin
  4. Password: [password you set in Step 5]

  5. You should see the Nextcloud dashboard

Verification

  • [ ] Nextcloud snap installed
  • [ ] Admin account created
  • [ ] Trusted domains configured
  • [ ] Trusted proxies configured (nginx-proxy IP)
  • [ ] SSL certificates obtained
  • [ ] Access via domain working

(End of file

Next Steps