When starting server in production and navigating to http://0.0.0.0:1337/admin, site cannot be reached error

System Information
  • Strapi Version: 4.7.0
  • Operating System: Windows 10
  • Database: Postgres
  • Node Version: 16.19.1
  • NPM Version: 8.19.3
  • Yarn Version:

When executing the command: NODE_ENV=production npm run start to start server with production settings, it seems to work fine with little errors, and the following message displays:

One more thing…
Create your first administrator :computer: by going to the administration panel at:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ http://0.0.0.0:1337/admin β”‚

However, when navigating to this url, the browser does not load the page. Instead, it displays the error message:

This site can’t be reached

The web page at http://0.0.0.0:1337/admin might be temporarily down or it may have moved permanently to a new web address.

ERR_ADDRESS_INVALID

0.0.0.0 is not the same as local host 0.0.0.0 should be 127.0.0.1 or localhost

2 Likes

Just to expand on this answer.
0.0.0.0 means any IP, while the most significant difference between localhost and 127.0. 0.1 is that there is a need to have a lookup table in case of localhost, while in 127.0. 0.1, we do not need to look up a table somewhere .

1 Like

Thank you both. I used the code snippets from the documentation which is why I have used 0.0.0.0 as part of the host variable.

After changing the APP_HOST/HOST value in the .env file (which contains the environment variables), after rebuilding the server using the command NODE_ENV=production npm run build and after restarting the server by executing the command NODE_ENV=production npm run start, the following message displays:

 Actions available

One more thing...
Create your first administrator πŸ’» by going to the administration panel at:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ http://127.0.0.1:1337/admin β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

This time, when navigating to this url, the browser successfully loads the Strapi Admin page at the link:

http://127.0.0.1:1337/admin/auth/register-admin

Thank you! :slight_smile: :slight_smile: :slight_smile: