Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

PostgreSQL and MongoDB Software Collections: Three easy steps to get started

July 28, 2016
Tomáš Repík
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

    In the first part of my series on Software Collections (SCL), I gave general information and listed the three steps needed to get started with SCL for a number of languages. This post covers the steps for PostgreSQL and MongoDB.

    Enable the SCL repository

    The first step is to enable the SCL software repository if you haven't already done so. As the root user run:

    # subscription-manager repos --enable rhel-server-rhscl-7-rpms

    Now onto installing the database software.

    PostgreSQL

    PostgreSQL is a powerful open source, object-relational, ACID compliant, database system. PostgreSQL runs on all major operating systems. Its key features are reliability, data integrity, and correctness. Recently PostgreSQL 9.5 was released as part of Red Hat Software Collections (RHSCL) 2.2. A number of earlier releases (9.2 and 9.4) are also available from RHSCL.

    To install the PostgreSQL 9.5 collection, run the following command as the root user:

    # yum install rh-postgresql95
    

    Now set up PostgreSQL and create the initial database. First use scl enable to add PostgreSQL to the root user's environment, then run setup.

    # scl enable rh-postgresql95 bash
    # postgresql-setup --initdb
    

    Now start the PostgreSQL server and enable it to start up when your system boots:

    # systemctl start rh-postgresql95-postgresql
    # systemctl enable rh-postgresql95-postgresql
    

    To run psql as the postgres user, you need to use su as well as scl enable in order to set up that user's environment.

    # su - postgres -c 'scl enable rh-postgresql95 -- psql'
    

    PostgreSQL software collections as a docker formatted container image

    Last but not least, you can try PostgreSQL 9.5 in a docker container. On Red Hat Enterprise Linux 7, you can get the image with the following commands:

    $ docker pull registry.access.redhat.com/rhscl/postgresql-95-rhel7
    

    More information

    To see what packages were installed  as part of the rh-postgresql95 collection, and what others are available:

    # yum list rh-postgresql95\*
    

    Note: The rh-postgresql95 collection includes the PostgreSQL server components and related client tools that match the specific server version. When building and installing client applications, it is recommended to use the postgresql-libs package available as part of the base Red Hat Enterprise Linux system.

    # yum install postgresql-libs
    

    For more information see:

    • Red Hat Software Collections 2.2 Release Notes
    • Software Collections on developers.redhat.com
    • PostgreSQL.org the upstream, open-source community for PostgreSQL

    MongoDB

    MongoDB is a cross-platform, open-source, document database designed for ease of development and scaling. Recently MongoDB 3.2 was released as part of Red Hat Software Collections (RHSCL) 2.2. A number of earlier releases (2.4, 2.6, and 3.0) are also available from RHSCL.

    To install the MongoDB 3.2 collection, run the following command as the root user:

    # yum install rh-mongodb32 rh-mongodb32-mongodb
    

    Now start the mongod server and enable it to start up when your system boots. First you will need to use scl enable to add MongoDB to the root user's environment:

    # scl enable rh-mongodb32 bash
    # systemctl start rh-mongodb32-mongod
    # systemctl enable rh-mongodb32-mongod
    

    To start using MongoDB, use scl enable to add it to your environment and run a bash shell:

    $ scl enable rh-mongodb32 bash
    

    You can now run the mongo client:

    $ mongo
    

    MongoDB 3.2 software collections as a docker formatted container image

    Last but not least, you can try MongoDB 3.2 in a docker container. On Red Hat Enterprise Linux 7, you can get the image with the following commands:

    $ docker pull registry.access.redhat.com/rhscl/mongodb-32-rhel7
    

    More information

    The collection rh-mongodb32 delivers version 3.2 of the MongoDB server, related client tools, and mongo-java-driver to connect to MongoDB server in Java. To see what packages were installed as part of the rh-mongodb32 collection, and what others are available:

    # yum list rh-mongodb32\*
    

    For more information see:

    • Red Hat Software Collections 2.2 Release Notes
    • Software Collections on developers.redhat.com
    • MongoDB.org, the upstream, open-source community for MongoDB

    Links to other parts:

    Introduction part 1

    Last updated: November 1, 2023

    Recent Posts

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.