How to Download Your PEM File in AWS Lightsail

To connect to your Lightsail instance via SSH, you’ll need the default PEM key provided by AWS.

Open Lightsail

Log in to AWS Lightsail and go to the Instances page.

Select your instance

Click on the instance you want to connect to.

Click the “Connect” tab

At the top of the instance page, click the Connect tab.

Download the SSH key

In the Connect section, look for the option to Download default SSH key (PEM file) and save it to your computer.

Store the PEM file somewhere safe — you’ll use it when creating SSH connections or tunnels.

Note: If you’ve previously downloaded a PEM file or replaced it, you may see the Remote Host Identification Has Changed SSH error, in which case follow this tutorial to fix it.