Installing Nextcloud via the Quick Install method

Hello everybody,

I would like to install the latest version of Nextcloud via the Quick Install method.

This is similar to Can't install Nextcloud
That post didn’t have a resolution.

Here’s my setup:

Domain : subdomain.domain.tld
Alias  : www.subdomain.domain.tld

Domain redirection to subdomain.domain.tld
SSL enabled and working via Let's Encrypt
HTTPS redirection enabled
HSTS enabled

Web Template APACHE2     : default
Backend Template PHP-FPM : PHP-8_2
Proxy Template		     : default

Installation attempts fail with the following message:

Could not open input file: ‘/home/hestiauser/web/subdomain.domain.tld/public_html/occ’ Error: cmd exited with errors

Data Loss Warning!

Your web folder already has files uploaded to it. The installer will overwrite your files and/or the installation might fail.

Please make sure ~/web/subdomain.domain.tld/public_html is empty!

That directory was empty to being with.

Any idea how to go about this?

Thank you.

Hi @ioan

Try this fix:

1 Like

Thank you. It worked.

If you want to share, how did you come across this solution?

1 Like

You’re welcome :wink:

I tested the installation and noticed an error in the log when executing the installation command (see /var/log/hestia/nginx-error.log on your side). It looks like the command doesn’t handle quoted strings correctly, so I removed the parts where the quotes were being added.

--- NextcloudSetup.php  2025-07-21 10:45:27.000000000 +0200
+++ ncpatch     2025-09-08 19:25:25.789429924 +0200
@@ -44,21 +44,27 @@
                        $this->config["server"]["php"]["supported"],
                );

+$occPath = $this->getDocRoot("occ");
+
+// Verificar que occ existe
+if (!file_exists($occPath)) {
+    throw new Exception("Nextcloud installation incomplete. OCC command not found at: " . $occPath);
+}
                $this->appcontext->runUser(
                        "v-run-cli-cmd",
                        [
                                "/usr/bin/php" . $options["php_version"],
-                               quoteshellarg($this->getDocRoot("occ")),
+                               $this->getDocRoot("occ"),
                                "maintenance:install",
                                "--database mysql",
                                "--database-name " .
-                               quoteshellarg($this->appcontext->user() . "_" . $options["database_name"]),
-                               "--database-host " . quoteshellarg($options["database_host"]),
+                               $this->appcontext->user() . "_" . $options["database_name"],
+                               "--database-host " . $options["database_host"],
                                "--database-user " .
-                               quoteshellarg($this->appcontext->user() . "_" . $options["database_user"]),
-                               "--database-pass " . quoteshellarg($options["database_password"]),
-                               "--admin-user " . quoteshellarg($options["username"]),
-                               "--admin-pass " . quoteshellarg($options["password"]),
+                               $this->appcontext->user() . "_" . $options["database_user"],
+                               "--database-pass " . $options["database_password"],
+                               "--admin-user " .  $options["username"],
+                               "--admin-pass " .  $options["password"],
                        ],
                        $status,
                );
@@ -67,9 +73,9 @@
                        "v-run-cli-cmd",
                        [
                                "/usr/bin/php" . $options["php_version"],
-                               quoteshellarg($this->getDocRoot("occ")),
+                               $this->getDocRoot("occ"),
                                "config:system:set",
-                               "trusted_domains 2 --value=" . quoteshellarg($this->domain),
+                               "trusted_domains 2 --value=" . $this->domain,
                        ],
                        $status,

My knowledge of PHP is zero, so I didn’t submit a PR to fix it (I hope someone with PHP knowledge can review it). Other installers have the same problem.

4 Likes

Thank you.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.