Unknown Issue Configuring Nextcloud W/ Nginx On Ubuntu Server

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

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

Summary of the issue you are facing:

I am attempting to install and configure Nextcloud on my Ubuntu Server via nginx but have been unable to obtain the web UI despite documentation as assistance. Nginx is successfully displaying a HTTPS web site using a self signed certificate, likely meaning Nextcloud itself is my challenge.

In short, I cannot access the Nextcloud web UI, but know nginx + SSL is functioning correctly.

Steps to replicate it (hint: details matter!):

  1. Install latest Nextcloud community archive
  2. Copy Nextcloud config
  3. Update PHP config
  4. Attempt Nextcloud UI setup via browser

I understand the above are extremely general, but I have been documenting my process on GitLab

The provided link displays my setup for various services including nginx, Nextcloud (MySQL, PHP), SSL/TLS, etc. Essentially, everything configured is recorded.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

NA

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

Console Output
1. GET https://192.168.1.189/nextcloud
2. This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
3. GET https://192.168.1.189/favicon.ico


Network Output

|Status | Method | Domain                | File|

|301    | Get    | 192.168.1.189 (HTTP)  | nextcloud|
|404    | Get    | 192.168.1.189 (HTTPS) | nextcloud|
|404    | Get    | 192.168.1.189 (HTTPS) | favicon.ico|

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

192.168.1.145 - - [20/May/2025:02:38:39 +0000] "GET /nextcloud HTTP/1.1" 301 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0" "-"
192.168.1.145 - - [20/May/2025:02:38:39 +0000] "GET /nextcloud HTTP/1.1" 404 153 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0" "-"
192.168.1.145 - - [20/May/2025:02:38:39 +0000] "GET /favicon.ico HTTP/1.1" 404 153 "https://192.168.1.189/nextcloud" "Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0" "-"

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

Is /usr/share/nginx/html/nextcloud/config/config.sample.php likely the correct file? I attempted to upload it, but was too large and exceeded this post’s maximum character limit.

Note: The above file is unmodified. I have not interacted w/ this or a similar file.


Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Since you’re getting a 404 I suggest checking:

  • ownership and permissions of the fpm socket (there are PHP FPM listen.* parameters for controlling this
  • your php-fpm.log

Possibly other FPM config bits, depending on what is in the logs.

Refs:

1 Like

Note that Nextcloud Server v31 was released prior to PHP 8.4. It does not support it.

The upcoming v32 will, however.

1 Like

Thank you! Would I need to change the owner to be nginx, or simply ensure permissions are 755?

I should use 8.3 then, right?

Well it seems tere are different versions of the document available. This Document System requirements states PHP 8.4 is supportet for Nextcloud Server v31. Similar as this Releases and PHP versions.

@adelaar Please note you are comparing documents describing the requirements for “latest” branch with a document from the “stable” branch @jtr has mentioned, and this may be confusing.

@TheWojtek you are right. But we are in 2025 and @Ascension3-Repacking does use Ubuntu 24.04.2 LTS. @jtr linked System requirements states Ubuntu 22.04 LTS as recommended. But no one shall install a new Nextcloud-Server in 2025 on Ubuntu 22.04 LTS.

My linked System requirements instead states Ubuntu 24.04 LTS as recommended, what is the used Ubuntu-Version of @Ascension3-Repacking and is the version that shall be used in 2025 and not Ubuntu 22.04 LTS.

That’s because the ‘stable’ link points to the Nextcloud 30 page, while the ‘latest’ link points to the Nextcloud 31 page. One could read a lot into that, but let’s not go there. :wink:

However, Ubuntu 24.04 should, of course, already have been the recommended version by the time version 30 was released , so I assume this was an oversight at the time, or maybe there were still some issues with NC 30 on Ubuntu 24.04 in certain edge cases.

Oh no, I think you are missing the point of what an “LTS” release is. 22.04 will be supported until June 2027 and there is a reason why we do not jump from release to release in production environments. I mean, for a home/SOHO scenarios with a couple of users it is OK, however in a big installation (I run 3 NC instances with >800 users in total) a release-upgrade is a serious thing and you don’t do it just because there is a new release available. You do not run “latest” but you run “stable”, because, erkhm, “stable” is the key to having good sleep at night. Too many of too important things may be broken if you’re trigger-happy with the upgrades and trust me, reclaiming a site this size after an upgrade disaster is not something you want to do over weekend.
NC is very clear when it comes to system requirements: Ubuntu 22 is recommended, 24 is supported. PHP8.3 is recommended. These are not the latest versions on purpose. (this does not contradict the fact @bb77 is right with his thinking just above)
Not using the cutting edge versions of essential software is IT administration 101. It’s fine to experiment in non-production environment (did you try PHP8.5 alpha in your production? Don’t) but in production you want to deal with something that is well-documented and stable. My servers have uptimes measured in years (bar some security-related upgrades forcing a reboot) and this is why I get a call from a user roughly once a week and not 24/7.
NC allows for running on well-established versions of OS, so @Ascension3-Repacking will be perfectly fine with his setup, 24.04 notwithstanding.
And again: you are linking to the “latest” branch of NC which is not the same as the “stable” branch of NC. In a serious implementation you will always offer the stable branch to the customer and not the latest.

OK, back to the topic:

@Ascension3-Repacking - please put a basic phpinfo file into your webroot:

<?php
phpinfo();
?>

and confirm your PHP implementation actually works from your browser.
If not, adjust your php-fpm with regards to file permissions. Your user should be www-data. Restart the php-fpm service and try again. Please refer to this tutorial to properly set up Nginx with PHP-fpm (it uses 7.3 as an example, but works perfectly with later versions).
BTW I always use the FPM running on a port on the server approach and never use the local socket approach (because sometimes it allows to quickly and safely scale the installation), but this may not be your use case.

While I completely agree with your post, in this case it might just have been an oversight. When NC 30 was released, Ubuntu 24.04 had already been out for about half a year, and at that point, an LTS release is usually considered “ready for production.”

Either way, for Nextcloud the PHP version is probably more important here than the specific distro version. If you’re using deb.sury.org, you can install a specific PHP version independently of the Ubuntu version you’re running. Of course, that opens up a whole other discussion about whether or not you should be using third-party repositories. :wink:

1 Like

But @Ascension3-Repacking was installing Nextcloud 31 ( 31.0.4) and not Nextcloud 30. So in my opinion he shall refere to the ‘latest’ link page pointing to the Nextcloud 31 and recommends to use Ubuntu 24.04.

Sure, and this will work, I do agree my argument is a matter of my BOFH attitude.
The whole point is now to make his installation work properly :wink:

Yes, you are correct there is no need at this time to update any existing Nextcloud-Installation on Ubuntu 22.04 to Ubuntu 24.04. But @Ascension3-Repacking was a few days ago doing a complete new installation.

And if you install complete new Nextcloud Server my opinion is not to do that on a 3 years old relese of Ubuntu but on the one years old. So @Ascension3-Repacking may use it 4 more years until LTS Support will ends and not only 2 more years from now,

1 Like

@Ascension3-Repacking would you like to tell us from what source you did install PHP 8.4.7? This can’t be out of the official Ubuntu 24.04 sources. In official Ubuntu 24.04 sources is still PHP 8.3.x but not PHP 8.4.x

Edit: i am aware there are PHP Personal package archives available from Ondřej Surý in different versions for Apache, nginx and others. So what did you use and may this cause your problems?

I added, then used the PPA for PHP. I also added repos for nginx and MySQL. Would it be safe to assume that purging my current configs, then relying upon solely default Ubuntu repos would benefit me?

sudo add-apt-repository ppa:ondrej/php

echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
    http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" \
    | sudo tee /etc/apt/sources.list.d/nginx.list

sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.34-1_all.deb

I unfortunately am traveling at the moment and will not have access to my server until Monday. However, I will implement this!

I don’t think so. I’m using the sury repos for years without any issues, the only difference to you is that I’m using Apache instead of Nginx. So I’d say the issue is either with PHP8.4 and some incompatible app, some missing PHP module, or some configuartion issue, either in PHP or nginx.

1 Like

Would you recommend I use stable instead of latest? Is this by any chance the stable community server?

No, I’d recommend trying to identify the issue, which is most likely a configuration problem, probably a combination of your PHP and NGINX settings.

Alternatively, you could give Nextcloud AIO a try. It handles all the heavy lifting, meaning the entire setup, including the web server, PHP, database, and more, is already taken care of right out of the box.

1 Like