Posts Learn Components Snippets Categories Tags Tools About
/

How to Retrieve Certificate and Private Key from Laravel Forge Server

Get to know how to retrieve certificate and private key from Laravel Forge server the easy way

Created on Jul 25, 2022

520 views

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.

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!

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️

)