For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

Install MongoDB Community on Linux

Select your distribution to view installation instructions for MongoDB Community Edition.

Package
Distribution

Note

By default, MongoDB Community Edition does not include MongoDB Search. To use MongoDB Search with MongoDB Community, you must install MongoDB Search with Docker or Linux separately.

1

To connect to your deployment, run mongosh:

mongosh

The command connects to MongoDB Community through the default address: mongodb://localhost:27017.

2

To check the status of MongoDB, run the serverStatus command:

db.runCommand( { serverStatus: 1, none: 1, mem: 1 } )
{ host: '<hostname>', version: '9.0.4', process: 'mongod', pid: Long('71115'), uptime: 61, uptimeMillis: Long('61213'), uptimeEstimate: Long('61'), localTime: ISODate("2026-10-27T16:39:04.046Z"), ok: 1, '$clusterTime': { clusterTime: Timestamp(1793119144, 1), signature: { hash: Binary.createFromBase64('AAAAAAAAAAAAAAAAAAAAAAAAAAA=', 0), keyId: Long('0') } }, operationTime: Timestamp(1793119144, 1)}

After you install MongoDB Community Edition, you can:

In addition to the standalone instance, you can deploy multiple instances of MongoDB Community Edition to form clusters:

  • Replica Sets provide redundancy to maintain high availability, making your cluster resilient in cases of network partitions and other system failures.

    For details, see Deploy a Self-Managed Replica Set.

  • Sharded Clusters allow you to horizontally scale capacity, balancing collection data across multiple MongoDB instances or replica sets.

    For details, see Deploy a Self-Managed Sharded Cluster.

Important

Do not use these instructions to upgrade to another release version.

For general guidance on MongoDB version numbering, release types, and upgrade paths, see MongoDB Versions and Upgrade Paths.