# Percona Docker Create a key

**URL:** <https://forums.percona.com/t/percona-docker-create-a-key/8803>\
**Category:** Percona Server for MongoDB\
**Created:** [January 15, 2021, 11:19am UTC](https://forums.percona.com/t/percona-docker-create-a-key/8803 "2021-01-15T11:19:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Cardinali](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/marco_cardinali/32/2560_2.png) [@Marco\_Cardinali](https://forums.percona.com/u/Marco_Cardinali)\
**Post date:** [January 15, 2021, 11:19am UTC](https://forums.percona.com/t/percona-docker-create-a-key/8803/1 "2021-01-15T11:19:34Z")

</div>

Hello  
I’m not able to create a key in order to enable the encryption,  
since I have pulled the image and run the container.  
Do I have to modify the docker file or there is another solution?

---

<div class="post-metadata">

**Author:** ![Marco\_Cardinali](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/marco_cardinali/32/2560_2.png) [@Marco\_Cardinali](https://forums.percona.com/u/Marco_Cardinali)\
**Post date:** [January 15, 2021, 6:11pm UTC](https://forums.percona.com/t/percona-docker-create-a-key/8803/3 "2021-01-15T18:11:09Z")

</div>

Hi @matthewb thanks for your answer but I’m talking about mongodb, since we are in the right place I assume.  
Anyway I pulled the image from [Running Percona Server for MongoDB in a Docker Container — Percona Server for MongoDB 5.0 Documentation](https://www.percona.com/doc/percona-server-for-mongodb/LATEST/install/docker.html)  
but now I have to enable the encryption and I don’t know how to set the key into the container

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 15, 2021, 7:13pm UTC](https://forums.percona.com/t/percona-docker-create-a-key/8803/4 "2021-01-15T19:13:02Z")

</div>

I’m sorry. You are right, I was not paying attention to the forum category. I deleted my reply.

You can set the config options directly in mongo’s config file:  
[https://www.percona.com/doc/percona-server-for-mongodb/LATEST/data\_at\_rest\_encryption.html](https://www.percona.com/doc/percona-server-for-mongodb/LATEST/data_at_rest_encryption.html)

Or pass the options directly to mongo when launching the container:

> You can pass arbitrary command line options to the server by appending them to the `run command` :
> 
> docker run --name my-container-name -d percona/percona-server-mongodb --option1=value --option2=value
