### Install Nextcloud Client with Specific Features (Whitelist) Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Installs the Nextcloud client, explicitly enabling only the Start Menu shortcuts in addition to the required client. Use this to define a precise set of features. ```bash msiexec /passive /i Nextcloud-x.y.z-x64.msi ADDDEFAULT=StartMenuShortcuts ``` -------------------------------- ### Quick Start Docker Installation Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/installation_docker.html Run the Euro-Office Document Server Docker image with basic configuration. Ensure JWT authentication is enabled and set a strong secret. ```bash docker run -d \ --name euro-office \ --restart=unless-stopped \ -p 80:80 \ -e JWT_ENABLED=true \ -e JWT_SECRET=your-secret \ ghcr.io/euro-office/documentserver:latest ``` -------------------------------- ### Install Nextcloud Production VM Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html Execute this script to install Nextcloud in a production environment using the Nextcloud VM. Follow the on-screen instructions for a guided setup. ```bash sudo bash nextcloud_install_production.sh ``` -------------------------------- ### Example: Convert to MariaDB/MySQL Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/db_conversion.html Example command to convert an existing SQLite installation to MariaDB/MySQL. It specifies the password, port, includes all apps for conversion, and provides the username, hostname, and database name. ```bash sudo -E -u www-data php occ db:convert-type --password="" --port="3306" --all-apps mysql nextcloud ``` -------------------------------- ### Install Nextcloud PI Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html Run this script to install Nextcloud using the NextcloudPI setup. The process includes a guided setup where you follow on-screen instructions. ```bash sudo bash install.sh ``` -------------------------------- ### Enable and Start Apache Service Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_centos.html Enables the Apache web service to start on boot and starts the service immediately. ```bash systemctl enable httpd.service systemctl start httpd.service ``` -------------------------------- ### Install Nextcloud with MySQL Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_system.html Installs Nextcloud using a MySQL database with specified credentials and admin user setup. This command is run only before the initial installation. ```bash sudo -E -u www-data php occ maintenance:install \ --database mysql \ --database-name nextcloud \ --database-host 127.0.0.1 \ --database-user nextcloud \ --database-pass secret \ --admin-user admin \ --admin-pass password ``` -------------------------------- ### Enable and Start httpd Service Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_openbsd.html Enables the httpd service to start on boot and starts the httpd service immediately. ```shell # rcctl enable httpd # rcctl start httpd ``` -------------------------------- ### Display Installation Options Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_system.html Displays the available installation options for Nextcloud. This command is used before Nextcloud has been installed. ```bash sudo -E -u www-data php /var/www/nextcloud/occ maintenance:install --help ``` -------------------------------- ### Install Prerequisites Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/installation_debian.html Install essential services like PostgreSQL, Redis, RabbitMQ, Nginx, and Supervisor using apt-get. ```bash sudo apt-get install -y postgresql redis-server rabbitmq-server nginx supervisor ``` -------------------------------- ### Install Prerequisites Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/installation_ubuntu.html Installs PostgreSQL, Redis, RabbitMQ, Nginx, and Supervisor required for Euro-Office Document Server. ```bash sudo apt-get update sudo apt-get install -y postgresql redis-server rabbitmq-server nginx supervisor ``` -------------------------------- ### Nextcloud Client Wizard Preconfiguration (Windows) Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Preconfigure the Nextcloud client's account setup wizard on Windows by specifying local directory and server URL. This guides the user through the interactive setup. ```bash "C:\Program Files\Nextcloud\nextcloud.exe" --overridelocaldir "D:/work/nextcloud-sync-folder" --overrideserverurl https://cloud.example.com ``` -------------------------------- ### Install Nextcloud Client with Default Features Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Installs the Nextcloud client with all default features enabled in the default installation directory. Use this for standard automated deployments. ```bash msiexec /passive /i Nextcloud-x.y.z-x64.msi ``` -------------------------------- ### Install Euro-Office Document Server Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/installation_debian.html Install the downloaded .deb package using apt-get. This process may take a few minutes. ```bash sudo apt-get install -y /tmp/euro-office-documentserver.deb ``` -------------------------------- ### Enable and Start MariaDB Service Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_centos.html Configures the MariaDB service to start automatically on boot and then starts the service. ```bash systemctl enable mariadb.service systemctl start mariadb.service ``` -------------------------------- ### Example PHP-FPM Configuration for Dynamic Mode Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html A recommended starting configuration for PHP-FPM in dynamic mode, suitable for servers with 2 GB of RAM dedicated to PHP. Adjust `pm.max_children` based on measured worker RSS. ```ini pm = dynamic pm.max_children = 30 pm.start_servers = 8 pm.min_spare_servers = 4 pm.max_spare_servers = 16 pm.max_requests = 500 ``` -------------------------------- ### Enable and Start Redis on OpenBSD Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_openbsd.html Enables the Redis service to start on boot and starts the Redis service immediately. This is a prerequisite for using Redis as a memcache for Nextcloud. ```bash # rcctl enable redis # rcctl start redis ``` -------------------------------- ### Install Nextcloud Snap Source: https://docs.nextcloud.com/server/latest/admin_manual/maintenance/package_upgrade.html Installs the Nextcloud snap package on Ubuntu systems. ```bash sudo snap install nextcloud ``` -------------------------------- ### Basic Multibucket Object Store Setup Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html Configure Nextcloud to use multiple buckets for scalability by setting 'multibucket' to true in the object store configuration. This example shows the basic arguments including the number of buckets and the bucket name prefix. ```php 'objectstore' => [ 'class' => 'Object\\Storage\\Backend\\Class', 'arguments' => [ 'multibucket' => true, // optional, defaults to 64 'num_buckets' => 64, // will be postfixed by an integer in the range from 0 to (num_nuckets-1) 'bucket' => 'nextcloud_', ... ], ], ``` -------------------------------- ### Run OCC Setup Checks Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_system.html Execute the setup checks command to verify your Nextcloud installation configuration. Use `--output=json_pretty` for machine-readable output, `--class` to target a specific check, or `--category` to filter by a group of checks. ```bash sudo -E -u www-data php occ setupchecks ``` -------------------------------- ### Hierarchical Configuration Example (config.php) Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_apps.html Illustrates the structure of hierarchical configuration data as it would appear in the config.php file, using Redis as an example. ```php 'redis' => array( 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'dbindex' => 0, 'password' => 'secret', 'timeout' => 1.5, ) ``` -------------------------------- ### Pre-seed Installer Answers Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/installation_debian.html Use debconf-set-selections to provide answers to the installer's prompts, including database configuration. ```bash echo "ds ds/db-type select postgres ds ds/db-host string localhost ds ds/db-port string 5432 ds ds/db-user string ds ds ds/db-pwd password ds ds ds/db-name string ds" | sudo debconf-set-selections ``` -------------------------------- ### Install Nextcloud Client Excluding Desktop Shortcut Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Installs the Nextcloud client while disabling the creation of a desktop shortcut. Useful for cleaner desktop environments in automated setups. ```bash msiexec /passive /i Nextcloud-x.y.z-x64.msi REMOVE=DesktopShortcut ``` -------------------------------- ### Get Nextcloud Installation Status (JSON) Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_system.html Obtain machine-readable output for the Nextcloud installation status by using the `--output=json_pretty` flag with the `status` command. This is ideal for scripting and automated checks. ```bash sudo -E -u www-data php occ status --output=json_pretty ``` -------------------------------- ### Nextcloud Client Wizard Preconfiguration (Linux/macOS) Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Preconfigure the Nextcloud client's account setup wizard on Linux or macOS by specifying local directory and server URL. This guides the user through the interactive setup. ```bash nextcloud --overridelocaldir "/home//nextcloud-sync-folder" --overrideserverurl https://cloud.example.com ``` -------------------------------- ### Nextcloud MySQL Configuration Example Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html Example configuration entries for a Nextcloud instance using a MySQL database. ```php "mysql", "dbname" => "nextcloud", "dbuser" => "username", "dbpassword" => "password", "dbhost" => "localhost", "dbtableprefix" => "oc_", ``` ```php "mysql.utf8mb4" => true, ``` -------------------------------- ### Register Manual Install Deploy Daemon with HaRP Source: https://docs.nextcloud.com/server/latest/admin_manual/exapps_management/ManagingDeployDaemons.html Registers a deploy daemon for manual installations with HaRP support. This setup proxies requests to a manually launched ExApp process and requires specific network configurations for HaRP communication. ```bash app_api:daemon:register manual_install_harp "Harp Manual Install" "manual-install" "http" "appapi-harp:8780" "http://nextcloud.local" --net nextcloud --harp --harp_frp_address "appapi-harp:8782" --harp_shared_key "some_very_secure_password" ``` -------------------------------- ### Configure PostgreSQL Database for Automatic Setup Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/automatic_configuration.html Set up parameters for a PostgreSQL database in `autoconfig.php`. The setup screen will then prompt for the data directory and admin credentials. ```php "pgsql", "dbname" => "nextcloud", "dbuser" => "username", "dbpass" => "password", "dbhost" => "localhost", "dbtableprefix" => "", ); ``` -------------------------------- ### Install Nextcloud Package Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_openbsd.html Installs the Nextcloud package on an OpenBSD system. ```shell # pkg_add nextcloud ``` -------------------------------- ### Enable and Start PHP-FPM Service Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_openbsd.html Use rcctl to enable the PHP-FPM service to start on boot and then start the service immediately. ```shell # rcctl enable php82_fpm # rcctl start php82_fpm ``` -------------------------------- ### Install a Nextcloud App Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_apps.html Downloads and installs a specified app. Ensure you have the necessary permissions and the app is compatible. ```bash sudo -E -u www-data php occ app:install twofactor_totp ``` -------------------------------- ### Install Nextcloud Client to a Custom Directory Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Installs the Nextcloud client to a specified custom directory. This is only applicable during the initial installation and cannot be changed later without reinstallation. ```bash msiexec /passive /i Nextcloud-x.y.z-x64.msi INSTALLDIR="C:\Program Files\Non Standard Nextcloud Client Folder" ``` -------------------------------- ### Enable Nextcloud Web Installer Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_openbsd.html Creates the CAN_INSTALL file in Nextcloud's config directory to activate the web-based installation wizard. ```bash # touch /var/www/nextcloud/config/CAN_INSTALL ``` -------------------------------- ### Install Apache Modules for Reverse Proxy Source: https://docs.nextcloud.com/server/latest/admin_manual/office/example-docker.html Installs Apache and necessary modules (proxy, proxy_wstunnel, proxy_http, ssl) required for setting up a reverse proxy. ```bash apt-get install apache2 a2enmod proxy proxy_wstunnel proxy_http ssl ``` -------------------------------- ### Configure SQLite Database for Automatic Setup Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/automatic_configuration.html Set up parameters for an SQLite database in `autoconfig.php`. The setup screen will then prompt for the data directory and admin credentials. ```php "sqlite", "dbname" => "nextcloud", "dbtableprefix" => "", ]; ``` -------------------------------- ### List All Installed Apps Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_apps.html Lists all installed apps and their current status (enabled or disabled). ```bash sudo -E -u www-data php occ app:list ``` -------------------------------- ### Indicate Installation Status Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html Sets the 'installed' parameter to false. This indicates whether the Nextcloud instance was installed successfully. Defaults to false. ```php 'installed' => false, ``` -------------------------------- ### Configure MySQL Database for Automatic Setup Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/automatic_configuration.html Configure parameters for a MySQL database using `autoconfig.php`. The setup screen will then prompt for the data directory and admin credentials. ```php "mysql", "dbname" => "nextcloud", "dbuser" => "username", "dbpass" => "password", "dbhost" => "localhost", "dbtableprefix" => "", ); ``` -------------------------------- ### Launch Nextcloud Client Automatically After Installation Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Configures the Nextcloud client to launch automatically immediately after the installation process completes. This option also hides the launch checkbox in GUI installers. ```bash msiexec /i Nextcloud-x.y.z-x64.msi LAUNCH="1" ``` -------------------------------- ### Install Only the Nextcloud Client Feature Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Installs only the core Nextcloud client application, excluding any additional features like shortcuts or shell extensions. Use when minimal installation is required. ```bash msiexec /passive /i Nextcloud-x.y.z-x64.msi ADDDEFAULT=Client ``` -------------------------------- ### Manage PostgreSQL Service Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_openbsd.html Check the status of the PostgreSQL service, enable it to start on boot, and then start the service using rcctl. ```shell # rcctl check postgresql # rcctl enable postgresql # rcctl start postgresql ``` -------------------------------- ### Install Redis Server Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_centos.html Installs the Redis in-memory data structure store and server, which can be used for caching in Nextcloud. ```bash dnf install -y redis systemctl enable redis.service systemctl start redis.service ``` -------------------------------- ### Get Single Configuration Value Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_apps.html Retrieves the value of a specific app or system configuration setting. Examples show getting the Nextcloud version and an app's installed version. ```bash sudo -E -u www-data php occ config:system:get version 19.0.0.12 ``` ```bash sudo -E -u www-data php occ config:app:get activity installed_version 2.2.1 ``` -------------------------------- ### Instance ID Configuration Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html The 'instanceid' parameter is a unique identifier for your Nextcloud installation, automatically generated during setup. This example is for documentation purposes only and should not be used in a live environment. ```php 'instanceid' => '', ``` -------------------------------- ### Install Euro-Office Connector App using occ Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/configuration.html Use the occ command to install the Euro-Office app from the command line. Ensure you have the necessary permissions. ```bash sudo -E -u www-data php occ app:install eurooffice ``` -------------------------------- ### Get Nextcloud Installation Status (Exit Code) Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_system.html Use the `-e` flag with the `status` command to get a machine-readable exit code reflecting the installation state. This is useful for monitoring and systemd units, as it produces no output by default. ```bash sudo -E -u www-data php occ status -e echo $? ``` -------------------------------- ### Install ClamAV on Debian/Ubuntu Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/antivirus_configuration.html Installs ClamAV and its daemon on Debian, Ubuntu, and Linux Mint systems. The installer automatically sets up configuration files and starts the necessary daemons. ```bash apt-get install clamav clamav-daemon ``` -------------------------------- ### Example Log Entries Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html These are example log entries demonstrating the structure and common fields found in Nextcloud logs. ```json { "reqId":"TBsuA2uE86DiOD0S8f9j", "level":1, "time":"April 13, 2021 16:55:37", "remoteAddr":"192.168.56.1", "user":"admin", "app":"admin_audit", "method":"GET", "url":"/ocs/v1.php/cloud/users?disabled", "message":"Login successful: \"admin\"", "userAgent":"curl/7.68.0", "version":"21.0.1.1" } { "reqId":"ByeDVLuwkXKMfLpBgvxC", "level":2, "time":"April 14, 2021 09:03:29", "remoteAddr":"192.168.56.1", "user":"--", "app":"no app in context", "method":"POST", "url":"/login", "message":"Login failed: asdf (Remote IP: 192.168.56.1)", "userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36", "version":"21.0.1.1" } ``` -------------------------------- ### Get Help for OCC Command Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html Use the `help` command followed by a specific command name to get detailed usage information and available options. This example shows how to get help for the `maintenance:mode` command. ```bash sudo -E -u www-data php occ help maintenance:mode Usage: maintenance:mode [options] Options: --on enable maintenance mode --off disable maintenance mode -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question --no-warnings Skip global warnings, show command output only -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug ``` -------------------------------- ### Complete Automatic Configuration with All Parameters Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/automatic_configuration.html Provide all necessary parameters in `autoconfig.php` to bypass the Nextcloud "Finish setup" screen entirely. ```php "mysql", "dbname" => "nextcloud", "dbuser" => "username", "dbpass" => "password", "dbhost" => "localhost", "dbtableprefix" => "", "adminlogin" => "root", "adminpass" => "root-password", "directory" => "/www/htdocs/nextcloud/data", ); ``` -------------------------------- ### Install Additional Packages Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_openbsd.html Installs necessary additional packages for Nextcloud, including PostgreSQL, Redis, and PHP extensions. ```shell # pkg_add postgresql-server redis pecl82-redis php-pdo_pgsql ``` -------------------------------- ### Nextcloud Subdirectory Installation Configuration Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html This Nginx configuration is for Nextcloud installed in a subdirectory (e.g., /nextcloud) within the webroot. It includes PHP-FPM setup and SSL/TLS configuration. ```nginx # Nextcloud nginx configuration — subdirectory installation (/nextcloud) # Version 2026-06-09 # PHP-FPM backend. upstream php-handler { # Use one of the options below, not both: server 127.0.0.1:9000; #server unix:/run/php/php8.2-fpm.sock; } # Set the `immutable` cache control options only for assets with a cache busting `v` argument map $arg_v $asset_immutable { "" ""; default ", immutable"; } server { listen 80; listen [::]:80; server_name cloud.example.com; # Prevent nginx HTTP Server Detection server_tokens off; # Enforce HTTPS just for `/nextcloud` location /nextcloud { return 301 https://$server_name$request_uri; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; # With NGinx >= 1.25.1 you should use this instead: # listen 443 ssl; # listen [::]:443 ssl; # http2 on; server_name cloud.example.com; # Path to the root of the domain root /var/www; # Use Mozilla's guidelines for SSL/TLS settings # https://mozilla.github.io/server-side-tls/ssl-config-generator/ ssl_certificate /etc/ssl/nginx/cloud.example.com.crt; ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key; # Prevent nginx HTTP Server Detection server_tokens off; # Set .mjs and .wasm MIME types # Either include it in the default mime.types list # and include that list explicitly or add the file extension # only for Nextcloud like below: include mime.types; types { text/javascript mjs; # uncomment below for Nginx <= 1.21.0 # application/wasm wasm; } location = /robots.txt { allow all; log_not_found off; access_log off; } location ^~ /.well-known { # The rules in this block are an adaptation of the rules # in the Nextcloud `.htaccess` that concern `/.well-known`. location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; } location = /.well-known/caldav { return 301 /nextcloud/remote.php/dav/; } location /.well-known/acme-challenge { try_files $uri $uri/ =404; } location /.well-known/pki-validation { try_files $uri $uri/ =404; } # Let Nextcloud's API for `/.well-known` URIs handle all other # requests by passing them to the front-end controller. return 301 /nextcloud/index.php$request_uri; } ``` -------------------------------- ### Start Manual Upgrade Process Source: https://docs.nextcloud.com/server/latest/admin_manual/maintenance/manual_upgrade.html Execute this command to initiate the manual upgrade process after stopping a stuck web-based upgrade. ```bash sudo -E -u www-data php occ upgrade ``` -------------------------------- ### Configure Apache for Nextcloud Subfolder or Root Installation Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html Use these Apache configurations for Nextcloud installations either in a subfolder or at the root of your domain. Ensure 'overwrite.cli.url' and 'htaccess.RewriteBase' are set correctly for your setup. ```apache 'overwrite.cli.url' => 'https://example.org/', 'htaccess.RewriteBase' => '/', ``` -------------------------------- ### Docker Installation with Persistent Data Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/installation_docker.html Install the Euro-Office Document Server Docker image while mounting volumes for documents, logs, and configuration to ensure data persistence. ```bash docker run -d \ --name euro-office \ --restart=unless-stopped \ -p 80:80 \ -e JWT_ENABLED=true \ -e JWT_SECRET=your-secret \ -v /path/to/data:/var/lib/euro-office/documentserver \ -v /path/to/logs:/var/log/euro-office/documentserver \ -v /path/to/config:/etc/euro-office/documentserver \ ghcr.io/euro-office/documentserver:latest ``` -------------------------------- ### Example: Log Data for Two Days to a Directory Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/troubleshooting.html An example configuration to retain log data for 48 hours in a directory named 'C:/Temp'. Ensure path separators are forward slashes. ```ini [General] logDebug=true logExpire=48 logDir=C:/Temp ``` -------------------------------- ### Install Core PHP Modules on CentOS Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_centos.html Installs essential PHP modules for a basic Nextcloud server setup, including CLI, gd, mbstring, intl, apcu, mysqlnd, opcache, json, and zip. ```bash dnf install -y php php-cli php-gd php-mbstring php-intl php-pecl-apcu\ php-mysqlnd php-opcache php-json php-zip ``` -------------------------------- ### Nextcloud config.php with SQLite Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html Example of a typical config.php file for a Nextcloud installation using SQLite as the database. The SQLite database is stored within the Nextcloud data directory. This configuration is suitable for testing and simple installations. ```php 'occ6f7365735', 'passwordsalt' => '2c5778476346786306303', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'studio', ), 'datadirectory' => '/var/www/nextcloud/data', 'dbtype' => 'sqlite3', 'version' => '7.0.2.1', 'installed' => true, ); ``` -------------------------------- ### Manual-Install resolveExAppUrl Implementation Source: https://docs.nextcloud.com/server/latest/admin_manual/exapps_management/DeployConfigurations.html A simple implementation of `resolveExAppUrl` for the Manual-Install deploy type, handling HARP communication. ```php public function resolveExAppUrl( string $appId, string $protocol, string $host, array $deployConfig, int $port, array &$auth ): string { if (boolval($deployConfig['harp'] ?? false)) { $url = rtrim($deployConfig['nextcloud_url'], '/'); if (str_ends_with($url, '/index.php')) { $url = substr($url, 0, -10); } return sprintf('%s/exapps/%s', $url, $appId); } ``` -------------------------------- ### Get User Subadmin Groups XML Output Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/instruction_set_for_users.html Example XML response listing the groups a user is a subadmin of. ```xml ok 100 testgroup ``` -------------------------------- ### Get list of apps Source: https://docs.nextcloud.com/server/latest/admin_manual/apps_management_api.html Returns a list of apps installed on the Nextcloud server. Supports filtering by enabled or disabled status. ```APIDOC ## GET ocs/v1.php/cloud/apps/ ### Description Returns a list of apps installed on the Nextcloud server. Authentication is done by sending a Basic HTTP Authorization header. ### Method GET ### Endpoint `ocs/v1.php/cloud/apps/` ### Parameters #### Query Parameters - **filter** (string) - Optional - Can be `enabled` or `disabled` to filter the list of apps. ### Request Example ``` $ curl -X GET http://admin:secret@example.com/ocs/v1.php/cloud/apps?filter=enabled -H "OCS-APIRequest: true" ``` ### Response #### Success Response (100) - **XML output**: Provides a structured XML response containing the list of apps. #### Response Example ```xml 100 ok files provisioning_api ``` ``` -------------------------------- ### Register an ExApp using OCC CLI Source: https://docs.nextcloud.com/server/latest/admin_manual/exapps_management/ManagingExApps.html Use the register command as the initial step for installing an ExApp. It requires the ExApp's unique ID and optionally accepts daemon configuration names, deploy information, and advanced deployment options like environment variables and mounts. ```bash app_api:app:register [--force-scopes] [--info-xml INFO-XML] [--json-info JSON-INFO] [--wait-finish] [--silent] [--test-deploy-mode] [--env [ENV]] [--mount [MOUNT]] [--] [] ``` -------------------------------- ### Get List of Enabled Apps Source: https://docs.nextcloud.com/server/latest/admin_manual/apps_management_api.html Retrieves a list of all enabled applications installed on the Nextcloud server. Requires Basic HTTP Authorization. ```bash $ curl -X GET http://admin:secret@example.com/ocs/v1.php/cloud/apps?filter=enabled -H "OCS-APIRequest: true" ``` -------------------------------- ### Enable Data Directory Permissions Check Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html Checks permissions for the data directory. In rare setups, this might block installation if permissions cannot be corrected. Defaults to true. ```php 'check_data_directory_permissions' => true, ``` -------------------------------- ### Prepare PostgreSQL for Restore Source: https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html Drop and create the Nextcloud database in PostgreSQL using psql client. Ensure PGPASSWORD is set. ```bash PGPASSWORD="password" psql -h [server] -U [username] -d template1 -c "DROP DATABASE \"nextcloud\";" PGPASSWORD="password" psql -h [server] -U [username] -d template1 -c "CREATE DATABASE \"nextcloud\";" ``` -------------------------------- ### Directory-based Apache Configuration for Nextcloud Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html Use this configuration for installing Nextcloud in a subdirectory of an existing webserver. Ensure the Directory and Alias filepaths match your system's setup. ```apache Alias /nextcloud "/var/www/nextcloud/" Require all granted AllowOverride All Options FollowSymLinks MultiViews Dav off ``` -------------------------------- ### TypeScript Skeleton for Nextcloud OCS API Script Source: https://docs.nextcloud.com/server/latest/admin_manual/windmill_workflows/index.html A template for creating custom Windmill scripts to interact with the Nextcloud OCS API. It includes setup for authentication and making generic GET requests. ```typescript import createClient, { type Middleware } from "openapi-fetch"; export async function main( nextcloud: RT.Nextcloud, $PARAMETER: $TYPE, // add any input parameters you need here ) { // this part is the same for any script and should not be changed const client = createClient({ baseUrl: nextcloud.baseUrl }); const authMiddleware: Middleware = { async onRequest({ request, options }) { // fetch token, if it doesn’t exist // add Authorization header to every request request.headers.set("Authorization", `Basic ${btoa(nextcloud.userId + ':' + nextcloud.token)}`); return request; }, }; client.use(authMiddleware); //starting here you can adapt the script data = await client.GET("/ocs/v2.php/apps/$APP/$PATH/{$PATHPARAMETER}", { params: { header: { "OCS-APIRequest": true, }, query: { format: "json", }, path: { $PATHPARAMETER: "$VALUE", }, }, body: { $BODYPARAMETER: $VALUE, }, }); return data; } ``` -------------------------------- ### Move Keys to New Directory (Ubuntu Linux Example) Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/encryption_configuration.html Demonstrates the steps to move encryption keys to a new directory on an Ubuntu Linux system, including directory creation, ownership, and permission changes, followed by the occ command to update the key storage root. ```bash cd /your/nextcloud/data mkdir keys chown -R root:www-data keys chmod -R 0770 keys occ encryption:change-key-storage-root keys ``` -------------------------------- ### Nextcloud config.php with MariaDB Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html Example of a config.php file for a new Nextcloud installation using MariaDB as the database. This configuration includes database credentials and host information. It is recommended to use MySQL/MariaDB, Oracle, or PostgreSQL for production environments. ```php 'oc8c0fd71e03', 'passwordsalt' => '515a13302a6b3950a9d0fdb970191a', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'studio', 2 => '192.168.10.155' ), 'datadirectory' => '/var/www/nextcloud/data', 'dbtype' => 'mysql', 'version' => '7.0.2.1', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'oc_carla', 'dbpassword' => '67336bcdf7630dd80b2b81a413d07', 'installed' => true, ); ``` -------------------------------- ### Convert Database Type Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_database.html Converts the Nextcloud database from SQLite to MySQL, MariaDB, or PostgreSQL. This example shows conversion from SQLite to MySQL/MariaDB. Requirements include the target database and its PHP connector being installed, login credentials, and the database port number if non-standard. ```bash sudo -E -u www-data php occ db:convert-type mysql oc_dbuser 127.0.0.1 oc_database ``` -------------------------------- ### Llama 2 Configuration Example Source: https://docs.nextcloud.com/server/latest/admin_manual/ai/app_llm2.html Configuration file for a Llama 2 model. Includes prompt template and loader settings like context size, max tokens, and stop sequences. The '{system_prompt}' and '{user_prompt}' variables will be dynamically filled. ```json { "prompt": "<|im_start|> system\n{system_prompt}\n<|im_end|>\n<|im_start|> user\n{user_prompt}\n<|im_end|>\n<|im_start|> assistant\n", "loader_config": { "n_ctx": 4096, "max_tokens": 2048, "stop": ["<|im_end|>"] } } ``` -------------------------------- ### Create PostgreSQL User and Database Source: https://docs.nextcloud.com/server/latest/admin_manual/office/euro-office/installation_debian.html Set up a dedicated PostgreSQL user and database for the Document Server. Ensure the user owns the database. ```bash sudo -u postgres psql -c "CREATE USER ds WITH PASSWORD 'ds';" sudo -u postgres psql -c "CREATE DATABASE ds OWNER ds;" ``` -------------------------------- ### Enable and Start Clamd Service Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/antivirus_configuration.html Enables the clamd service to start on boot and then starts the service for the scan profile on RHEL/CentOS systems. ```bash systemctl enable clamd@scan.service systemctl start clamd@scan.service ``` -------------------------------- ### List Available Storage Backends Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_files.html Lists all available storage and authentication backends. Can be filtered by type (storage or authentication). Use --output=json_pretty to inspect backend capabilities and configuration schema. ```bash sudo -E -u www-data php occ files_external:backends ``` ```bash sudo -E -u www-data php occ files_external:backends storage ``` ```bash sudo -E -u www-data php occ files_external:backends authentication ``` -------------------------------- ### Install Nextcloud Core Packages on Ubuntu Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_ubuntu.html Installs essential packages for a typical Nextcloud installation on Ubuntu. Additional packages may be required for specific apps. ```bash sudo apt update && sudo apt upgrade sudo apt install apache2 mariadb-server libapache2-mod-php php-gd php-mysql \ php-curl php-mbstring php-intl php-gmp php-xml php-imagick php-zip ``` -------------------------------- ### Apply SELinux Changes and Enable Network Connect Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/example_centos.html After setting file contexts, apply them recursively to the Nextcloud directory. Then, enable the `httpd_can_network_connect` SELinux boolean to allow the web server to establish network connections. ```bash restorecon -R '/var/www/html/nextcloud/' setsebool -P httpd_can_network_connect on ``` -------------------------------- ### Llama 3 Configuration Example Source: https://docs.nextcloud.com/server/latest/admin_manual/ai/app_llm2.html Configuration file for a Llama 3 model. Features a different prompt template and loader settings, including a higher context window and a specific temperature. The '{system_prompt}' and '{user_prompt}' variables are used. ```json { "prompt": "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>\n{user_prompt}<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>\n", "loader_config": { "n_ctx": 8000, "max_tokens": 4000, "stop": ["<|eot_id|>"], "temperature": 0.3 } } ``` -------------------------------- ### Remove Desktop Shortcut Feature After Installation Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Removes the desktop shortcut feature from an already installed Nextcloud client. This command modifies the existing installation to exclude the shortcut. ```bash msiexec /passive /i Nextcloud-x.y.z-x64.msi REMOVE="DesktopShortcut" ``` -------------------------------- ### Complete Nextcloud Installation with OCC Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/command_line_installation.html Use the `occ` command to perform the Nextcloud installation after setting up the directory. This command configures the database and creates the initial admin user. Ensure you are in the Nextcloud root directory before running. ```bash $ cd /var/www/nextcloud/ $ sudo -E -u www-data php occ maintenance:install \ --database 'mysql' --database-name 'nextcloud' \ --database-user 'nextcloud' --database-pass 'password' \ --admin-user 'admin' --admin-pass 'password' ``` -------------------------------- ### Add Desktop Shortcut Feature After Installation Source: https://docs.nextcloud.com/server/latest/admin_manual/desktop/massdeployment.html Adds the desktop shortcut feature to an already installed Nextcloud client. This command modifies the existing installation to include the shortcut. ```bash msiexec /passive /i Nextcloud-x.y.z-x64.msi ADDDEFAULT="DesktopShortcut" ``` -------------------------------- ### Indicate Sample Configuration Copied Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html This setting warns if the sample configuration was copied. It should not be added to your actual configuration. Ensure all settings are modified after consulting documentation. ```php 'copied_sample_config' => true, ``` -------------------------------- ### View all Theming Configuration Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_system.html Run the theming:config command without arguments to display all current theming settings. This includes values like name, URL, slogan, and colors. ```bash sudo -E -u www-data php occ theming:config ``` -------------------------------- ### Enable Nextcloud Apache Site Configuration (Debian/Ubuntu) Source: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html Run this command on Debian, Ubuntu, and derivatives to enable the Nextcloud Apache site configuration file. ```bash a2ensite nextcloud.conf ``` -------------------------------- ### Enable Well-Known Setup Check Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html Verifies a working .well-known URL redirects by attempting a JS request. Defaults to true. ```php 'check_for_working_wellknown_setup' => true, ``` -------------------------------- ### Install MySQL MD5 Hashing Component Source: https://docs.nextcloud.com/server/latest/admin_manual/release_notes/upgrade_to_35.html Run this command on your MySQL 9+ server to load the component for MD5 support, as Nextcloud may still rely on it. ```sql INSTALL COMPONENT 'file://component_classic_hashing'; ``` -------------------------------- ### Enable and Start Systemd AI Worker Services Source: https://docs.nextcloud.com/server/latest/admin_manual/ai/overview.html Enable and start multiple instances of the Nextcloud AI worker systemd service. This command iterates to enable and start the service for a specified number of workers. ```bash for i in {1..4}; do systemctl enable --now nextcloud-ai-worker@$i.service; done ``` -------------------------------- ### List Available Version Commands Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_files.html Lists the available subcommands for the 'versions' app. These commands are only functional when the 'files_versions' app is enabled. ```bash versions versions:cleanup delete file versions versions:expire expire file versions according to the configured retention policy ``` -------------------------------- ### List Non-Shipped Installed Apps Source: https://docs.nextcloud.com/server/latest/admin_manual/occ_apps.html Shows only installed apps that were not part of the original Nextcloud distribution. ```bash sudo -E -u www-data php occ app:list --shipped false ```