Strapi listens on rather than

System Information
  • 4.14.6:
  • Alpine Linux / Docker Container:
  • MySQL 8:
  • Node v20.10.0:
  • NPM 10.x:

I have a Strapi instance on a docker container behind a reverse proxy.
Locally from the container, Strapi is reachable, from outside the container I get “connection refused” errors.

Interesting fact is that Strapi is telling me at startup that it listens on, which would explain why strapi refuses external requests.

│ │

config/server.js tells me that the default is and HOST is not set.

export default ({ env }) => ({
  host: env('HOST', ''),
  port:'PORT', 1337),
  app: {
    keys: env.array('APP_KEYS'),
  webhooks: {
    populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),

I guess that setting host directly in config/server.js would not change anything.

I have a number of containers that run various services, and a reverse proxy that distributes the requests. I also run other strapi instances that work. The environment is the same for all and this specific instance behaves the way i described. The only thing that puzzles me is that it tells me that it listens on which indicates that it only listes on requests to The working Strapi instances listen on

Hey. You can look to this resource : networking - What's the difference between and - Super User

Yes, that’s true, but

when Strapi tells me that it listens to I guess that it listens on all interfaces of its host or docker contaoiner for that matter. Therefore Strapi is reachable from the outside.

When Strapi tells me that it listens to I guess that it listens on the loopback interface of its host or docker container. Therefore Strapi is NOT reachable from the outside.

This is the case with the installation I mentioned on my post. and not reachable.

The problem is that I can not find any hint as to why Strapi uses No envmironment variables, nothing.

The following lines in config.server.js

  host: env('HOST', ''),
  port:'PORT', 1337),

tell me that host is either the value of $HOST or
Now $HOST is not set, so host: should be but apparently it is – hence no external access.

Found a solution:
Set env var HOST to, this is picked up by Strapi and then Strapi claims to listen on

This is a bit strange, given the contents of config.server.js which should set a default, but so be it.

Maye this is true for 4.14 only as my instances of 4.15 don’t need this fix, just guessing.