If after upgrading Matomo from 5.14 to 6.0 behind a reverse proxy you see You are now accessing Matomo from ... but Matomo has been configured to run at this address instead of the login form, 6.0 is validating the public hostname sent in X-Forwarded-Host, and that hostname is not in trusted_hosts. The fix is to add it to config/config.ini.php and reload. I reproduced it on 30 November 2026 with the official Docker image, from 5.14.3 to 6.0.0 behind nginx 1.29, and tested the fix with a real sign-in. There is a Spanish version of this fix.

Key takeaways

  • Matomo 6.0.0 shipped on 23 November 2026, and the next day the matomo:latest tag jumped from 5.14.3 to 6.0.0.
  • Since 6.0, when config.ini.php has proxy_host_headers, Matomo validates the hostname the proxy sends, not the Host header it receives.
  • The installer stores the Host header it receives in trusted_hosts. If your proxy rewrites it, as nginx does by default, the container's internal name ends up there.
  • The fix is one line: trusted_hosts[] = "your.public.domain". With it, the form comes back and sign-in works.
  • Changing the image tag is not enough: with /var/www/html on a volume, the code stays on 5.14.3 until you refresh it.

Warning: You are now accessing Matomo from ... but Matomo has been configured to run at this address

The warning means Matomo received the request with a hostname that is not on its trusted list, so it hides the login form. This is the text 6.0.0 showed in my test, with the proxy published at analytics.localhost:

Warning: You are now accessing Matomo from http://analytics.localhost/index.php,
but Matomo has been configured to run at this address: http://matomo:80/index.php.
Click here to access Matomo safely and remove this warning.
How do I fix this problem and how do I login again?
The Matomo Super User can manually edit the file /path/to/matomo/config/config.ini.php
and add the following lines:
[General]
trusted_hosts[] = "analytics.localhost"

The second address, http://matomo:80, is the service name inside the Docker network. The "Click here to access Matomo safely" link points to that address, and the browser cannot resolve it from outside. On the same request, 5.14.3 showed the login form with no warning.

Why does it appear when moving from Matomo 5 to Matomo 6?

It appears because 6.0 changed which hostname it checks. The 6.0.0 changelog puts it this way: "Before upgrading a proxied installation that configures [General] proxy_host_headers, add both the public hostname and the hostname used to reach Matomo to trusted_hosts; otherwise the invalid-host warning replaces the login form."

On 5.x, the check used the request's Host header. On 6.0, with proxy_host_headers set, it uses the hostname sent in X-Forwarded-Host. My 5.14.3 install, done through the web installer behind nginx, left this configuration:

[General]
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_host_headers[] = "HTTP_X_FORWARDED_HOST"
proxy_scheme_headers[] = "HTTP_X_FORWARDED_PROTO"
trusted_hosts[] = "matomo:80"

The installer detected the proxy headers and turned on proxy_host_headers, but it stored the Host header it received in trusted_hosts: matomo:80. nginx sends that name because, according to its documentation, proxy_pass redefines Host as $proxy_host, the upstream server name, by default. 5.14.3 validated matomo:80 and let you in. 6.0.0 validates analytics.localhost, which is not on the list.

I tested four combinations on the same 6.0.0 to separate the causes:

Host header nginx sends proxy_host_headers trusted_hosts Result
matomo:80 yes matomo:80 warning, no form
$host (the public one) yes matomo:80 warning, no form
$host (the public one) no matomo:80 warning, no form
matomo:80 yes matomo:80 and analytics.localhost form and sign-in

Who is affected?

You are affected if your Matomo sits behind a reverse proxy, config.ini.php has proxy_host_headers, and trusted_hosts only lists the internal name. Check it with one command:

docker compose exec matomo grep -E 'proxy_host_headers|trusted_hosts' config/config.ini.php

If the output shows proxy_host_headers and a trusted_hosts entry with the container name, such as matomo:80 or matomo, you will see the warning on 6.0. If your public domain is already there, the upgrade changes nothing for you on this point.

Fix: add the public hostname to trusted_hosts

The fix is to add the hostname you type in the browser to trusted_hosts, without removing the existing one. The Matomo console writes it for you:

docker compose exec -u www-data matomo php console config:set 'General.trusted_hosts[]="analytics.localhost"'
Setting [General] trusted_hosts = "analytics.localhost"... done.

The file ends up like this:

trusted_hosts[] = "matomo:80"
trusted_hosts[] = "analytics.localhost"

Replace analytics.localhost with your domain, without http:// or a path. You do not need to restart the container: Matomo reads config.ini.php on every request. In my test, the next load showed the login form, the admin user signed in, and the test site's dashboard opened with its title.

Keep the internal name as well. With only the public one, the form also came back for me, but the changelog asks for both: the public one and the one the proxy uses to reach Matomo.

Why changing the tag does not upgrade Matomo in Docker

Before you see the warning you need the 6.0 code, and with the official image that does not happen on its own. Its entrypoint.sh copies the files from /usr/src/matomo to /var/www/html only when it does not find matomo.php. With /var/www/html on a volume, as in the official example, the file already exists and the copy is skipped. This is what I saw after changing matomo:5.14.3-apache to matomo:6.0.0-apache and recreating the container:

code in volume: VERSION = '5.14.3'
code in image:  VERSION = '6.0.0'

The page was still on 5.14.3, with its form. To refresh the code, delete the marker, restart, and apply the database migrations:

docker compose exec matomo rm matomo.php
docker compose restart matomo
docker compose exec -u www-data matomo php console core:update --yes

core:update ran 17 schema changes and finished with Matomo has been successfully updated!. That is the moment the warning appears. Copying over the old code leaves leftovers: diagnostics:unexpected-files found 91 files that 6.0 no longer ships, and diagnostics:run asked to delete six directories under vendor/. Clean them up like this:

docker compose exec -u www-data matomo php console diagnostics:unexpected-files --delete
docker compose exec -u www-data matomo php console diagnostics:run

Back up the volume and the database before you start. The guide to Docker volumes and bind mounts explains how to copy a named volume, and the one on MariaDB with Docker how to dump the database.

How to check the result

Check the code version and that the login page includes the form, from outside the container and with the public hostname:

docker compose exec -u www-data matomo php console core:version
curl -s http://analytics.localhost:18090/index.php | grep -c 'id="login_form'

In my test the first command returned 6.0.0 and the second a number above zero. Before the fix, the second returned 0.

What not to do: turn the check off

The warning itself offers enable_trusted_host_check=0, and 6.0 labels it "not recommended". The check exists against Host header injection: according to the Matomo FAQ, an attacker could send a fake hostname so that the password reset goes through their server. Removing proxy_host_headers is not a good way out either. Matomo would no longer know the name your visitors use, and the official guide for Matomo behind a proxy lists it among the lines the installer adds.

If you use Nginx Proxy Manager or Traefik, the fix is the same: the hostname you set in the proxy goes into trusted_hosts.

Gotchas I ran into

The first was that the web installer failed silently the first time: the database was not accepting connections yet and Matomo did not write config.ini.php. Waiting for MariaDB to answer before submitting the form solved it.

The second was the port. My nginx listened on 18090 and sent X-Forwarded-Host $host, which does not include the port, so the warning and the redirect after sign-in used analytics.localhost without :18090. Behind a proxy on 443 you do not notice. On a custom port, send $http_host.

The third was the misc/cron/archive.sh script. 6.0 removes it and diagnostics:unexpected-files did not list it, but it is still on the volume. If your cron calls it, switch to php console core:archive, which is what the changelog asks for.

FAQ

Can I go back to 5.14.3 if something goes wrong?

Use the backup from before the upgrade. core:update migrates the database schema, so going back with the tag alone leaves 5.14.3 on an already migrated database. The host warning does not need a rollback: one line fixes it.

Does the warning mean someone is attacking my Matomo?

Not in this case. It appears because the hostname you use is not on the list. It would be suspicious if the first address in the warning were not yours.

Do I have to change the tracking code on my sites?

No. I checked it with the warning still active: a tracking request to matomo.php with the public hostname returned 200 and the visit landed in the database. Tracking does not go through this check.

Conclusion

The Matomo has been configured to run at this address warning on 6.0 is not a broken install: Matomo now validates the hostname the proxy sends, and the installer had stored the internal one. Add your domain to trusted_hosts and keep the existing entry. On Docker, also refresh the code on the volume, because changing the tag does not, and clean up the 91 leftover files.

Sources: [1] Matomo, CHANGELOG.md for 6.0.0[1], [2] Matomo 6.0.0 release notes[2], [3] Docker official-images: matomo:latest moves to 6.0.0[3], [4] matomo-org/docker: docker-entrypoint.sh[4], [5] Matomo FAQ: untrusted hostname warning[5], [6] Matomo FAQ: Matomo behind a proxy[6], [7] nginx, ngx_http_proxy_module[7], [8] Docker Hub: official Matomo image[8].

Sources

  1. Matomo, CHANGELOG.md for 6.0.0
  2. Matomo 6.0.0 release notes
  3. Docker official-images: matomo:latest moves to 6.0.0
  4. matomo-org/docker: docker-entrypoint.sh
  5. Matomo FAQ: untrusted hostname warning
  6. Matomo FAQ: Matomo behind a proxy
  7. nginx, ngx_http_proxy_module
  8. Docker Hub: official Matomo image