OpenBSD Handbook

    Theme
    • Part I. Install & Configure
      • Introduction to OpenBSD
      • Installing OpenBSD
      • The X Window System
      • Networking on OpenBSD
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • OpenBSD Desktop Environments
      • Multimedia
      • Printing
      • Linux Compatibility
      • Windows Compatibility
      • Games
    • Part III. System Administration
      • Virtualization
      • Storage and File Systems
      • Updating and Upgrading
      • Localization
      • The OpenBSD Boot Process
      • Security
    • Part IV. Networking & Daemons
      • Services
        • Database
          • MariaDB
          • PostgreSQL
          • Redis
          • memcached
        • Directory
          • YP (NIS)
          • LDAP
        • File
          • NFS
          • Samba
        • FTP Services
          • ftpd
          • ProFTPD
          • vsftpd
          • Pure-FTPd
          • TFTP
        • Mail
          • OpenSMTPD Mail Server
          • Dovecot IMAP and POP3 Server
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound DNS Resolver
          • NSD Authoritative DNS Server
          • BIND DNS Server
        • Networking
          • OpenBGPD
          • rad
          • DHCP on OpenBSD
          • slaacd
        • Web
          • Apache HTTP Server
          • nginx Web Server
          • OpenBSD httpd Web Server
          • relayd Reverse Proxy
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • OpenSSH Server
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ Message Broker
        • Time
          • NTP Time Synchronization
      • PF
        • pfctl cheat sheet
        • PF Anchors
        • PF Filter Rules
        • PF Forwarding
        • PF Lists and Macros
        • PF Load Balancing
        • PF Logging
        • PF NAT
        • PF Options
        • PF Policies
        • PF Shortcuts
        • PF Tables
      • Advanced Networking
        • High Availability and State Replication
        • Multi-WAN and Policy-Based Routing
        • VPN and Cryptographic Tunneling
        • Classic and Lightweight Tunnels
        • IPv6 at Scale
        • QoS and Traffic Shaping
        • MPLS and Label Distribution
        • Network Services at Scale
        • Virtualization and Host Networking
        • Large-Scale L2 and L3 Design
        • Telemetry, Logging, and Flow Export
        • Hardening and Operational Safety
        • Reference Architectures
        • Troubleshooting Playbooks
      • Serial Communication
    • Part V. Miscellaneous
      • Virtualization Cheat Sheet
      • OpenBSD Cheatsheet
      • How-to Guides
        • Complete the First 30 Minutes After Installation
        • Check Hardware Compatibility Before Installing
        • Bootstrap Wi-Fi Firmware Without Ethernet
        • Set Up OpenBSD as a Laptop or Workstation
        • Configure Laptop Power Management
        • Run OpenBSD as a Virtual Machine Guest
        • Install OpenBSD on a VPS or Cloud Server
        • Install OpenBSD with Full-Disk Encryption
        • Troubleshoot Web Browsers on OpenBSD
        • Create an Administrator Account with doas and SSH Keys
        • Establish a Conservative Security Baseline
        • Manage OpenBSD with Ansible
        • Recover Access and Reset the Root Password
        • Collect OpenBSD Diagnostic Evidence
        • Configure Secure Remote Access with OpenSSH
        • Set Up WordPress on OpenBSD
        • Build Third-Party Software from Ports
        • Use FIDO Security Keys with OpenSSH
        • Build OpenBSD from Source
        • Configure Wi-Fi Roaming and Wired Failover
        • Dual-Boot OpenBSD on a UEFI System
        • Troubleshoot PF, NAT, and Routing
        • Automate OpenBSD Installation with Autoinstall and PXE
        • Route Multiple VLANs with PF
        • Configure a Road-Warrior WireGuard VPN
        • Troubleshoot Package Installation and Update Failures
        • Route IPv6 Networks without NAT
        • Schedule Recurring Maintenance
        • Plan a Docker Workload Migration to OpenBSD
        • Build a Mail Server with OpenSMTPD, Dovecot, and Rspamd
        • Build a Simple Router and Firewall
        • Monitor an OpenBSD System
        • Back Up and Restore an OpenBSD System
        • Configure softraid RAID1
        • Recover an OpenBSD System That Does Not Boot
        • Install Z shell (zsh)
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • OpenBSD FAQ
    • OpenBSD Architectures
      • OpenBSD Package Search

        nextcloud-35.0.0p0

        Package search / Categories / Current snapshot
        โ† Back to search
        OpenBSD branch
        OpenBSD 7.9 release (unavailable)Current snapshot

        Current snapshot ยท amd64

        easy and universal access to shared and/or personal files

        Project homepage: https://nextcloud.com/

        Description

        Access, share and protect your files, calendars, contacts, communication & more at home and in your enterprise

        Package information

        Ports path
        www/nextcloud/35
        Package architecture
        *
        Maintainer
        Gonzalo L. R. <gonzalo@openbsd.org>
        Categories
        www, lang/php
        Available flavors
        None listed

        Ports list build and test dependencies as well as runtime dependencies. pkg_add selects those needed for installation.

        Direct dependencies

        Runtime

        • lang/php/8.4,-gd
        • lang/php/8.4,-zip
        • lang/php/8.4,-pdo_sqlite php-pdo_sqlite->=8.4,<8.5|php-pdo_mysql->=8.4,<8.5|php-pdo_pgsql->=8.4,<8.5
        • lang/php/8.4,-curl
        • lang/php/8.4,-bz2
        • lang/php/8.4,-intl
        • databases/pecl-redis,php84
        • graphics/pecl-imagick,php84
        • lang/php/8.4 php->=8.4,<8.5

        Build

        • archivers/bzip2
        OpenBSD README

        This README contains unresolved ports variables; replace them before using its commands.

        +-----------------------------------------------------------------------
        | Running nextcloud on OpenBSD
        +-----------------------------------------------------------------------
        
        Nextcloud is installed under
            ${TINSTDIR}
        
        Official documentation is available at:
            https://docs.nextcloud.com/server/${MAJOR}/admin_manual/
        
        Post-installation instructions
        ==============================
        
        *** It is highly recommended to use SSL on the webserver (HTTPS).
        
        chroot(2)
        ---------
        When running Nextcloud under a chrooted environment, make sure to read the
        "PHP's OpenSSL functions" section of:
            ${LOCALBASE}/share/doc/pkg-readmes/php-${MODPHP_VERSION}
        
        The HTTP server must be able to resolve hostnames:
            # mkdir -p /var/www/etc
            # cp /etc/resolv.conf /var/www/etc
        
        The configuration of an SQLite database path is set relatively to the chroot in
        Nextcloud which will break background jobs run by cron(8) (see below).
        A symlink can be created to workaround this issue:
            # ln -sf ${TINSTDIR} /nextcloud
        
        This also means that you must specify "--data-dir" during occ installation.
            # cd /nextcloud
            # doas -u www php occ maintenance:install --data-dir "/nextcloud/data"
        
        OpenBSD HTTP daemon
        -------------------
        httpd(8) example configuration for Nextcloud:
        
        ---8<---------------------------------------------------------------------------
        server "domain.tld" {
        	listen on egress tls port 443
        
        	hsts max-age 15768000
        
        	tls {
        		certificate "/etc/ssl/domain.tld_fullchain.pem"
        		key "/etc/ssl/private/domain.tld_private.pem"
        	}
        
        	# Set max upload size to 513M (in bytes)
        	connection max request body 537919488
        	connection max requests 1000
        	connection request timeout 3600
        	connection timeout 3600
        
        	block drop
        
        	# only allow well-known and required php files for fastcgi
        	# required for the webpage to work
        	location "/nextcloud/index.php*" {
        		root "/nextcloud"
        		request strip 1
        		fastcgi socket "/run/php-fpm.sock"
        		pass
        	}
        
        	location "/nextcloud/public.php*" {
        		root "/nextcloud"
        		request strip 1
        		fastcgi socket "/run/php-fpm.sock"
        		pass
        	}
        
        	# required for caldav and carddav
        	location "/nextcloud/remote.php*" {
        		root "/nextcloud"
        		request strip 1
        		fastcgi socket "/run/php-fpm.sock"
        		pass
        	}
        
        	# required for the sync app
        	location "/nextcloud/status.php" {
        		root "/nextcloud"
        		request strip 1
        		fastcgi socket "/run/php-fpm.sock"
        		pass
        	}
        
        	location "/nextcloud/ocs/*.php*" {
        		root "/nextcloud"
        		request strip 1
        		fastcgi socket "/run/php-fpm.sock"
        		pass
        	}
        
        	location "/nextcloud/ocs-provider/*.php*" {
        		root "/nextcloud"
        		request strip 1
        		fastcgi socket "/run/php-fpm.sock"
        		pass
        	}
        
        	location "/nextcloud/apps/*" {
        		root "/nextcloud"
        		request strip 1
        		pass
        	}
        
        	location "/nextcloud/dist/*" {
        		root "/nextcloud"
        		request strip 1
        		pass
        	}
        
        	location "/nextcloud/core/*" {
        		root "/nextcloud"
        		request strip 1
        		pass
        	}
        
        	location "/nextcloud" {
        		root "/nextcloud"
        		request strip 1
        		pass
        	}
        
        	location "/nextcloud/" {
        		root "/nextcloud"
        		request strip 1
        		pass
        	}
        
        	location "/.well-known/carddav" {
        		block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
        	}
        
        	location "/.well-known/caldav" {
        		block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
        	}
        
        	location "/.well-known/webfinger" {
        		block return 301 "https://$SERVER_NAME/nextcloud/public.php?service=webfinger"
        	}
        
        	location match "/nextcloud/oc[ms]%-provider/*" {
        		directory index index.php
        		pass
        	}
        }
        ---8<---------------------------------------------------------------------------
        
        nginx
        -----
        See:
            https://docs.nextcloud.com/server/${MAJOR}/admin_manual/installation/nginx.html
        
        Apache HTTPD
        ------------
        Apache configuration for Nextcloud is stored under:
            ${TRUEPREFIX}/conf/modules.sample/apache-nextcloud.conf
        
        It needs to be enabled by running the following command after the apache-httpd
        package is installed:
        # ln -s ../modules.sample/apache-nextcloud.conf ${TRUEPREFIX}/conf/modules
        # rcctl restart apache2
        
        The rewrite_module needs to be enabled by uncommenting the following line in
        ${SYSCONFDIR}/apache2/httpd2.conf:
            #LoadModule rewrite_module /usr/local/lib/apache2/mod_rewrite.so
        
        PHP
        ---
        Default PHP values for Apache are set under:
            ${TINSTDIR}/.htaccess
            ${TINSTDIR}/config/.htaccess
        
        OpenBSD HTTP daemon users can match these .htaccess file values by editing
        ${SYSCONFDIR}/php-${MODPHP_VERSION}.ini or ${SYSCONFDIR}/php-fpm.conf.
        
        nginx users can match these .htaccess file values by configuring fastcgi_param
        with a PHP_VALUE in ${SYSCONFDIR}/nginx/nginx.conf.
        
        For enhanced performance, a PHP opcode cache can be used (built-in to PHP 5.5+,
        enable "opcache.ini" to use it).
        Recommended values for ${SYSCONFDIR}/php-${MODPHP_VERSION}.ini:
        opcache.enable=1
        opcache.enable_cli=1
        opcache.interned_strings_buffer=8
        opcache.max_accelerated_files=10000
        opcache.memory_consumption=128
        opcache.save_comments=1
        opcache.revalidate_freq=1
        
        Database configuration
        ----------------------
        See the following URL for setting up a database for Nextcloud:
            https://docs.nextcloud.com/server/${MAJOR}/admin_manual/configuration_database/linux_database_configuration.html
        
        Nextcloud can work with a PostgreSQL, MariaDB or SQLite3 database. The
        corresponding package needs to be installed *before* setting up Nextcloud:
            php-pdo_sqlite, php-pdo_pgsql or php-pdo_mysql
        
        Configuration file
        ------------------
        Configuration is done under:
            ${TINSTDIR}/config/config.php
        and the default "datadirectory" is set to:
            ${TINSTDIR}/data
        When running chrooted, ${TRUEPREFIX} must be stripped from the paths.
        
        Cron job
        --------
        Nextcloud needs to run background jobs on a regular basis. By default, it will
        execute one task with each page loaded ("AJAX" option in the admin interface).
        The prefered way is to use a cron(8) job instead.
        (see https://<hostname>/nextcloud/index.php/settings/admin#backgroundjobs)
        e.g.
        */15	*	*	*	*	su -m www -c "${MODPHP_BIN} -f ${TINSTDIR}/cron.php"
        
        Memory caching and file locking
        -------------------------------
        Nextcloud server performance can be significantly improved with memory caching
        and memory-based locking. Distributed caching and Transactional File Locking is
        provided by Redis, an in-memory data structure store. More information and
        configuration example are available at:
            https://docs.nextcloud.com/server/${MAJOR}/admin_manual/configuration_server/caching_configuration.html#id4
        
        TL;DR
        You need a redis server running (available in the redis package) then adapt and
        append the following to:
            ${TINSTDIR}/config/config.php
        
          'filelocking.enabled' => true,
          'memcache.local' => '\OC\Memcache\Redis',
          'memcache.locking' => '\OC\Memcache\Redis',
          'redis' => array(
            'host' => 'localhost',
            'port' => 6379,
            'timeout' => 0.0,
            'password' => '', // Optional, if not defined no password will be used.
          ),
        
        Authentication backends
        -----------------------
        When using a non-default user authentication backend (LDAP, IMAP, ...), extra
        packages may be needed (e.g. php-ldap, php-imap).
        
        Finishing and validating the installation
        -----------------------------------------
        Make sure the web server can resolve its hostname (e.g. if chrooted, by creating
        ${TRUEPREFIX}/etc/hosts and/or ${TRUEPREFIX}/etc/resolv.conf).
        
        Create the file "CAN_INSTALL" to allow web-based installation:
        
            # touch ${TINSTDIR}/config/CAN_INSTALL
        
        Accessing https://<hostname>/nextcloud with a Web browser will finish the
        installation and create a new admin user.
        
        Updating
        ========
        Before updating to a new release, read:
            https://docs.nextcloud.com/server/${MAJOR}/admin_manual/maintenance/upgrade.html
        
        Nextcloud updates are only supported from one major version to the
        next (30->31, 31->32, etc) and the release schedule does not align
        nicely with OpenBSD's.
        
        To avoid an unsupported upgrade path, be sure to update to the highest
        available Nextcloud major version before upgrading to a new OpenBSD
        release. First update to the most recent package for the major version
        that you're using ("pkg_add -u" and, if there was an update, "doas -u
        www /var/www/nextcloud/occ upgrade"), then to move to a newer major
        version, "pkg_add -r nextcloud", choosing the next major version from
        the list. Follow any steps required for the nextcloud update, then
        repeat if necessary until you're on the newest available version.
        
        WebDAV access
        =============
        The personal WebDAV share can be accessed using the following URL (e.g. with
        Nautilus, Thunar or Doplhin) and the corresponding user and password for the
        share:
            https://<hostname>/nextcloud/remote.php/webdav/
        
        Synchronization
        ===============
        The "nextcloudclient" package (net/nextcloudclient) is a graphical (Qt)
        application to synchronize with a Nextcloud server.
        
        Apps and dependencies
        =====================
        To keep dependencies to a minimum, not all dependencies for all installed apps
        are enforced. It is the job of the administrator to manually install required
        packages according to the non-default apps (s)he wants to enable.
        

        Package guides

        • Installing and updating packages

        Package details as JSON

        Report a bug