Never expose to the internet

Port 27017 — MongoDB

Default MongoDB database port.

Port
27017
Service
MongoDB
Protocol
TCP

Security guidance

Older versions had no authentication by default and thousands were ransomed. Bind to localhost and enable authentication.

Test port 27017 yourself

From your own machine, against any host (swap in your domain):

macOS / Linux — netcat

nc -vz example.com 27017

Any OS — nmap

nmap -p 27017 example.com

Windows — PowerShell

Test-NetConnection example.com -Port 27017

open = a service answered on port 27017; closed = the host replied but nothing is listening; filtered = a firewall silently dropped the probe. These test from your network — our port checker tests from the outside, the view that matters for security.

Is port 27017 open on your server?

Test it from outside your network — the only view that matters.

Check port 27017