Create a server report

Is there a tool / page to generate this report:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • replace me
  • Operating system and version (e.g., Ubuntu 24.04):
    • replace me
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • replace me
  • When did this problem seem to first start?
    • replace me
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • replace me
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • replace me

Summary of the issue you are facing:

I created this but not sure where to put it.

#!/usr/bin/env php
<?php
/**
 * nextcloud_info.php
 *
 * Gathers:
 *  - Nextcloud Server version
 *  - OS + version
 *  - Web server + version
 *  - Reverse proxy + version (via “Via” header if available)
 *  - PHP version
 *  - Prompts for:
 *      * First‑time seeing this error?
 *      * When did it first start?
 *      * Installation method
 *      * Using Cloudflare, mod_security, etc.
 *
 * Usage:
 *   php nextcloud_info.php
 *   (or via web—just hit it in your browser)
 */

// 1) Nextcloud version
$ncRoot = __DIR__;
$versionFile = $ncRoot . '/version.php';
$nextcloudVersion = 'unknown';
if (file_exists($versionFile)) {
    $v = file_get_contents($versionFile);
    if (preg_match("/\\\$OC_VersionString\\s*=\\s*'([^']+)'/", $v, $m)) {
        $nextcloudVersion = $m[1];
    }
}

// 2) OS/version
$osPretty = PHP_OS_FAMILY + ' ' + PHP_OS;

// 3) Web server
$webServer = $_SERVER['SERVER_SOFTWARE'] ?? php_sapi_name();

// 4) Reverse proxy via headers
$headers = function_exists('getallheaders') ? getallheaders() : [];
$viaHeader = $headers['Via'] ?? $headers['HTTP_VIA'] ?? 'not detected';

// 5) PHP version
$phpVersion = PHP_VERSION;

// Output as Markdown
$md  = "## The Basics\n";
$md .= "* Nextcloud Server version _(e.g., 29.x.x)_:  \n  - `{$nextcloudVersion}`\n";
$md .= "* Operating system and version _(e.g., Ubuntu 24.04)_:  \n  - `{$osPretty}`\n";
$md .= "* Web server and version _(e.g, Apache 2.4.25)_:  \n  - `{$webServer}`\n";
$md .= "* Reverse proxy and version _(e.g. nginx 1.27.2)_:  \n  - `{$viaHeader}`\n";
$md .= "* PHP version _(e.g, 8.3)_:  \n  - `{$phpVersion}`\n";
$md .= "* Is this the first time you've seen this error? (Yes / No):  \n  - `yes`\n";
$md .= "* When did this problem seem to first start?  \n  - `today`\n";
$md .= "* Installation method _(e.g. AIO, NCP, Bare Metal/Archive, etc.)_:  \n  - `docker hub image`\n";
$md .= "* Are you using Cloudflare, mod_security, or similar? _(Yes / No)_:  \n  - no`\n";

// Print to screen
header('Content-Type: text/plain; charset=UTF-8');
echo $md;

there is a occ command to get all the config settings:
sudo -u www-data php occ config:list

I cannot find it right know, but I think I have seen an option where an app lets you generate a header for a report with all required information. Some information is available on the serverinfo (that is one of the last items in the admin interface).

However, in case of problems this might not be available. And if you call php from command line, you don’t see the webserver, and if you have different php versions installed, you won’t know which one is running on your webserver.

1 Like

awesome. But this will not get information on a proxy?

In docker setup ( on omv but that is not relevant) I’ve a container called nextcloud. The proxy sits in nginx-proxy. So to prepare a report I use

#!/bin/bash

reverse_proxy_version=$(docker container exec nginx-proxy nginx -v 2>&1 | head -n 1)

echo "* Nextcloud Server version:
  - \`$(docker container exec nextcloud php /var/www/html/occ --version)\`
* Operating system and version:
  - \`$(docker container exec nextcloud uname -v)\`
* Web server and version:
  - \`$(docker container exec nextcloud apachectl -v | head -n 1)\`
* Reverse proxy and version:
  - \`$reverse_proxy_version\`
* PHP version:
  - \`$(docker container exec nextcloud php --version | head -n 1)\`"

Which looks like:

  • Nextcloud Server version:
    • Nextcloud 31.0.4
  • Operating system and version:
    • #1 SMP PREEMPT Debian 1:6.12.20-1+rpt1~bpo12+1 (2025-03-19)
  • Web server and version:
    • Server version: Apache/2.4.62 (Debian)
  • Reverse proxy and version:
    • nginx version: openresty/1.27.1.1
  • PHP version:
    • PHP 8.3.20 (cli) (built: Apr 11 2025 17:51:27) (NTS)

Wouldn’t this help both the average user and the maintainers/moderators of these boards?

It might be interesting, but in such a case it would be best to create an app.

what happens if someone does not have docker? Or if they use nginx? And they have perhaps a apache and nginx setup on their system? So this could only work when called from within Nextcloud (through webserver).

this is the command line interface configuration. Very unexperienced users (especially on webhosting) might have different php versions available, and the version used by the web server can be different.

I’m not sure if the NextcloudPi and/or AIO already have some functions to print out environment details.

I found the app again, it is not available for recent versions:

1 Like

Fortsetzung der Diskussion von Create a server report:

Yes, it assumes nc is run in a container, with the specified names.

I’m not using NextcloudPi. The nextcloud container (probably) has only the one php version.

My rationale: the easier it is made to collect the required data the more likely it will be complete and up-to-date. I hate to go through all the different location to locate that no doubt relevant information.

In a more general case it would be extremely helpful and fancy if most of this info was readibly available directly from the dash.

If you are using a Debian-based operating system like Ubuntu, you can obtain extensive information — not only about the running PHP instances or installed and running web servers, but much more — with the > janitor < script.

Simply run:

janitor

If it is not yet installed, you can install it with:

sudo wget -O /usr/local/bin/janitor https://global-social.net/script/janitor
sudo chmod +x /usr/local/bin/janitor

Explanation:
- the first line downloads the script into the directory /usr/local/bin
- the second line makes it executable

The information module is designed so that additional modules can be easily added. These range from simple command calls or file content outputs to complex information gathering — for example, the PHP information module temporarily starts a web server for each installed PHP version without disrupting productive web server operations. This allows precise testing for any configuration errors that would otherwise be hard to detect.
Hundreds of hours of development work went into this project.

I would be very happy to receive suggestions and requests for additional information modules!
Please submit them as a “sysinf request” at:

:point_right: GitHub · Where software is built


Much and good luck,
ernolf

1 Like

Hi @ernolf thanks a lot for this initiative! I really like the idea :slight_smile:

What about enriching this script with the following information? (Not sure if it could be better formatted somehow?)

# General information
docker info
docker inspect nextcloud-aio-mastercontainer
docker logs nextcloud-aio-mastercontainer
docker network inspect nextcloud-aio

# Retrieve service logs
docker logs nextcloud-aio-apache
docker logs nextcloud-aio-database
docker logs nextcloud-aio-nextcloud
docker logs nextcloud-aio-notify-push
docker logs nextcloud-aio-redis

# Retrieve Nextcloud information
docker exec --user www-data nextcloud-aio-nextcloud php occ config:list
docker exec nextcloud-aio-nextcloud tail -n100 data/nextcloud.log
docker exec nextcloud-aio-nextcloud cat data/install.log
docker exec nextcloud-aio-nextcloud cat data/update.log

# Retrieve backup container logs
docker logs nextcloud-aio-borgbackup

# Retrieve optional container logs
docker logs nextcloud-aio-collabora
docker logs nextcloud-aio-talk
docker logs nextcloud-aio-clamav
docker logs nextcloud-aio-imaginary
docker logs nextcloud-aio-whiteboard
docker logs nextcloud-aio-fulltextsearch
docker logs nextcloud-aio-talk-recording

I can create a feature request on GitHub if you think this is a good idea :slight_smile:

Hi @szaimen

Thanks for the confirmative feedback :blue_heart:

Great! :+1:

No, not absolutely necessary, because I now have your list to work with.

I’ll get back to you so you can test it.


ernolf

1 Like

I formatted specifcally according to the requerements in the support board.