---
title: "Private Key Storage for External Services"
date: "2022-02-10T12:32:30+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/93121-private-key-storage-external-services"
id: "80893266-9346-47ad-afd5-fcb217bbb40d"
---

**How-To Section**  
  
If you are connecting to an external service or are setting up SimpleSAML and need to store a private key in a persistent and secure location, it's recommended to create a directory off your home directory. In the example below, we use a directory named "private\_keys", but you can change the name to best suit your needs:

_Replace \[SITENAME\] with your application's site name._

    /home/[SITENAME]/private_keys

**Warning**

Never add your private key to your code repository, as this can pose a security risk.

To create a directory off your home directory:

1.  [SSH into your server](https://docs.acquia.com/cloud-platform/manage/ssh/enable/)
2.  Change directory to your home directory:
    
        cd /home/[SITENAME]
    
3.  Create the directory:
    
        mkdir private_keys
    

  
Once the directory is created, double check the [permission](https://acquia.my.site.com/s/article/360005849373-File-permissions-while-using-Acquia-Cloud)  of the directory to ensure they meet your requirements using [ls -lah](https://explainshell.com/explain?cmd=ls+-lah+file.ext) .