title: Connect to EC2 via MongoDB Compass Community
body: <p>I have an EC2 instance (Ubuntu 14). I've defined port 27017 in its security group to be accessed from anywhere.</p>
  
  <p>I'm trying to connect from my PC (Windows 10) to the EC2 instance, but getting the following error:</p>
  
  <blockquote>
    <p>MongoDB not running on the provided host and port</p>
  </blockquote>
  
  <p>which is not true since I've made sure that MongoDB is running.</p>
  
  <p>These were the settings I specified:</p>
  
  <p><a href="https://i.stack.imgur.com/aoRxm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aoRxm.png" alt="enter image description here"></a></p>
  
  <p>I've also tried to use SSH (which is also defined in the sercurity group and works well through terminal), but got the following error:</p>
  
  <blockquote>
    <p>Error creating SSH Tunnel: (SSH) Channel open failure: Connection
    refused</p>
  </blockquote>
  
  <p>These were the settings I specified:</p>
  
  <p><a href="https://i.stack.imgur.com/k8yOk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/k8yOk.png" alt="enter image description here"></a></p>