Access an EC2 instance
- Last Updated: April 14, 2026
- 1 minute read
- MarkLogic Server
- Version 12.0
- Documentation
You may need to SSH into an EC2 instance for certain task, such as checking the log files for that instance, as described in Detecting EC2 Errors.
Note:
You cannot SSH to the load balancer, you must SSH to a specific EC2 instance. To SSH into an EC2 instance, you must have the key pair used by the instance downloaded to your local host.
To SSH into an instance, do the following:
-
Open the EC2 Dashboard.
-
Select Instances from the left-hand navigation section.
-
Select the instance to which you want to connect.
-
Click on the Connect button, or select Connect from the Actions pull-down menu.
-
Select A Java SSH Client directly from my browser (Java required). Specify
ec2-useras the User Name, and provide the path to your copy of the key pair you downloaded to your local host. Click Launch SSH Client. -
This will open up a shell window to the EC2 instance. When you first connect in this manner, you may be prompted to create various directories. Respond by clicking
Yesfor each prompt.
Alternatively you can open a shell window and SSH into an instance using the following command:
ssh -i /path/to/keypair.pem ec2-user@<Public DNS>
For example, if your keypair, named newkey.pem, is stored in your c:/stuff/ directory, you can access the instance with a public DNS of ec2-54-242-94-98.compute-1.amazonaws.com as follows:
ssh -i c:/stuff/newkey.pem ec2-user@ec2-54-242-94-98.compute-1.amazonaws.com