skip to Main Content

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

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search