Nextcloud
This geneset contains fodder for installing a Nextcloud server on Linux, backed by a MariaDB/MySQL database.
The fodder is cross-platform Nextcloud server fodder. It installs Apache and PHP, downloads the latest Nextcloud release tarball and runs occ maintenance:install against an external MariaDB/MySQL database. It has been tested on Debian 13 and AlmaLinux 10 (it also works on Ubuntu and the RHEL family).
Usage
Deploy two catlets: a database catlet with the dbosoft/mariadb gene and an application catlet with the Nextcloud gene. Set the application's db_host to the name of the database catlet — eryph's internal DNS resolves catlet names within the project, so you don't need to look up its IP address.
Both catlets need a second drive for their persistent state — the database on the DB catlet, and Nextcloud's data directory and generated config.php on the application catlet: see Persistent state below. Without it the provisioning fails on purpose rather than storing state that a redeploy would silently lose.
name: nextcloud-db
parent: dbosoft/debian-13/starter
drives:
- name: sdb
size: 10
location: nextcloud-db-data
fodder:
- source: gene:dbosoft/mariadb:server
variables:
- name: db_name
value: nextcloud
- name: db_user
value: nextcloud
- name: db_password
value: change-me-please
secret: true
name: nextcloud-app
parent: dbosoft/debian-13/starter
memory:
startup: 3072
drives:
- name: sdb
size: 20
location: nextcloud-app-data
fodder:
- source: gene:dbosoft/nextcloud:server
variables:
- name: db_host
value: nextcloud-db
- name: db_name
value: nextcloud
- name: db_user
value: nextcloud
- name: db_password
value: change-me-please
secret: true
- name: admin_user
value: admin
- name: admin_password
value: change-me-too
secret: true
The db_name, db_user and db_password of the mariadb gene must match the ones of the Nextcloud gene.
The fodder:
- installs Apache (mod_php on Debian/Ubuntu, php-fpm on the RHEL family) and the PHP modules Nextcloud needs
- downloads and extracts the Nextcloud code to
/var/www/nextcloud - mounts the state drive at
/var/nextcloudand keeps the data directory andconfig.phpthere - sets the PHP
memory_limitto 512M - on the RHEL family configures SELinux (
httpd_can_network_connect_db, andhttpd_sys_rw_content_ton the state directory and apps) - runs
occ maintenance:installon first deploy, and re-attaches +occ upgradeon a redeploy - sets
trusted_domainsto the host name and the primary IP address - opens port 80 when
firewalldorufwis active
Nextcloud is served over plain HTTP on port 80. For production use, put a TLS-terminating reverse proxy in front of it.
Persistent state
Nextcloud's state is split between the database and the application catlet, so both catlets need their own persistent drive. The application catlet holds the data directory (user files) and config.php with the generated instanceid, secret and passwordsalt; the database catlet holds the MariaDB data directory (the dbosoft/mariadb gene requires a drive of its own for the same reason). The OS disk is recreated from the gene on every deploy, so that state must live on a separate, persistent drive — otherwise a redeploy would lose it while the database keeps the old installation, and provisioning would fail with "The Login is already being used".
Give each catlet a second drive and make it persistent with an explicit location. This is the key detail: name (sdb) only sets the device order inside the guest, while location is the drive's identity on the host. Without a location, eryph assigns a throwaway storage id and deletes the drive together with the catlet; with one, the drive lives independently of the catlet and is re-attached on the next deploy. Give each catlet its own location, unique within the project (the examples use nextcloud-db-data and nextcloud-app-data).
The application fodder formats its drive on first use (ext4, label nextcloud), mounts it at /var/nextcloud, and stores the data directory and config.php there; the MariaDB fodder does the same for its data directory. On a redeploy — removing the catlets and deploying them again with the same locations — the drives are re-attached, so the fodder re-attaches to the existing installation and runs occ upgrade instead of re-installing. If no empty drive is present, provisioning stops with a clear error rather than storing state that would not survive.
Configuration
The following variables can be used to configure the server fodder:
db_host
required, no default valueThe database server. Use the name of the database catlet (eryph's internal DNS resolves it within the project); an IP address or any resolvable hostname also works.
db_name
default value: nextcloudThe name of the database.
db_user
default value: nextcloudThe name of the database user.
db_password
required, secret, no default valueThe password of the database user.
admin_user
default value: adminThe name of the Nextcloud administrator account.
admin_password
required, secret, no default valueThe password of the Nextcloud administrator account.
nextcloud_version
default value: latestThe Nextcloud version to install. Set it to a specific release like
35.0.2to pin the version.trusted_domains
default value:*Space-separated list of additional trusted domains, appended to the automatically detected ones (host name and primary IP address). Nextcloud rejects requests whose
Hostheader is not a trusted domain. The default*accepts any host, so the site works out of the box when reached through a NAT/forwarded address whose IP the catlet cannot know. For production, set this to the exact host name(s) users browse to (e.g.cloud.example.com) to restrict access.
Versioning
This geneset contains only fodder genes and is versioned with a major-minor version scheme.
There is no patch version - when a bug is fixed, a new minor version will be released.
A new major version is released when a gene is removed from the geneset.
The tag latest is updated with each released version. If you want to have a stable reference, don't use the latest tag, use a specific version tag.
Contributing
This geneset is maintained by dbosoft and is open for contributions.
You can find the repository for this geneset on github.com/dbosoft/eryph-genes.
License
All public dbosoft genesets are licensed under the MIT License.