Self-host mongo
r9.0.8Document database with replica sets and sharding
docker run --name mongodb -p 27017:27017 -d mongodb/mongodb-community-server:latest- Stars
- 28 681
- CPU
- AVX instruction set
- Port
- 27017 (mongod and mongos client connections)
mongodb/mongodb-community-serverWhat is mongo?
MongoDB is a document-oriented database server, and Community Edition is the free, source-available build that you install and operate yourself; MongoDB, Inc. maintains the source in the mongodb/mongo repository. The two server binaries are mongod, the database server, and mongos, the sharding router.
Instead of fixed tables, applications work with schema-flexible documents and a query API that covers simple lookups as well as complex processing pipelines, with secondary indexing, joins and multi-document ACID transactions in the core server. Replica sets give you replication for high availability, while shard and config-server roles spread data horizontally. Self-managed deployments can use SCRAM or X.509 authentication, enable role-based access control, and encrypt network traffic with TLS. Since version 8.2, Community Edition exposes full-text and vector search aggregation stages for semantic retrieval, hybrid search and RAG without an external search engine, though the MongoDB Search component itself must be installed separately. Encryption at rest, auditing, an in-memory engine and Kerberos, LDAP or OIDC login belong to MongoDB Enterprise or Atlas.
Installation options are packages or tarballs from the MongoDB download center, the mongodb/brew Homebrew tap, or a container: pull the community image and start mongod, which by default listens on port 27017 and keeps its files in /data/db (Linux and macOS). mongosh is downloaded separately as the shell. On x86_64 machines the server needs the AVX instruction set, and arm64 requires ARMv8.2-A or later.
Releases from 16 October 2018 onward are licensed under SSPL v1 (earlier ones under AGPL), so the code is source-available rather than OSI-approved open source; a paid MongoDB Enterprise Advanced subscription brings operational tooling, vendor support around the clock and a commercial license. Fully managed extras such as stream processing and tiered storage exist only in Atlas.
mongo alternatives
arangodbSelf-hosted multi-model database for documents, graphs and key-values, queried in one AQL language; the open-source Community edition is free for non-commercial use.Comparearangodb with mongo
DocumentDBSelf-hosted, open-source MongoDB-compatible document database built on PostgreSQL with native BSON, vector search, and SCRAM authentication.CompareDocumentDB with mongo
Apache CouchDBSelf-hosted, open-source Apache CouchDB is a document database with an HTTP/JSON API, bi-directional replication for offline-first sync, and multi-server clustering.CompareApache CouchDB with mongo
DumboDBDumboDB is a self-hosted, open-source document database with MongoDB 8.0 wire protocol and Git-style version control for data. Runs via Docker or binary.CompareDumboDB with mongo
CouchDBSeamless multi-primary syncing database with an intuitive HTTP/JSON API, designed for reliabilityCompareCouchDB with mongo
neo4jSelf-hosted, open-source graph database: query connected data with Cypher under ACID transactions. Run the free GPLv3 Community Edition via Docker, packages, or Helm.Compareneo4j with mongo
ferretdbOpen-source, self-hosted MongoDB alternative: a proxy that turns MongoDB 5.0+ queries into SQL on PostgreSQL with the DocumentDB extension.Compareferretdb with mongo
RedisRedis is a self-hosted, open-source in-memory data structure server used as a database, cache, message broker, and vector query engine with sub-millisecond latency.CompareRedis with mongo
Should you self-host mongo?
mongo scores 76/100 on selfhost.directory (how scoring works) and ranks #1 of 2 in Document Database. It has 28 681 GitHub stars, +44 in the last 30 days.
There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.
Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is SSPL-1.0-licensed and written mostly in C++.
Its closest alternative on selfhost.directory is ferretdb (67/100, 11 116 stars). mongo scores higher overall. See mongo vs ferretdb side by side.
Features
- Document data model
- Encryption at RestOn self-managed deployments this page describes encryption at rest using MongoDB Enterprise.
- Full-Text SearchThe MongoDB Search component has to be installed separately from the database server.
- Geospatial Queries
- Multi-document ACID transactions
- Query profiling
- Replication / replica sets
- Role-based Access Control
- Sharding
- TLS connection encryption
- Vector Search
mongo README
Welcome to MongoDB!
mongod- The database server.mongos- Sharding router.
- https://www.mongodb.com/try/download/community
- Using homebrew
brew tap mongodb/brew - Using docker image
docker pull mongodb/mongodb-community-server
FAQ
Is Automated Embedding for vector search available in Community Edition?
Native full-text and vector search are free in Community Edition, and the Automated Embedding feature that generates vectors during ingestion and querying is in public preview there.
What environments are supported for search and vector search?
They work on Linux distributions that support MongoDB Community 8.2 or newer, plus in Docker containers and with the Kubernetes Operator; macOS and Windows are not supported.
Are search (full-text) and vector search capabilities available in Community Edition?
Yes, from Community Edition 8.2 onward the database itself supports full-text and vector search, including autocomplete, fuzzy matching, faceting and RAG, without an external search engine.
Should Community Edition be used for an Atlas local development environment?
Community Edition runs locally and can work fully offline, which suits building and testing applications yourself; the Atlas CLI is the tool aimed at creating and managing local Atlas clusters.
Is the MongoDB Community Edition free?
Yes, it is the free-to-use, source-available edition, distributed under the Server Side Public License.
What is the difference between MongoDB Atlas, Enterprise Advanced, and Community Edition?
Atlas is the managed cloud platform that handles infrastructure, backups, patching and scaling, while Enterprise Advanced is the self-managed suite with automation tools, and Community Edition is the free core server. Some capabilities such as auto-scaling, stream processing and federated queries exist only in Atlas.
What is the difference between MongoDB Community Edition and MongoDB Enterprise Advanced?
Enterprise Advanced adds capabilities the community build lacks on self-managed deployments, such as an in-memory storage engine, auditing and Kerberos authentication, plus management tooling, a commercial license and round-the-clock support. Core server capabilities are broadly the same.
More in Document Database
Apache CouchDBSelf-hosted, open-source Apache CouchDB is a document database with an HTTP/JSON API, bi-directional replication for offline-first sync, and multi-server clustering.
arangodbSelf-hosted multi-model database for documents, graphs and key-values, queried in one AQL language; the open-source Community edition is free for non-commercial use.
ArcadeDBOpen-source, self-hosted multi-model database: one ACID engine for graph, document, key-value, vector, full-text and time-series data, queried in SQL, Cypher or Gremlin.
CouchDBSeamless multi-primary syncing database with an intuitive HTTP/JSON API, designed for reliability
ferretdbOpen-source, self-hosted MongoDB alternative: a proxy that turns MongoDB 5.0+ queries into SQL on PostgreSQL with the DocumentDB extension.
KintoOpen-source, self-hosted JSON document store behind an HTTP API with fine-grained permissions and device synchronisation; used at Mozilla for Firefox settings sync.
0 comments