run-rs is a zero-configuration command-line utility designed for spinning up a local MongoDB replica set quickly for development and testing purposes. It eliminates the need for manual MongoDB installations by downloading and managing the MongoDB binaries itself, functioning as a completely self-contained solution. The current stable version is 0.7.7. While there isn't a specified release cadence, the project appears actively maintained with support for various MongoDB versions. A key differentiator is its 'batteries-included' approach, providing a functional replica set with a single command, automatically clearing database data by default for fresh test runs. It supports Linux, macOS, and Windows 10 (via Git Bash/PowerShell).
npm install run-rsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates installing `run-rs` globally, starting a MongoDB 4.0.0 replica set, and immediately connecting a MongoDB shell to interact with it.
Use your machine's actual hostname (e.g., `mongodb://YOUR_HOSTNAME:27017,...?replicaSet=rs`) in your connection string.
Use the `-l` or `--linuxDistro` flag, e.g., `run-rs -v 4.2.0 -l ubuntu1804`.
To preserve data across restarts, use the `--keep` (`-k`) flag: `run-rs --keep`.
For production MongoDB deployments, consider managed services like MongoDB Atlas or a self-managed replica set with proper security and backup configurations.
Replace `localhost` or `127.0.0.1` with your computer's network hostname in the MongoDB connection string.
Install `run-rs` globally using `npm install -g run-rs` or execute it directly via `npx run-rs`.
No dependency data recorded yet.