- Port
- 27017
- Protocol used by the service
- TCP
- Encryption
- Varies by configuration
- IANA description
- Mongo database system
- IANA service name
- mongodb
Note: IANA also lists other, unrelated entries for port 27017 on a different protocol — 27017/udp — Reserved. This is not part of MongoDB itself.
What port 27017 is used for
Default listener port for MongoDB, a document-oriented NoSQL database.
Is port 27017 encrypted?
Supports TLS encryption, but it must be explicitly enabled — MongoDB has historically shipped with no authentication required by default in many deployment paths.
Firewall & exposure considerations
Security researchers have repeatedly documented automated extortion campaigns against exposed, unauthenticated MongoDB instances, wiping data and demanding ransom (see References below for recent reporting). Never expose directly; require authentication and restrict network access.
Common questions about port 27017
Is MongoDB reachable from other machines by default?
Not with the default configuration. MongoDB's documentation states that mongod and mongos bind to localhost by default, so they only accept connections from clients on the same computer until they are told to bind to other addresses, for example 0.0.0.0, or with the net.bindIpAll setting or the --bind_ip_all option. The same page warns that you should make sure mongod and mongos are only accessible on trusted networks and, if the system has more than one network interface, bind them to the private or internal one.
Do shard servers and config servers use port 27017?
Not by default. MongoDB's documentation lists 27017 for mongod and mongos, 27018 for a mongod started as a shard server (--shardsvr), and 27019 for one started as a config server (--configsvr). Port 27020 is the default for mongocryptd, which ships with MongoDB Enterprise.
What does MongoDB recommend before exposing it to a network?
MongoDB's Security Checklist for self-managed deployments starts with enabling access control and enforcing authentication. It also asks you to run MongoDB in a trusted network environment, use firewalls or security groups to control inbound and outbound traffic, and review changes to network rules to prevent inadvertent exposure to the internet.
Related ports
References
- MongoDB Documentation: Default MongoDB Port
- BleepingComputer: Exposed MongoDB Instances Still Targeted in Data Extortion Attacks
- IANA registration for port 27017
- MongoDB Documentation: IP Binding in Self-Managed Deployments
- MongoDB Documentation: Security Checklist for Self-Managed Deployments
Look up any other port
Search the full IANA registry — all 6,100+ ports and 12,500+ protocol-specific records — on the Port Lookup tool.
Last reviewed: . Data source: IANA Service Name and Transport Protocol Port Number Registry. Security and usage notes are this site's own editorial content, not official IANA data.