Missing 'Open the administration' button when running locally

Hi

I am running Strapi through docker . I can reach the homepage but there is no ‘Open the administration’ button and /admin is a 404

Any clues what I have missed?

Jon

This can help
check inside config/server.js
add the following inside

module.exports = ({ env }) => ({
....
admin: {
    auth: {
      url: env('ADMIN_URL'),
      secret: env('ADMIN_JWT_SECRET'),
    },
  },

be sure to add inside your .env file the variables: ADMIN_URL = "/admin" and a ADMIN_JWT_SECRET = "jwt secret goes here"

hmm, not solved it
my server.js file is:

module.exports = ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  admin: {
  auth: {
      url: '/admin',
      secret: 'werhiui23783r78r373r7g37rg37rg37rg73grfeygey'
    },
  },
});

Still no button
and /admin gives me a 404

I’ll try a clean install and see what that achieves

OK, found the problem. It happens when I use ‘strapi develop --watch-admin’

Here is the output:

There is nothing listening on port 8000 despite the log output.

Attaching to strapi
strapi     | yarn install v1.22.5
strapi     | [1/5] Validating package.json...
strapi     | [2/5] Resolving packages...
strapi     | success Already up-to-date.
strapi     | Done in 1.08s.
strapi     | yarn run v1.22.5
strapi     | $ strapi build
strapi     | Building your admin UI with development configuration ...
strapi     | ℹ Compiling Webpack
strapi     | ✔ Webpack: Compiled successfully in 31.86s
strapi     | Done in 77.09s.
strapi     | yarn run v1.22.5
strapi     | $ strapi develop --watch-admin
strapi     | 
strapi     |  Project information
strapi     | 
strapi     | ┌────────────────────┬──────────────────────────────────────────────────┐
strapi     | │ Time               │ Fri Aug 13 2021 14:12:53 GMT+0000 (Coordinated … │
strapi     | │ Launched in        │ 18213 ms                                         │
strapi     | │ Environment        │ development                                      │
strapi     | │ Process PID        │ 97                                               │
strapi     | │ Version            │ 3.6.6 (node v12.20.1)                            │
strapi     | │ Edition            │ Community                                        │
strapi     | └────────────────────┴──────────────────────────────────────────────────┘
strapi     | 
strapi     |  Actions available
strapi     | 
strapi     | Welcome back!
strapi     | To access the server ⚡️, go to:
strapi     | http://localhost:1337
strapi     | 
strapi     | ℹ 「wds」: Project is running at http://localhost:8000/
strapi     | ℹ 「wds」: webpack output is served from /admin/
strapi     | ℹ 「wds」: Content not from webpack is served from /backend
strapi     | ℹ 「wds」: 404s will fallback to /admin/
strapi     | Starting the development server...
strapi     | 
strapi     | Admin development at http://localhost:8000/admin/
strapi     |  WARNING  Compiled with 5 warnings2:13:37 PM
strapi     | 
strapi     |  warning  
strapi     | 
strapi     | @emotion/memoize
strapi     |   Multiple versions of @emotion/memoize found:
strapi     |     0.7.4 ./~/@emotion/is-prop-valid/~/@emotion/memoize from ./~/@emotion/is-prop-valid/dist/is-prop-valid.browser.cjs.js
strapi     |     0.7.5 ./~/@emotion/memoize from ./~/@emotion/cache/dist/emotion-cache.browser.cjs.js
strapi     | 
strapi     | 
strapi     |  warning  
strapi     | 
strapi     | deepmerge
strapi     |   Multiple versions of deepmerge found:
strapi     |     1.5.2 ./~/react-with-direction/~/deepmerge from ./~/react-with-direction/dist/withDirection.js
strapi     |     2.2.1 ./~/deepmerge from ./~/formik/dist/formik.cjs.development.js
strapi     |     4.2.2 ./~/sanitize-html/~/deepmerge from ./~/sanitize-html/index.js
strapi     | 
strapi     | 
strapi     |  warning  
strapi     | 
strapi     | entities
strapi     |   Multiple versions of entities found:
strapi     |     2.1.0 ./~/markdown-it/~/entities from ./~/markdown-it/lib/common/entities.js
strapi     |     2.2.0 ./~/entities from ./~/entities/lib/index.js
strapi     | 
strapi     | 
strapi     |  warning  
strapi     | 
strapi     | escape-string-regexp
strapi     |   Multiple versions of escape-string-regexp found:
strapi     |     2.0.0 ./~/@sindresorhus/transliterate/~/escape-string-regexp from ./~/@sindresorhus/transliterate/index.js
strapi     |     4.0.0 ./~/@sindresorhus/slugify/~/escape-string-regexp from ./~/@sindresorhus/slugify/index.js
strapi     | 
strapi     | 
strapi     |  warning  
strapi     | 
strapi     | isarray
strapi     |   Multiple versions of isarray found:
strapi     |     0.0.1 ./~/path-to-regexp/~/isarray from ./~/path-to-regexp/index.js
strapi     |     1.0.0 ./~/isarray from ./~/node-libs-browser/~/buffer/index.js
strapi     | 
strapi     | Check how you can resolve duplicate packages: 
strapi     | https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#resolving-duplicate-packages-in-your-bundle
strapi     | 
strapi     | 
strapi     | [2021-08-13T14:13:54.502Z] debug GET index.html (91 ms) 200
strapi     | [2021-08-13T14:13:54.699Z] debug GET /assets/images/logo_login.png (14 ms) 200

As I am running this in Docker, I think this is the problem:
tcp 0 0 0.0.0.0:1337 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN

port 8000 needs to be bound on 0.0.0.0

See here: Bind admin UI to 0.0.0.0 by ScyDev · Pull Request #8573 · strapi/strapi · GitHub
Seems like the config is my answer

1 Like