7

After pulling run this commands

"docker run -d -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --name mongodb --net mongo-network mongo "

for mongodb and this

"docker run -d -p 8081:8081 -e ME_CONFIG_MONGODB_ADMINUSERNAME=admin -e ME_CONFIG_MONGODB_ADMINPASSWORD=password --net mongo-network --name mongo-express -e ME_CONFIG_MONGODB_SERVER=mongodb mongo-express"

for mongo express after opening the port in my localhost:8081 on server side it is showing that "Turn on admin in config.js to view server stats!" i'm kind of stuck here

Tomáš Šturm
  • 489
  • 4
  • 8
jman
  • 71
  • 1
  • 2
  • What is the error? What do you expect in response? Please be more specific in your problem description. – Maykon Meneghel Feb 26 '22 at 14:01
  • At first I pull the mongodb and mongoexpress image than run it ., by using the following commands . at the localhost:8081 where it suppose to show the server status it's showing that "turn on admin in config.js to view server stats". – jman Feb 26 '22 at 16:46
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 27 '22 at 05:00

2 Answers2

11

Had the same problem. So i went and checked mongo-express-docker Github issue page. Someone raised a question there.

Apparently, mongo-express in docker latest release is 1.0.0-alpha, doesn't have server status, but 0.54.0 had it.

Try: docker pull mongo-express:0.54.0

And then remember to use mongo-express:0.54.0 for whatever you're doing later.

0

I tried adding a tag --restart always. It's working fine for me.

docker network create mongo-network

docker run -d -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --name mongodb --net mongo-network --restart always mongo

docker run -d -p 8081:8081 -e ME_CONFIG_MONGODB_ADMINUSERNAME=admin -e ME_CONFIG_MONGODB_ADMINPASSWORD=password --net mongo-network --name mongo-express -e ME_CONFIG_MONGODB_SERVER=mongodb --restart always mongo-express
Antoine
  • 1,393
  • 4
  • 20
  • 26
Krupa
  • 1
  • 1