Bobcares

Setup Percona Server for MongoDB on Debian or Ubuntu

PDF Header PDF Footer

Master the setup of Percona Server for MongoDB on Debian or Ubuntu. Our MongoDB Support team is ready to answer your questions.

Get Started with Percona Server for MongoDB on Debian or Ubuntu

Get Started with Percona Server for MongoDB on Debian or Ubuntu Percona Server for MongoDB is a powerful, open-source alternative to MongoDB Community Edition. It offers enterprise-grade enhancements such as improved performance, robust security features, and support for hot backups. This makes it an excellent choice for production environments.

If you’re dealing with issues like MongoError: Authentication failed (code 18) during your setup or configuration process, we’ve covered solutions here.

Today, we will walk through the process of installing Percona Server for MongoDB on Debian and Ubuntu using Percona’s official APT repositories.

Prerequisites

Before we begin, we need:

  • A Debian or Ubuntu system (latest versions are supported)
  • Root or sudo user privileges
  • Internet connectivity for downloading the required packages

This tutorial installs MongoDB 8.0 Community Edition.

Step-by-Step Guide

  1. To install Percona Server for MongoDB, we will start by setting up the Percona APT repository. So, download the Percona repository package:
    wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb

  2. UbuntuThen, install the package:
    sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
  3. Once installed, the Percona repositories will be available on the system. We can verify this by checking:
    cat /etc/apt/sources.list.d/percona-release.list
  4. Next, enable the Percona Server for MongoDB repository:
    sudo percona-release enable psmdb-50 release
  5. Now, update the local package cache:
    sudo apt update
  6. Now that the repository is enabled, install the server with:
    sudo apt install percona-server-mongodb

    By default, Percona Server for MongoDB stores data files in `/var/lib/mongodb/` and the configuration file in `/etc/mongod.conf`.

  7. Percona Server for MongoDB starts automatically after installation. If it doesn’t, start it manually:
    sudo systemctl start mongod

    To check the service status, run:

    sudo systemctl status mongod

    To stop the service, run:

    sudo systemctl stop mongod

    We can restart the service with this command:

    sudo systemctl restart mongod

If you plan to use replica sets, make sure to troubleshoot common errors like [ReplicaSetNoPrimary] MongoDB Error, explained in this article.

How to Uninstall Percona Server for MongoDB

If we need to uninstall Percona Server for MongoDB, follow these steps:

  1. Stop the MongoDB service with this command:
    sudo systemctl stop mongod
  2. To remove the packages:
    • To remove only the binaries (keeping config and data files):
      sudo apt-get remove percona-server-mongodb*
    • To remove everything including configuration and data files:
      sudo apt-get purge percona-server-mongodb*

If you’re tuning your MongoDB for performance, particularly around aggregation pipelines, check out our guide on MongoDB Aggregation Performance Tuning.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

With the above steps, we will have Percona Server for MongoDB installed and running on our Debian or Ubuntu system. Don’t forget to enable authentication and configure user access for added security.

In brief, our Support Experts demonstrated how to setup of Percona Server for MongoDB on Debian or Ubuntu.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Get featured on the Bobcares blog and share your expertise with a global tech audience.

WRITE FOR US
server management

Spend time on your business, not on your servers.

TALK TO US

Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!