{
  "slug": "Problem-with-installing-MongoDB-on-Ubuntu-22-04--and-Mongo-express-is-an-immediate-solution--9b070ba244e",
  "title": "Problem with installing MongoDB on Ubuntu 22.04, and Mongo-express is an immediate solution.",
  "subtitle": "At this time, MongoDB is not supported by Ubuntu 22.04 on their official site.",
  "excerpt": "At this time, MongoDB is not supported by Ubuntu 22.04 on their official site.",
  "date": "2022-08-06",
  "tags": [
    "Node.js",
    "MongoDB",
    "Linux"
  ],
  "readingTime": "2 min",
  "url": "https://medium.com/@mobinshaterian/problem-with-installing-mongodb-on-ubuntu-22-04-and-mongo-express-is-an-immediate-solution-9b070ba244e",
  "hero": "https://cdn-images-1.medium.com/max/800/1*jXM8uV1uzcrT1qf0GQoYrQ.png",
  "content": [
    {
      "type": "paragraph",
      "html": "At this time, MongoDB is not supported by Ubuntu 22.04 on their official site."
    },
    {
      "type": "image",
      "src": "https://cdn-images-1.medium.com/max/800/1*jXM8uV1uzcrT1qf0GQoYrQ.png",
      "alt": "Mongo-express https://hub.docker.com/_/mongo-express",
      "caption": "Mongo-express https://hub.docker.com/_/mongo-express",
      "width": 690,
      "height": 278
    },
    {
      "type": "paragraph",
      "html": "I followed the instruction for installing MongoDB based on Ubuntu 20.04 instructions, but I encountered the bCongratulations! Your article is live on our publication. Do consider submitting more articles. Don’t forget to follow us on <a href=\"https://blog.devops.dev/\" target=\"_blank\" rel=\"noreferrer noopener\">https://blog.devops.dev/</a> &amp; on Twitter (<a href=\"https://twitter.com/devops_blog\" target=\"_blank\" rel=\"noreferrer noopener\">https://twitter.com/devops_blog</a>)rrors."
    },
    {
      "type": "code",
      "lang": "text",
      "code": "The following packages have unmet dependencies: mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.1)\nbut it is not installable mongodb-org-server : Depends: libssl1.1 (>= 1.1.1) but it is not\ninstallable mongodb-org-shell : Depends: libssl1.1 (>= 1.1.1) but it is not installable"
    },
    {
      "type": "paragraph",
      "html": "After researching in internet and following up on MongoDB communication, I found the topic of installing MongoDB on Ubuntu 22.04."
    },
    {
      "type": "paragraph",
      "html": "Suddenly after copying pastes the solution in the MongoDB community tutorial, I encountered other errors."
    },
    {
      "type": "code",
      "lang": "text",
      "code": "The following packages have unmet dependencies: mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.1)\nbut 1.1.0g-2ubuntu4 is to be installed mongodb-org-server : Depends: libssl1.1 (>= 1.1.1) but\n1.1.0g-2ubuntu4 is to be installed mongodb-org-shell : Depends: libssl1.1 (>= 1.1.1) but\n1.1.0g-2ubuntu4 is to be installedE: Unable to correct problems, you have held broken packages."
    },
    {
      "type": "paragraph",
      "html": "I decided to do another thing and come back to the main question. Why do I need to install it directly on my Ubuntu device?"
    },
    {
      "type": "paragraph",
      "html": "<strong>I need to export data from my local machine and import it into the server.</strong>"
    },
    {
      "type": "paragraph",
      "html": "So I decided to use the Web-based MongoDB admin interface, one of the best tools I have seen for MongoDB is Mongo-express."
    },
    {
      "type": "paragraph",
      "html": "I put Mongo-express inside of my docker-compose in local machine and want of DevOps team that put Mongo-express in the stage version of MongoDB."
    },
    {
      "type": "paragraph",
      "html": "finally i wrote docker-compose to access immediately to data."
    },
    {
      "type": "code",
      "lang": "yaml",
      "code": "version: '2'"
    },
    {
      "type": "code",
      "lang": "yaml",
      "code": "services:\n  mongodb:\n    image: docker.io/bitnami/mongodb:5.0\n    ports:\n      - \"27017:27017\"\n    volumes:\n      - 'mongodb_data:/bitnami/mongodb'\n    networks:\n      - backend"
    },
    {
      "type": "code",
      "lang": "properties",
      "code": "mongoex:    image: mongo-express    environment:    - ME_CONFIG_MONGODB_SERVER=mongodb    -\nME_CONFIG_MONGODB_PORT=27017    ports:    - \"8085:8081\"    networks:      - backend    restart:\nalways    depends_on:      - mongodb"
    },
    {
      "type": "code",
      "lang": "text",
      "code": "volumes:  mongodb_data:    driver: local"
    },
    {
      "type": "code",
      "lang": "text",
      "code": "networks:  backend:    external: true"
    },
    {
      "type": "code",
      "lang": "text",
      "code": "external: true"
    },
    {
      "type": "paragraph",
      "html": "As you see in the below image, It has a straightforward interface to import and export data."
    },
    {
      "type": "image",
      "src": "https://cdn-images-1.medium.com/max/800/1*8MvW0s6C5k-HQXBQmdW5Bg.png",
      "alt": "Problem with installing MongoDB on Ubuntu 22.04, and Mongo-express is an immediate solution.",
      "caption": "",
      "width": 1224,
      "height": 553
    }
  ]
}
