How to Install Nextcloud on PrivateRouter OpenWRT - Self-Hosted Cloud Storage

Last updated: September 11, 2025
Table of Contents

PrivateRouter custom VPN routers provide an easy one-click method to deploy popular self-hosted apps directly on your router. When combined with TorGuard's Private VPN Cloud service, users can easily self-host applications securely behind WireGuard.

What is Nextcloud?

Nextcloud is a powerful self-hosted cloud storage platform that puts you in complete control of your data. It's a full-featured alternative to services like Google Drive, Dropbox, and Microsoft 365, offering:

File Storage & Sync

Store, sync, and share files across all devices

Calendar & Contacts

Manage calendars and contacts with CardDAV/CalDAV

Talk & Collaboration

Built-in chat, video calls, and screen sharing

Office Suite

Edit documents, spreadsheets, and presentations

Prerequisites

Before you begin, ensure you have:

  • PrivateRouter with OpenWRT firmware
  • Docker support enabled on your router
  • At least 2GB available storage (more recommended)
  • FileBrowser installed (for config editing)
  • Nginx Proxy Manager installed (for domain access)
  • (Optional) Domain name for external access

⚠️ Storage Considerations: Nextcloud can consume significant storage space. Consider attaching external USB storage to your router or using a NAS mount for data storage.

Installation Steps

Step 1: Deploy Nextcloud via Docker

Login to your PrivateRouter and click the System menu. Select Custom Commands then locate Nextcloud and click the RUN button.

PrivateRouter Custom Commands menu showing Nextcloud installation option

💡 Pro Tip: The installation will deploy both Nextcloud and a MariaDB database container for optimal performance.

Step 2: Wait for Installation Completion

Wait a few minutes for Docker to complete the app install. Scroll to the bottom and you will see output similar to the commands below when the install has been completed.

Docker installation output showing Nextcloud deployment completion

⚠️ Note: If you receive an error instead of docker output, this can happen if the install takes longer. The app will still be installed, so be patient and proceed to the next step.

Step 3: Access Nextcloud Interface

To access Nextcloud after it's been installed, click the Docker menu then select Containers. You should see the newly created Nextcloud container with a green UP status.

Docker containers list showing Nextcloud with green UP status

Click the port link by "Nextcloud_app" to access Nextcloud via your local router IP address and port. With default settings, this will load at:

http://192.168.0.1:8531

Step 4: Create Admin Account

Enter your desired admin username and password for access to your Nextcloud instance and click the Install button.

Nextcloud initial setup screen for creating admin account

🔒 Security Tip: Use a strong password! This admin account has full control over your Nextcloud instance.

Step 5: Install Recommended Apps

Nextcloud comes with many extra features. Click the install button to take advantage of them.

Nextcloud recommended apps installation screen

Recommended Apps Include:

  • Calendar - Full-featured calendar with sharing
  • Contacts - Address book management
  • Talk - Chat and video conferencing
  • Mail - Email client integration
  • Deck - Kanban-style project management

Step 6: Nextcloud Dashboard

Your Nextcloud instance is now installed and ready to use via local IP:port.

Nextcloud dashboard showing successful installation

Local Access Only? If you only want local access to Nextcloud and do not wish to access via domain name, then you are all set. Skip to the Features section below.

Setting Up Domain Access

⚠️ Important: To use Nextcloud via domain name, we must update the Nextcloud config file to add your domain as a trusted domain.

Step 7: Access FileBrowser

The fastest way to update the Nextcloud config file is through the FileBrowser app as FileBrowser is mapped to the PrivateRouter docker folder. If you have not yet installed FileBrowser, you can install it with this tutorial.

First login to FileBrowser:

FileBrowser login screen

Step 8: Navigate to Nextcloud Config

Click the Nextcloud folder:

FileBrowser showing Nextcloud folder

Next, click the config folder:

FileBrowser showing config folder inside Nextcloud directory

Step 9: Edit config.php

Click the config.php file and select the code editor icon in the top right corner:

FileBrowser showing config.php file

Step 10: Add Trusted Domain

Locate the local Nextcloud IP address 192.168.0.1:8531 in the trusted domains array and add your desired Nextcloud domain name (example: cloud.yourdomain.com).

FileBrowser code editor showing config.php with trusted domains

Click the save icon in the top right corner.

'trusted_domains' => 
array (
  0 => '192.168.0.1:8531',
  1 => 'cloud.yourdomain.com',
),

Step 11: Configure Nginx Proxy Manager

For this step you must have already installed the Nginx Proxy Manager app. If not, please follow the tutorial here.

Login to Nginx Proxy Manager at http://192.168.0.1:81 and navigate to Hosts → Proxy Hosts.

Nginx Proxy Manager dashboard

Step 12: Add Proxy Host for Nextcloud

Click the Add Proxy Host button.

Nginx Proxy Manager Add Proxy Host button

Configure the following settings:

  • Domain Names: cloud.yourdomain.com
  • Scheme: http
  • Forward Hostname/IP: 192.168.0.1
  • Forward Port: 8531
  • Websockets Support: ON ✓
Nginx Proxy Manager proxy host configuration for Nextcloud

Step 13: Configure SSL Certificate

Under the SSL tab, configure Let's Encrypt certificate as shown in previous tutorials, then save.

Nginx Proxy Manager SSL configuration

Essential Nextcloud Configuration

🔧 config.php Customizations

For optimal performance and security, add these settings to your config.php:

# Memory limit for large file uploads
'memory_limit' => '512M',

# Default phone region
'default_phone_region' => 'US',

# Enable maintenance window
'maintenance' => false,
'maintenance_window_start' => 1,

# Improve performance
'enable_previews' => true,
'preview_max_x' => 1024,
'preview_max_y' => 768,

# Security headers
'overwriteprotocol' => 'https',
'overwrite.cli.url' => 'https://cloud.yourdomain.com',

📁 External Storage

To add external storage (USB drive or network share):

  1. Install "External storage support" app from Nextcloud app store
  2. Go to Settings → External Storage
  3. Add local folder: /mnt/usb/nextcloud-data
  4. Or add SMB/CIFS share for network storage

Nextcloud Features & Apps

📱 Mobile & Desktop Sync

  • iOS and Android apps
  • Desktop clients for Windows/Mac/Linux
  • Automatic photo backup
  • Selective sync options

🗂️ File Management

  • Version control
  • File sharing with passwords
  • Expiration dates for shares
  • Comments and tags

👥 Collaboration

  • Real-time document editing
  • Video conferencing
  • Screen sharing
  • Team folders

🔐 Security Features

  • End-to-end encryption
  • Two-factor authentication
  • Brute force protection
  • File access control

Performance Optimization

Enable Redis Cache

Add Redis for better performance:

# Add to config.php
'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
    'host' => 'localhost',
    'port' => 6379,
],

Background Jobs

Set up cron for background jobs instead of AJAX:

  1. SSH into router
  2. Add cron job: */5 * * * * docker exec -u www-data nextcloud_app php cron.php
  3. In Nextcloud settings, select "Cron" for background jobs

Troubleshooting Common Issues

Untrusted Domain Error

Solution:

  • Add domain to trusted_domains in config.php
  • Clear browser cache
  • Restart Nextcloud container: docker restart nextcloud_app

Large File Upload Fails

Solution:

  • Increase PHP limits in Nextcloud container
  • Add to config.php: 'chunking_enabled' => true
  • Increase Nginx client_max_body_size in NPM
  • Check available storage space

Slow Performance

Solution:

  • Enable Redis caching (see optimization section)
  • Switch to cron for background jobs
  • Disable unnecessary apps
  • Check router CPU/memory usage
  • Consider external database on more powerful hardware

Calendar/Contacts Sync Issues

Solution:

  • Use correct DAV URLs:
  • CalDAV: https://cloud.yourdomain.com/remote.php/dav/
  • CardDAV: https://cloud.yourdomain.com/remote.php/dav/
  • Check .htaccess file exists
  • Verify WebDAV module is enabled

Useful Docker Commands

# View Nextcloud logs
docker logs -f nextcloud_app

# Access Nextcloud container shell
docker exec -it nextcloud_app bash

# Run Nextcloud occ commands
docker exec -u www-data nextcloud_app php occ status
docker exec -u www-data nextcloud_app php occ maintenance:mode --on
docker exec -u www-data nextcloud_app php occ maintenance:mode --off

# Scan files after manual upload
docker exec -u www-data nextcloud_app php occ files:scan --all

# Update Nextcloud
docker exec -u www-data nextcloud_app php occ upgrade

# Check Nextcloud integrity
docker exec -u www-data nextcloud_app php occ integrity:check-core

# Database maintenance
docker exec nextcloud_db mysqldump -u root -p nextcloud > nextcloud-backup.sql

Mobile App Configuration

iOS/Android Setup:

  1. Download Nextcloud app from App Store/Play Store
  2. Enter server address: https://cloud.yourdomain.com
  3. Login with your username and password
  4. Grant permissions for photo/file access
  5. Enable automatic photo upload (optional)

💡 Tip: Use app passwords for mobile devices. Go to Settings → Security → Devices & sessions → Create new app password.

Summary

You've successfully installed Nextcloud on your PrivateRouter OpenWRT system! This powerful platform provides:

  • ✅ Complete control over your data
  • ✅ File sync across all devices
  • ✅ Calendar, contacts, and email integration
  • ✅ Document collaboration features
  • ✅ Video conferencing and chat
  • ✅ Secure access via your own domain

Next Steps

  • Install Nextcloud mobile apps
  • Set up desktop sync clients
  • Configure external storage
  • Enable two-factor authentication
  • Explore additional apps from Nextcloud store
  • Set up automated backups

Was this article helpful?

Share:

Ready to Get Help?

Our support team is available 24/7 to assist you with any questions.