Error 504 while installing from scratch

Hi all!
I’m new to Nextcloud, trying to install it on a local NAS at home (Synology DS916+ with 8GB RAM and 10TB storage, Apache 2.4, PHP 7.2).

I’m following these instructions plus adjustments for PHP 7.2 and using MySQL rather than MariaDB. I have sorted out some early hurdles with database access and reached a point where the “index.php” setup wizard could run.

The wizard started chewing on the task, and after exactly one minute the browser gave me a “504” error page (“There is an error while processing this request.”).

The wizard has created a “nextcloud” database and a ton of tables in that DB, so I’d say that the “database” part of things seem to be working fine. I feel I’m so close and yet so far away.

I also checked the PHP configuration for a max_execution_time value. It was already set to 240 seconds, and increasing it tenfold and re-trying the installation from scratch didn’t resolve the problem either. So I believe the error 504 is not caused by a PHP timeout.

I couldn’t find any hints of a problem in the Apache or PHP log files.

  • where else can I look for hints about possible causes?
  • do you have an idea or experience what the problem could be?

Why did you select MySQL? MariaDB is preferable. But this is not your issue.

I would try to double check the apache configuration. Do you have access to the commend line? Can you show us the virtual host config file that was generated by your system?


Frankly, I already had it installed and running, and I saw that Nextcloud can work with either out-of-the-box, so I just went with it.

virtual host config file

On a Synology, the virtual host config is located at /usr/local/etc/apache24/sites-enabled/httpd-vhost.conf and this is what mine looks like (the .eu domain is mine; should I just use the host’s local IP for now?):

<VirtualHost *:80 *:443>
    SetEnv HOST
    DocumentRoot "/volume1/web/nextcloud"
    <IfModule dir_module>
        DirectoryIndex  index.html index.htm index.cgi index.php index.php5
    <Directory "/volume1/web/nextcloud">
        Options MultiViews FollowSymLinks ExecCGI
        AllowOverride All
        <IfModule authz_core_module>
            Require all granted
    <FilesMatch "\.(php[345]?|phtml)$">
        SetHandler "proxy:unix:/run/php-fpm/php-9f1e642a-0d20-4664-8934-c51d34f609de.sock|fcgi://localhost"                                                                                                

Funny: I’m coming back to my desktop after a reboot (of the desktop, not the nextcloud host) and it’s running now!

Apparently that 504 was merely a front-end issue that didn’t prevent the back-end installation to complete. Logged in as admin, created first user account - all is well!

It’s just very slow, but that’s probably because the NAS isn’t a powerhouse.

Consider this closed. Resolution: patience.