Sometimes you are in need to get the Private Key and Certificate from your Laravel Forge server and it's quite straightforward to retrieve the credentials.
First thing first you need to access your Laravel Forge Server.
Step 1: SSH Into your Laravel Forge Server
First thing first you need to access your Laravel Forge Server.
ssh forge@your-ip-address
Step 2: Retrieve it from the NGINX SSL Directory
And once you are logged in you will need to enter into your Nginx configuration. Usually it's located in the following directory
/etc/nginx/ssl/[your-domain-name]/[your-server-id]
Within those directories, you will typically see 2 files which are ".crt" and ".key".
server.crt server.key
To view the certs, you can make use of the cat command.
cat server.crt cat server.key
Hope this snippet helps and happy coding!