TCPRegistered PortFirewall: Usually Closed
27018

MongoDB Shard Server

What is Port 27018?

Port 27018 is the default port for MongoDB shard servers (mongod instances running with --shardsvr flag). In a sharded MongoDB cluster, data is distributed across multiple shard servers, each holding a subset of the data. When MongoDB is configured for sharding, the shard server instances listen on port 27018 instead of the default 27017. Sharding enables MongoDB to scale horizontally across multiple machines, handling datasets and query volumes that exceed the capacity of a single server. The mongos router process connects to shard servers on port 27018 to route queries to the appropriate shards.

Common Uses

  • MongoDB sharded cluster shard instances
  • Horizontal data distribution
  • Large-scale MongoDB deployments
  • High-throughput database operations

Technical Details

Port Number27018
ProtocolTCP
CategoryRegistered
Service NameMongoDB Shard Server
Default FirewallUsually Closed
Port Test Commands

Copy-paste commands to check port 27018 (MongoDB Shard Server) from your terminal

Test connectivity

Netcat (nc)Check if TCP port is reachable
nc -zv example.com 27018
curl (HTTP)Test HTTP response on this port
curl -v --max-time 5 http://example.com:27018/
TelnetBasic TCP port connectivity check
telnet example.com 27018
nmapScan port 27018 with service detection
nmap -p 27018 -sV example.com
Bash /dev/tcpPure bash TCP check (no extra tools needed)
(echo > /dev/tcp/example.com/27018) 2>/dev/null && echo "open" || echo "closed"

Open port in firewall

UFW (Ubuntu / Debian)
sudo ufw allow 27018/tcp
iptables
sudo iptables -A INPUT -p tcp --dport 27018 -j ACCEPT
firewalld (RHEL / CentOS)
sudo firewall-cmd --permanent --add-port=27018/tcp && sudo firewall-cmd --reload

Security Considerations

!

Apply the same security measures as port 27017. Enable authentication and TLS. Restrict access to mongos routers and config servers only. Implement keyFile or x.509 authentication for internal cluster communication. Monitor for unauthorized access to shard data.

Popular Ports Reference

The most commonly used and referenced network ports

Related Ports