Port 27017 (MongoDB) — What It Is and How to Use It

Port 27017 is the default TCP port used by the MongoDB database server for client connections. It is crucial for applications to communicate with and manage MongoDB instances, making it a central point for data access and manipulation within a MongoDB deployment.

Last updated: 2026-06-11

RECOMMENDED

Gear Up: Mechanical Keyboards for Developers

Reduce fatigue and type faster with premium mechanical keyboards. Check out top picks for software engineers.

Shop Developer Gear →
Port Number 27017
Protocol MongoDB

Common Use Cases

  • Client applications connecting to a MongoDB database to perform CRUD operations (Create, Read, Update, Delete).
  • MongoDB shell (mongo) connecting to a MongoDB instance for administrative tasks and data exploration.
  • MongoDB drivers (e.g., Node.js, Python, Java) establishing connections to a MongoDB server.
  • MongoDB Compass (GUI tool) connecting to a MongoDB database.

Interactive Command Builder

nc -zv example.com 27017

Check if Port 27017 is Open

sudo netstat -tulnp | grep 27017
netstat -ano | findstr :27017
⚠️ Security Note: Leaving port 27017 open to the internet without proper authentication and access control is a significant security risk, as it can expose your entire database to unauthorized access and data breaches. It is highly recommended to restrict access to trusted IP addresses or use a firewall.

Related Ports

Frequently Asked Questions

Is port 27017 dangerous to leave open?

Yes, leaving port 27017 open to the public internet without strong authentication and IP whitelisting is extremely dangerous. It can lead to unauthorized access, data theft, and even data destruction.

What service uses port 27017?

Port 27017 is the default port used by the MongoDB database server for client connections.