Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

virtualpain's avatar

How do I deploy secret key file?

How should I deploy secret key file like Google Cloud key file that is a .json file during deployment. Currently I am using very unsafe method that download the key file I put in some random bucket using hook in the Envoyer each time app being deployed.

0 likes
2 replies
Helmchen's avatar

Why do you not upload it through SSH/SCP/SFTP? too easy? :)

ejdelmonico's avatar

Assuming you are not changing the key often and because of its sensitive nature, I usually ssh into the box and create file with vi outside the site directory so that it doesn't get overwritten or removed during a deployment. For example, placing it right next to the .env file. That is really the easiest way to do it because it usually only happens once for the box.

Please or to participate in this conversation.