Nextcloud

Nextcloud is [[Article description::a free and open source cloud hub primarily intended for file synchronization and sharing. It features a rich ecosystem of different apps .]]

This installation document was written with Nextcloud 26 as a target and attempts to provide a fast installation on Gentoo systems.

Requirements
Nextcloud requires software components from the standard (L)AMP stack: a web server, a database, and PHP (php-fpm). Apache and Nginx are supported web servers.

PHP
Before (re-)emerging PHP in order to get supported modules, see upstream's list of supported PHP versions and associated modules which are necessary for correct operation of Nextcloud.

Verify one of three possible modules exist for the database connector. In this instance, PostgreSQL will be the application's database:

Generally recommended USE flags are bz2 gmp bcmath exif intl sysvipc. After installing or uninstalling any php modules, the web server, and/or php-fpm depending on the configuration, needs to be restarted.

Caching
Recommended for enhanced server performance is to pair Nextcloud with memcached or others. This PHP module is a PECL extension and is installed separately from php itself. On Gentoo, the php module is available in the following package

memcached package must also be installed:

Verify the module is available to PHP.

Signed SSL certificate (Let's Encrypt)
Let's Encrypt can be used to obtain free certificates which have been signed by a recognized signing authority.

Simply choose a desired domain and request the certificate.

Installation
Once PHP, Apache and (optionally) the caching service have been installed, simply set the USE flags for nextcloud and emerge the service.

Emerge
The following command is a recommendation for webapp-config:

Files
- Contains the nextcloud files if the install was performed using the recommended method.

OpenRC
On an OpenRC system Nextcloud does not have a specific service, but runs on services from the LAMP stack: