Skip to main contentSkip to navigation
[email protected]
Client AreaSupport
Hosting Mammoth
HostingMammothYour Data, Our Responsibility
Home
Solutions
Hosting Services
Store
Pricing
About
Blog
API
Contact

Stay Ahead of the Curve

Get the latest insights on cybersecurity, AI innovations, and enterprise data solutions delivered to your inbox.

Hosting Mammoth
HostingMammothEnterprise Solutions

Enterprise-grade data solutions. Hosting, recovery, cybersecurity, and AI-powered services for businesses worldwide.

[email protected]
Sun - Fri, 9:00am - 5:00pm

Services

  • Cloud Hosting
  • Data Recovery
  • Cybersecurity
  • Legal Support
  • MSP Services
  • Web Development
  • AI Services
  • Free Server Migration

Hosting

  • VPS Hosting (NVMe SSD)
  • VDS Hosting (NVMe)
  • Storage VPS (High SSD)
  • GPU Servers
  • Managed Services
  • Cloud Firewall
  • Load Balancer
  • One-Click Apps
  • n8n Hosting
  • Object Storage
  • FAQ

Company

  • Store
  • Pricing
  • About Us
  • Locations
  • Blog
  • Testimonials
  • Contact
  • Affiliate Program
  • White-Label
  • Terms of Service
  • Privacy Policy
  • Browser Cookies
  • SLA

Support

  • Client Area
  • Submit Ticket
  • Knowledge Base
  • Server Status
  • API Documentation

© 2026 Hosting Mammoth. All rights reserved.

Knowledge Base
Getting StartedAccount ManagementVPS HostingGPU ServersStorage VPSCloud FirewallLoad BalancerServer ManagementBilling & PaymentsSupport & TicketsAffiliate ProgramReseller ProgramMarketplace & Appsn8n HostingManaged ServicesServer MigrationAPI & DevelopersSecurityTroubleshootingGlossaryInstall Guides
  1. Home
  2. /
  3. Support
  4. /
  5. Install Guides
  6. /
  7. How To Install Nextcloud Ubuntu
GUIDEInstall Guides

How to Install Nextcloud on Ubuntu 24.04 — Self-Hosted Cloud Storage & Collaboration

25 min read

How to Install Nextcloud on Ubuntu 24.04 — Self-Hosted Cloud Storage & Collaboration

Replacing Google Drive, Dropbox, and OneDrive with your own infrastructure gives you unlimited storage at a flat monthly cost, removes per-user seat licensing, and keeps every file under your legal and physical control. This guide walks you through installing Nextcloud on an Ubuntu 24.04 VPS, from the first apt update to a production-ready deployment with Apache, PHP 8.3, MariaDB, Redis memcache, TLS, external storage, Talk video calls, and Collabora Online document editing.

Looking for a managed option? Deploy Nextcloud on a pre-tuned LAMP VPS with our CloudCore Professional plan — EUR 19.99/month, 6 vCPU, 12 GB RAM, 100 GB NVMe.

Table of Contents

  • What is Nextcloud?
  • Why Self-Host vs. Google Drive / OneDrive / Dropbox?
  • Prerequisites
  • Step 1: Update System Packages
  • Step 2: Install Apache, PHP 8.3, and Required Modules
  • Step 3: Install and Secure MariaDB 10.11
  • Step 4: Install Redis for Memcache and File Locking
  • Step 5: Download Nextcloud and Set Permissions
  • Step 6: Configure Apache Virtual Host
  • Step 7: Run the occ Maintenance Install
  • Step 8: Tune config.php — Trusted Domains, Redis, Caching
  • Step 9: Obtain a TLS Certificate with Certbot
  • Step 10: Configure Background Jobs via Crontab
  • Step 11: Install Core Apps (Talk, Mail, Calendar, Contacts, Notes)
  • Step 12: Add Collabora Online or OnlyOffice
  • Step 13: Configure External Storage (S3 and SMB)
  • Post-Install Hardening Checklist
  • Troubleshooting
  • FAQ
  • Next Steps
  • What is Nextcloud?

    Nextcloud is an open-source, self-hosted content collaboration platform — think of it as a privacy-respecting Google Workspace or Microsoft 365 replacement that runs entirely on your own server. At its core, Nextcloud provides file sync across desktop, mobile, and web; but the full platform extends far beyond storage. With over 200 apps in the official marketplace, you can add group chat and video meetings (Talk), a groupware suite (Mail, Calendar, Contacts, Deck, Notes), collaborative document editing (Collabora Online, OnlyOffice), flow automation, full-text search, and end-to-end encryption.

    Unlike single-purpose tools, Nextcloud is designed to be the single pane of glass for a team's files and communication. Users authenticate once and access everything through the same web UI and desktop clients. Admins get granular quotas, group folders, LDAP/SAML integration, and detailed audit logging. Developers can extend it with the Nextcloud App SDK or hook into webhooks for automation.

    The platform is governed by Nextcloud GmbH but remains fully open source under the AGPL license. The full documentation lives at docs.nextcloud.com and is the authoritative reference for every admin command we use in this guide.

    Why Self-Host vs. Google Drive / OneDrive / Dropbox?

    Cloud storage from the big three providers is convenient, but the economics and privacy trade-offs are increasingly hard to justify for teams and privacy-conscious individuals.

    • Unlimited storage at flat-rate EUR per TB — On a CloudCore VPS, 1 TB of NVMe storage costs roughly EUR 10-15/month and never scales per user. Google Workspace Business Standard charges EUR 11.50/user/month for 2 TB pooled, meaning a 10-person team pays EUR 115/month for 20 TB pooled. A VPS with 2 TB of storage costs a fraction of that and covers unlimited users.
    • No per-seat licensing — Add 5 users or 500 users for the same monthly cost. Seat pricing penalizes growth; flat VPS pricing rewards it.
    • Complete data sovereignty — Your files never touch Google, Microsoft, or Dropbox infrastructure. For EU businesses, this sidesteps most of the GDPR third-country transfer complexity introduced by Schrems II.
    • No algorithmic scanning — Big cloud providers scan uploaded content for policy violations, advertising signals, and ML training material. Nextcloud does nothing of the sort — your photos and documents are just bytes on your disk.
    • Client-side and server-side encryption — Nextcloud supports optional end-to-end encryption for sensitive folders, plus server-side encryption for the file storage layer.
    • No vendor lock-in — All data is stored as plain files on the filesystem. Migrating off Nextcloud is rsync; migrating off Google Drive is an export-and-pray operation.
    • Integrated productivity suite — Collabora Online and OnlyOffice give you real-time collaborative document editing. Talk gives you chat and video. Calendar and Contacts sync via CalDAV/CardDAV to any client.

    Cost Comparison: Self-Hosted Nextcloud vs. Cloud Storage

    ScenarioGoogle WorkspaceMicrosoft 365 BusinessDropbox BusinessSelf-Hosted Nextcloud (VPS)
    Monthly cost (10 users)~EUR 115~EUR 125~EUR 150EUR 19.99 (unlimited users)
    Storage ceiling2 TB pooled/user1 TB/user15 TB pooledDisk size (scales with plan)
    Per-TB marginal costIncluded in seat feeIncluded in seat feeIncluded in seat fee~EUR 10-15/TB on NVMe
    Data leaves your jurisdiction?YesYesYesNo
    Content scanning / ML training?YesYesYesNo
    Custom branding & appsLimitedLimitedNoFull
    Collaborative document editingDocs (bundled)Office (bundled)Paper (basic)Collabora / OnlyOffice
    Video calls includedMeetTeamsNone (3rd party)Talk (unlimited rooms)
    For teams of 5+ users, self-hosted Nextcloud pays for itself within the first month. For individuals, it trades EUR 10-20/month of VPS cost for unlimited storage and true privacy.

    Prerequisites

    Before you begin, make sure you have:

    • A VPS running Ubuntu 24.04 LTS with root or sudo access
    • SSH access to your server
    • A domain name pointed at your VPS IP (A record) — required for TLS certificates
    • At least 4 GB RAM (8-12 GB recommended for smooth multi-user operation with Collabora)
    • At least 40 GB of disk space for the OS, Nextcloud itself, and initial user data (scale up based on expected storage)
    Recommended Plan: CloudCore Professional
    >
    For a production Nextcloud serving a small team (5-25 users) with Collabora Online and Talk, we recommend the CloudCore Professional plan:
    >
    - 6 vCPU cores
    - 12 GB RAM
    - 100 GB NVMe SSD
    - Unmetered bandwidth
    - EUR 19.99/month
    >
    This gives you enough headroom for PHP-FPM workers, MariaDB buffer pool, Redis cache, and the Collabora Docker container. For larger user bases or heavy photo libraries, scale up the disk or attach block storage.

    Connect to your server via SSH:

    bash
    ssh root@your-server-ip

    Throughout this guide we will use cloud.example.com as the placeholder domain — replace it with your actual hostname.

    Step 1: Update System Packages

    Start by refreshing the package index and upgrading installed packages so you are working from a known-good baseline.

    bash
    sudo apt update && sudo apt upgrade -y

    If the kernel was updated, reboot before continuing:

    bash
    sudo reboot

    Reconnect via SSH after a minute. Install a handful of utilities we will need throughout the guide:

    bash
    sudo apt install -y curl wget unzip gnupg2 ca-certificates software-properties-common lsb-release

    Step 2: Install Apache, PHP 8.3, and Required Modules

    Nextcloud 29+ requires PHP 8.1, 8.2, or 8.3. We will use PHP 8.3 from the official Ondrej Sury PPA for the latest patches.

    Add the PHP PPA:

    bash
    sudo add-apt-repository -y ppa:ondrej/php
    sudo apt update

    Install Apache and the full list of PHP modules Nextcloud needs:

    bash
    sudo apt install -y apache2 libapache2-mod-php8.3 \
      php8.3 php8.3-cli php8.3-common php8.3-curl php8.3-gd \
      php8.3-mbstring php8.3-mysql php8.3-xml php8.3-zip \
      php8.3-bcmath php8.3-gmp php8.3-intl php8.3-imagick \
      php8.3-bz2 php8.3-ldap php8.3-redis php8.3-apcu \
      php8.3-opcache php8.3-fpm imagemagick

    Enable the Apache modules Nextcloud relies on:

    bash
    sudo a2enmod rewrite headers env dir mime setenvif ssl http2
    sudo systemctl restart apache2

    Tune PHP for Nextcloud by editing /etc/php/8.3/apache2/php.ini:

    bash
    sudo sed -i \
      -e 's/^memory_limit = .*/memory_limit = 1024M/' \
      -e 's/^upload_max_filesize = .*/upload_max_filesize = 16G/' \
      -e 's/^post_max_size = .*/post_max_size = 16G/' \
      -e 's/^max_execution_time = .*/max_execution_time = 3600/' \
      -e 's/^max_input_time = .*/max_input_time = 3600/' \
      -e 's/;date.timezone =.*/date.timezone = UTC/' \
      -e 's/^output_buffering = .*/output_buffering = Off/' \
      /etc/php/8.3/apache2/php.ini

    Enable OPcache (dramatically speeds up PHP execution) by writing /etc/php/8.3/mods-available/opcache.ini:

    bash
    sudo tee /etc/php/8.3/mods-available/opcache.ini > /dev/null <<EOF
    zend_extension=opcache.so
    opcache.enable=1
    opcache.enable_cli=1
    opcache.interned_strings_buffer=16
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=256
    opcache.save_comments=1
    opcache.revalidate_freq=1
    opcache.jit=1255
    opcache.jit_buffer_size=128M
    EOF

    Restart Apache to pick up the changes:

    bash
    sudo systemctl restart apache2

    Verify PHP is running:

    bash
    php -v

    Expected output:

    text
    PHP 8.3.14 (cli) (built: ...)
    Copyright (c) The PHP Group
    Zend Engine v4.3.14, Copyright (c) Zend Technologies
        with Zend OPcache v8.3.14, Copyright (c), by Zend Technologies

    Step 3: Install and Secure MariaDB 10.11

    Nextcloud recommends MariaDB 10.6 or newer. Ubuntu 24.04 ships MariaDB 10.11 LTS in its default repositories, which is perfect.

    bash
    sudo apt install -y mariadb-server mariadb-client

    Secure the installation:

    bash
    sudo mysql_secure_installation

    Answer the prompts:

    • Enter current root password: (press Enter — it is empty)
    • Switch to unix_socket authentication: n
    • Change the root password: Y (set a strong password)
    • Remove anonymous users: Y
    • Disallow root login remotely: Y
    • Remove test database: Y
    • Reload privilege tables: Y
    Create the Nextcloud database and user:

    bash
    sudo mysql -u root -p

    Inside the MariaDB prompt, run:

    sql
    CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'REPLACE_WITH_STRONG_PASSWORD';
    GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

    Tune MariaDB for Nextcloud's workload by creating /etc/mysql/mariadb.conf.d/90-nextcloud.cnf:

    bash
    sudo tee /etc/mysql/mariadb.conf.d/90-nextcloud.cnf > /dev/null <<EOF
    [mysqld]
    transaction_isolation = READ-COMMITTED
    innodb_large_prefix = ON
    innodb_file_format = Barracuda
    innodb_file_per_table = 1
    innodb_buffer_pool_size = 2G
    innodb_io_capacity = 4000
    innodb_flush_log_at_trx_commit = 2
    innodb_log_buffer_size = 32M
    character_set_server = utf8mb4
    collation_server = utf8mb4_general_ci
    skip_name_resolve = 1
    EOF

    Restart MariaDB:

    bash
    sudo systemctl restart mariadb

    Step 4: Install Redis for Memcache and File Locking

    Nextcloud uses two caches: a local cache (APCu) for single-process data and a distributed cache (Redis) for file locking and cross-request data. Running without Redis causes race conditions on busy servers — install it up front.

    bash
    sudo apt install -y redis-server

    Edit /etc/redis/redis.conf to use a Unix socket (faster than TCP for local processes):

    bash
    sudo sed -i \
      -e 's|# unixsocket /run/redis/redis-server.sock|unixsocket /var/run/redis/redis-server.sock|' \
      -e 's|# unixsocketperm 700|unixsocketperm 770|' \
      /etc/redis/redis.conf

    Add the web server user to the redis group so Apache can access the socket:

    bash
    sudo usermod -aG redis www-data

    Restart Redis:

    bash
    sudo systemctl restart redis-server
    sudo systemctl enable redis-server

    Verify Redis is running:

    bash
    redis-cli ping

    Expected output: PONG

    Step 5: Download Nextcloud and Set Permissions

    Download the latest Nextcloud release tarball:

    bash
    cd /tmp
    wget https://download.nextcloud.com/server/releases/latest.tar.bz2
    wget https://download.nextcloud.com/server/releases/latest.tar.bz2.sha256
    sha256sum -c latest.tar.bz2.sha256

    The checksum output should say latest.tar.bz2: OK — if it does not, do not proceed.

    Extract to /var/www and rename to your domain:

    bash
    sudo tar -xjf latest.tar.bz2 -C /var/www/
    sudo mv /var/www/nextcloud /var/www/cloud.example.com

    Create the data directory outside the web root (this is critical for security — it prevents direct browser access to uploaded files):

    bash
    sudo mkdir -p /var/nextcloud-data

    Set correct ownership and permissions:

    bash
    sudo chown -R www-data:www-data /var/www/cloud.example.com
    sudo chown -R www-data:www-data /var/nextcloud-data
    sudo find /var/www/cloud.example.com -type d -exec chmod 750 {} \;
    sudo find /var/www/cloud.example.com -type f -exec chmod 640 {} \;
    sudo chmod 750 /var/nextcloud-data

    Step 6: Configure Apache Virtual Host

    Create the Apache site file at /etc/apache2/sites-available/cloud.example.com.conf:

    bash
    sudo tee /etc/apache2/sites-available/cloud.example.com.conf > /dev/null <<'EOF'
    <VirtualHost *:80>
        ServerName cloud.example.com
        DocumentRoot /var/www/cloud.example.com

    <Directory /var/www/cloud.example.com/> Require all granted AllowOverride All Options FollowSymLinks MultiViews

    <IfModule mod_dav.c> Dav off </IfModule> </Directory>

    ErrorLog ${APACHE_LOG_DIR}/cloud.example.com-error.log CustomLog ${APACHE_LOG_DIR}/cloud.example.com-access.log combined </VirtualHost> EOF

    Replace cloud.example.com with your real domain:

    bash
    sudo sed -i 's/cloud.example.com/cloud.yourdomain.com/g' \
      /etc/apache2/sites-available/cloud.example.com.conf

    Enable the site and disable the default one:

    bash
    sudo a2ensite cloud.example.com.conf
    sudo a2dissite 000-default.conf
    sudo apache2ctl configtest
    sudo systemctl reload apache2

    Open HTTP/HTTPS in the firewall (if UFW is enabled):

    bash
    sudo ufw allow 'Apache Full'

    Step 7: Run the occ Maintenance Install

    Nextcloud provides a command-line installer via occ that is more reliable than the web-based wizard. Run it as the www-data user.

    bash
    cd /var/www/cloud.example.com
    sudo -u www-data php occ maintenance:install \
      --database="mysql" \
      --database-name="nextcloud" \
      --database-user="nextcloud" \
      --database-pass="REPLACE_WITH_STRONG_PASSWORD" \
      --admin-user="admin" \
      --admin-pass="REPLACE_WITH_ADMIN_PASSWORD" \
      --data-dir="/var/nextcloud-data"

    Expected output:

    text
    Nextcloud was successfully installed

    Verify the admin user exists:

    bash
    sudo -u www-data php occ user:list

    Step 8: Tune config.php — Trusted Domains, Redis, Caching

    The installer writes a minimal config. Edit /var/www/cloud.example.com/config/config.php to add production settings. The easiest way is via occ config:system:set:

    bash
    sudo -u www-data php occ config:system:set trusted_domains 1 --value=cloud.yourdomain.com
    sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://cloud.yourdomain.com
    sudo -u www-data php occ config:system:set overwriteprotocol --value=https
    sudo -u www-data php occ config:system:set default_phone_region --value=US

    Memcache (APCu for local, Redis for distributed + file locking)

    sudo -u www-data php occ config:system:set memcache.local --value='\OC\Memcache\APCu' sudo -u www-data php occ config:system:set memcache.distributed --value='\OC\Memcache\Redis' sudo -u www-data php occ config:system:set memcache.locking --value='\OC\Memcache\Redis'

    Redis connection (Unix socket for speed)

    sudo -u www-data php occ config:system:set redis host --value=/var/run/redis/redis-server.sock sudo -u www-data php occ config:system:set redis port --value=0 --type=integer sudo -u www-data php occ config:system:set redis timeout --value=1.5 --type=float

    Pretty URLs (remove /index.php/)

    sudo -u www-data php occ config:system:set htaccess.RewriteBase --value=/ sudo -u www-data php occ maintenance:update:htaccess

    Enable APCu on the CLI (required for cron-based background jobs):

    bash
    echo "apc.enable_cli=1" | sudo tee /etc/php/8.3/cli/conf.d/20-apcu.ini

    Restart Apache so all cache settings take effect:

    bash
    sudo systemctl restart apache2

    Step 9: Obtain a TLS Certificate with Certbot

    Never run Nextcloud without TLS — it handles passwords, files, and calendar data.

    Install Certbot and the Apache plugin:

    bash
    sudo apt install -y certbot python3-certbot-apache

    Run Certbot against your domain:

    bash
    sudo certbot --apache -d cloud.yourdomain.com \
      --agree-tos --email [email protected] \
      --redirect --hsts --staple-ocsp

    The --redirect flag forces HTTP -> HTTPS, and --hsts and --staple-ocsp add HSTS and OCSP stapling headers. Certbot installs a systemd timer for automatic renewal:

    bash
    sudo systemctl status certbot.timer

    Verify the site works at https://cloud.yourdomain.com and redirects from HTTP correctly.

    Add a few extra security headers. Edit /etc/apache2/sites-available/cloud.example.com-le-ssl.conf (the file Certbot created) and inside the <VirtualHost *:443> block add:

    apache
    Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
        Header always set Referrer-Policy "no-referrer"
        Header always set X-Content-Type-Options "nosniff"
        Header always set X-Frame-Options "SAMEORIGIN"
        Header always set X-Permitted-Cross-Domain-Policies "none"
        Header always set X-Robots-Tag "noindex, nofollow"

    Reload Apache:

    bash
    sudo apache2ctl configtest && sudo systemctl reload apache2

    Step 10: Configure Background Jobs via Crontab

    Nextcloud needs to run background tasks every 5 minutes: cleaning up expired shares, scanning files, sending notifications, updating the full-text index, and much more. The web cron (AJAX) fires only when users are active — not reliable. Use system cron instead.

    Switch the cron mode:

    bash
    sudo -u www-data php occ background:cron

    Add the crontab entry for the www-data user:

    bash
    sudo crontab -u www-data -e

    Add this line:

    text
    /5    * php -f /var/www/cloud.example.com/cron.php

    Verify:

    bash
    sudo crontab -u www-data -l

    Manually trigger a run to confirm it works:

    bash
    sudo -u www-data php -f /var/www/cloud.example.com/cron.php

    No output means success. Check Admin -> Basic Settings in the web UI — the cron status should show "Last job execution ran a few seconds ago" in green.

    Step 11: Install Core Apps (Talk, Mail, Calendar, Contacts, Notes)

    Nextcloud's power comes from its app ecosystem. Install the essentials via occ:

    bash
    cd /var/www/cloud.example.com

    Groupware

    sudo -u www-data php occ app:install calendar sudo -u www-data php occ app:install contacts sudo -u www-data php occ app:install mail sudo -u www-data php occ app:install notes sudo -u www-data php occ app:install tasks sudo -u www-data php occ app:install deck

    Communication — Talk (chat + video + screen share)

    sudo -u www-data php occ app:install spreed

    Quality-of-life

    sudo -u www-data php occ app:install bookmarks sudo -u www-data php occ app:install forms sudo -u www-data php occ app:install news

    Nextcloud Talk — TURN Server for NAT Traversal

    For video calls to work reliably across networks, Talk needs a TURN/STUN server. Install coturn and wire it up:

    bash
    sudo apt install -y coturn
    sudo sed -i 's/#TURNSERVER_ENABLED=1/TURNSERVER_ENABLED=1/' /etc/default/coturn

    Generate a shared secret:

    bash
    openssl rand -hex 32

    Edit /etc/turnserver.conf:

    text
    listening-port=3478
    tls-listening-port=5349
    fingerprint
    lt-cred-mech
    use-auth-secret
    static-auth-secret=PASTE_GENERATED_SECRET_HERE
    realm=cloud.yourdomain.com
    total-quota=100
    bps-capacity=0
    stale-nonce
    no-loopback-peers
    no-multicast-peers

    Start coturn:

    bash
    sudo systemctl restart coturn
    sudo systemctl enable coturn
    sudo ufw allow 3478
    sudo ufw allow 5349

    In Nextcloud: Settings -> Administration -> Talk -> add STUN/TURN server cloud.yourdomain.com:3478, shared secret from above, protocols udp and tcp.

    Step 12: Add Collabora Online or OnlyOffice

    Nextcloud ships a basic text editor, but for real-time collaborative editing of Word, Excel, and PowerPoint documents you need a CODE server. Two options: Collabora Online (LibreOffice-based) or OnlyOffice Docs (MS-format-compatible). Deploy either as a Docker container behind Apache.

    Collabora Online (Docker)

    Install Docker:

    bash
    sudo apt install -y docker.io
    sudo systemctl enable --now docker

    Run Collabora:

    bash
    sudo docker run -t -d \
      --name collabora \
      --restart unless-stopped \
      -p 127.0.0.1:9980:9980 \
      -e "aliasgroup1=https://cloud.yourdomain.com:443" \
      -e "username=admin" \
      -e "password=REPLACE_COLLABORA_ADMIN_PASSWORD" \
      --cap-add MKNOD \
      collabora/code

    Create an Apache reverse proxy site at /etc/apache2/sites-available/collabora.conf:

    apache
    <VirtualHost *:443>
        ServerName office.yourdomain.com
        SSLEngine on
        SSLCertificateFile      /etc/letsencrypt/live/office.yourdomain.com/fullchain.pem
        SSLCertificateKeyFile   /etc/letsencrypt/live/office.yourdomain.com/privkey.pem

    AllowEncodedSlashes NoDecode SSLProxyEngine on ProxyPreserveHost On

    ProxyPass /browser http://127.0.0.1:9980/browser ProxyPassReverse /browser http://127.0.0.1:9980/browser ProxyPass /hosting/discovery http://127.0.0.1:9980/hosting/discovery ProxyPassReverse /hosting/discovery http://127.0.0.1:9980/hosting/discovery ProxyPass /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities ProxyPassReverse /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities

    ProxyPassMatch "/cool/(.*)/ws$" "ws://127.0.0.1:9980/cool/$1/ws" nocanon ProxyPass /cool/adminws ws://127.0.0.1:9980/cool/adminws ProxyPass /cool http://127.0.0.1:9980/cool ProxyPassReverse /cool http://127.0.0.1:9980/cool </VirtualHost>

    Enable proxy modules, issue a cert for the office subdomain, and install the Nextcloud Office app:

    bash
    sudo a2enmod proxy proxy_http proxy_wstunnel ssl
    sudo certbot --apache -d office.yourdomain.com
    sudo -u www-data php occ app:install richdocuments

    In Nextcloud -> Admin -> Office, set the Collabora Online server URL to https://office.yourdomain.com.

    For a deeper walkthrough, see our Collabora Online install guide.

    OnlyOffice Docs (Alternative)

    If you prefer Microsoft-format fidelity, install OnlyOffice Docs instead and use the onlyoffice Nextcloud app.

    Step 13: Configure External Storage (S3 and SMB)

    Nextcloud can mount external storage as if it were a local folder — useful for backups, archival, or integrating with existing file shares.

    Enable the external storage app:

    bash
    sudo -u www-data php occ app:install files_external
    sudo -u www-data php occ app:enable files_external

    S3-Compatible Storage (Backblaze B2, Wasabi, MinIO)

    In Nextcloud: Settings -> Administration -> External storage -> + Add storage -> pick "Amazon S3". Fill in:

    • Folder name: S3 Backup
    • Bucket: your bucket name
    • Hostname: s3.us-east-005.backblazeb2.com (or your provider)
    • Port: 443
    • Region: us-east-005
    • Enable SSL: checked
    • Enable Path Style: checked (required for non-AWS providers)
    • Access key and Secret key from your provider
    Nextcloud stores objects as files 1:1 on the remote bucket — no proprietary layer on top, so your data is portable.

    SMB/CIFS (Windows File Share, Samba, NAS)

    Install the SMB client libraries:

    bash
    sudo apt install -y smbclient libsmbclient-dev php8.3-smbclient
    sudo systemctl restart apache2

    Add an SMB mount in the same External storage panel: pick "SMB/CIFS", enter host, share name, and credentials. Supports both user-specific and admin-wide mounts.

    You can also use external storage for unlimited object-storage-backed primary storage: point Nextcloud's entire data directory at S3. See docs.nextcloud.com for the objectstore config block.

    Post-Install Hardening Checklist

    Run through each item before opening Nextcloud to end users.

    • Visit Admin -> Overview — every item should be green. Red or yellow warnings tell you exactly what to fix (missing indexes, outdated PHP modules, etc.).
    • Run database optimizations — speeds up large installs dramatically:
    bash
    sudo -u www-data php occ db:add-missing-indices
      sudo -u www-data php occ db:add-missing-columns
      sudo -u www-data php occ db:add-missing-primary-keys
      sudo -u www-data php occ db:convert-filecache-bigint
    • Enable brute-force protection — on by default, confirm via Admin -> Security.
    • Set password policy — Admin -> Security -> Password policy: require 12+ chars, mixed case, numbers.
    • Enable two-factor authentication — install twofactor_totp:
    bash
    sudo -u www-data php occ app:install twofactor_totp
    • Configure email (SMTP) — Admin -> Basic settings -> Email server. Required for password resets.
    • Set up backups — at minimum: nightly mysqldump + rsync of /var/nextcloud-data and /var/www/cloud.example.com/config/.
    • Update the system monthly — apt upgrade and occ upgrade after Nextcloud minor releases.

    Troubleshooting

    ProblemCauseSolution
    "Untrusted domain" error at loginDomain not in trusted_domainssudo -u www-data php occ config:system:set trusted_domains 1 --value=cloud.yourdomain.com
    Slow page loads, high CPUOPcache or Redis not configuredVerify opcache.enable=1 and that memcache.local is set to \OC\Memcache\APCu in config.php
    Internal Server Error after uploadPHP memory limit or upload size too lowRaise memory_limit to 1024M, upload_max_filesize to 16G in /etc/php/8.3/apache2/php.ini
    Cron status shows "Last run: never"Cron not configured or www-data crontab missingRun sudo crontab -u www-data -l to verify, manually test sudo -u www-data php -f /var/www/cloud.example.com/cron.php
    Files app shows "Storage is temporarily unavailable"Data directory permissionssudo chown -R www-data:www-data /var/nextcloud-data && sudo chmod 750 /var/nextcloud-data
    Talk video call connects then dropsTURN server unreachableCheck sudo ufw status — ensure 3478 udp+tcp open; verify coturn running: sudo systemctl status coturn
    "PHP does not seem to be setup properly to query system environment variables"CGI env not forwardedAdd SetEnv HOME /var/www/cloud.example.com and SetEnv HTTP_HOME /var/www/cloud.example.com inside the vhost
    occ commands fail with "Console has to be executed with the user that owns the file"Running as root instead of www-dataAlways prefix with sudo -u www-data

    Viewing Logs

    Nextcloud's application log:

    bash
    sudo tail -f /var/nextcloud-data/nextcloud.log

    Apache error log:

    bash
    sudo tail -f /var/log/apache2/cloud.example.com-error.log

    Use occ log:tail for a pretty-printed stream:

    bash
    sudo -u www-data php occ log:tail 50

    FAQ

    How many users can a single Nextcloud instance handle on CloudCore Professional?

    A CloudCore Professional VPS (6 vCPU, 12 GB RAM, 100 GB NVMe) comfortably handles 25-50 active users with Files, Calendar, Contacts, Talk chat, and occasional Collabora editing. The bottleneck is usually RAM: PHP-FPM workers + MariaDB buffer pool + Redis + Collabora Docker together consume 6-8 GB under load. For 100+ users, scale vertically to 24+ GB RAM or move Collabora to a dedicated VPS. Storage scales independently — attach block storage for hundreds of TB without touching the app tier.

    Can I migrate my Google Drive or Dropbox data into Nextcloud?

    Yes. Nextcloud includes a Migration app and supports several paths: use the official Nextcloud desktop client to drag a Google Drive/Dropbox export folder into your sync directory; mount Google Drive or Dropbox as External Storage and copy files inside Nextcloud; or use rclone on the server to pull directly from the source API and drop files into a user's folder (then run occ files:scan --all to register them). For Google Workspace teams, the integration_google app imports Drive files, contacts, calendars, and photos in one wizard.

    Do I need a separate server for Collabora Online?

    Not for small teams. Collabora in Docker on the same VPS adds roughly 1-2 GB RAM overhead and handles ~10 concurrent editors comfortably. Above that, CPU spikes during document rendering start to affect Nextcloud response times. Once you regularly see more than 10 users editing simultaneously, move Collabora to its own small VPS (EUR 8-12/month) and point Nextcloud at it via the reverse proxy URL. The split is painless — just change the Office server URL in Nextcloud admin.

    How does Nextcloud compare to self-hosted photo managers like Immich or PhotoPrism?

    Nextcloud is a generalist — it handles photos well via the Memories and Photos apps, including face recognition (with the recognize app), albums, and timeline view. However, dedicated photo platforms do specific things better: Immich has best-in-class mobile backup and a UI modeled on Google Photos; PhotoPrism has superior AI tagging and RAW workflow support. A common pattern is running all three: Nextcloud for files/groupware, Immich for day-to-day photo backup, PhotoPrism for archival libraries. They can share the same underlying storage via External Storage mounts if you want unified browsing.

    Is the Nextcloud update process safe, and how do I do it?

    Yes, when done correctly. For minor updates (e.g., 29.0.5 -> 29.0.6), the built-in updater in Admin -> Overview works reliably — it puts Nextcloud in maintenance mode, downloads the patch, backs up the old version, and runs the DB migrations. For major updates (e.g., 29 -> 30), use the command line: sudo -u www-data php updater/updater.phar. Always take a database dump and filesystem snapshot before a major upgrade. Never skip major versions — upgrade one at a time (29 -> 30 -> 31). Check the compatibility of third-party apps before upgrading; some apps lag by a release or two.

    What happens if I run out of disk space?

    Nextcloud handles out-of-space gracefully: uploads fail with a clear error, but existing files and the database stay intact. To expand: if your VPS provider supports live disk resize (CloudCore plans do), resize the root volume in the control panel, then sudo growpart + sudo resize2fs. Alternatively, mount additional block storage to /var/nextcloud-data-ext and use Nextcloud's External Storage to add it as a new mount, or use rclone mount to transparently extend primary storage with object storage. Set per-user quotas (Admin -> Users -> quota dropdown) to prevent any single account from exhausting the disk.

    Can I use Nextcloud as a complete Google Workspace replacement?

    Yes, for most workflows. Files replaces Drive, Collabora/OnlyOffice replaces Docs/Sheets/Slides, Mail replaces Gmail (you still need an IMAP mailbox elsewhere — pair with Mailcow or Mail-in-a-Box), Calendar replaces Google Calendar with full CalDAV sync, Contacts replaces Google Contacts via CardDAV, Talk replaces Meet and adds chat, Forms replaces Google Forms, and Deck replaces the Kanban side of Tasks/Keep. Gaps to be aware of: no direct Gmail-grade spam filtering (use Mailcow's Rspamd), no equivalent of Google Search across all your content (Nextcloud's full-text search is good but scoped per app), and the Admin Console is less polished than Google's. For 90% of small-team use cases the combination is more than adequate — and the EUR 19.99 flat fee beats Google Workspace's per-seat cost at any team size above 2.

    Next Steps

    Now that Nextcloud is running, here are recommended next steps to get the most out of your deployment:

    • Install the desktop and mobile clients — grab the official sync clients from nextcloud.com/install. Configure selective sync, virtual files (Windows/macOS), and auto-upload on mobile for camera roll backup.
    • Set up automated backups — combine mysqldump for the database with rsync or borgbackup for /var/nextcloud-data and config. Store off-site in an S3-compatible bucket.
    • Add LDAP or SAML SSO — install the user_ldap or user_saml apps to federate with Active Directory, Keycloak, or Authentik for enterprise identity.
    • Enable full-text search — install Elasticsearch and the fulltextsearch_elasticsearch app so users can search inside PDFs, Office documents, and text files.
    • Deploy a dedicated photo manager alongside — pair Nextcloud with Immich for best-in-class photo backup, or PhotoPrism for AI-powered photo library management.
    • Upgrade document editing — if Collabora's LibreOffice engine is not enough, switch to OnlyOffice for closer Microsoft Office format fidelity.
    • Read the official admin manual — docs.nextcloud.com is the canonical reference for every admin command, config value, and troubleshooting scenario.

    Ready to self-host your cloud?
    >
    Deploy Nextcloud on a CloudCore Professional VPS — 6 vCPU, 12 GB RAM, 100 GB NVMe, unmetered bandwidth, EUR 19.99/month. Full root access, 24/7 support, and EU-hosted data sovereignty out of the box.
    >
    Launch your CloudCore VPS now and take ownership of your files, calendar, and team communication in under an hour.

    Was this article helpful?

    ← Back to Install GuidesBrowse all categories →

    Still have questions?

    Contact Support →Submit a Ticket