# Install a custom plugin with Kong in a Docker

**URL:** https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859
**Category:** Questions
**Created:** [April 20, 2018, 8:58am UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859 "2018-04-20T08:58:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![i3yaki](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@i3yaki](https://discuss.konghq.com/u/i3yaki)
#### Post date: [April 20, 2018, 8:58am UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859/1 "2018-04-20T08:58:54Z")

</div>

Hello everyone, I’m a student in IT and I am starting with KONG and Docker. That’s why I have some little issues. Is someone would like to answer them ?

I tried to create a custom plugin for Kong. I am not sure about how I did it, but it is working (thanks to hello world plugin example). I did everything on Linux Ubuntu. But now I would like to export this plugin for a Kong contained in a Docker. I followed the instructions for installing the plugin with luarocks but for the last step, I need to add my custom plugin the Kong’s configuration. I don’t know where I can add it and how I can restart Kong to use theses changes.

---

<div class="post-metadata">

### Author: ![kikito](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/kikito/32/15_2.png) [@kikito](https://discuss.konghq.com/u/kikito)
#### Post date: [April 20, 2018, 11:43am UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859/2 "2018-04-20T11:43:20Z")

</div>

Hello i3yaki,

Your question is more related with Docker than with Kong.

The best way to do what you are suggesting is creating your own Dockerfile.

[Kong’s Dockerfile for alpine](https://github.com/Kong/docker-kong/blob/master/alpine/Dockerfile) executes some commands. You need your version of kong to execute one additional command (installing your plugin via `luarocks`).

You could just copy the file I linked above and just add the missing command, and that would probably work, but a more “dockerish” way to do it would be declaring that your dockerfile uses the kong image as a parent image (you do this by using the [FROM](https://docs.docker.com/engine/reference/builder/#from) directive in your Dockerfile) . Then you could add the luarocks command to install your plugin. You would then have to use that Dockerfile to run kong instead of the default one.

---

<div class="post-metadata">

### Author: ![i3yaki](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@i3yaki](https://discuss.konghq.com/u/i3yaki)
#### Post date: [April 23, 2018, 2:48pm UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859/3 "2018-04-23T14:48:26Z")

</div>

Thanks for the answer, I’ll try it after some changes in my plugins. 🙂

---

<div class="post-metadata">

### Author: ![Prashant\_Shandilya](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/prashant_shandilya/32/805_2.png) [@Prashant\_Shandilya](https://discuss.konghq.com/u/Prashant_Shandilya)
#### Post date: [March 28, 2019, 2:38pm UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859/4 "2019-03-28T14:38:10Z")

</div>

I was looking for the way to install already available custom pligins such as kong-spec-expose on top of default kong docker image

---

<div class="post-metadata">

### Author: ![Santokh\_Singh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/santokh_singh/32/924_2.png) [@Santokh\_Singh](https://discuss.konghq.com/u/Santokh_Singh)
#### Post date: [August 8, 2019, 5:16pm UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859/5 "2019-08-08T17:16:01Z")

</div>

I use Kong Docker Image with docker bind mount volumes to link my custom plugins and ZeroBrane Studio for debugging and development

---

<div class="post-metadata">

### Author: ![Monir](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Monir](https://discuss.konghq.com/u/Monir)
#### Post date: [September 22, 2021, 2:18am UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859/6 "2021-09-22T02:18:43Z")

</div>

Is there any update on that? Could you please share your experience regarding custom plugin?

---

<div class="post-metadata">

### Author: ![fomm](https://avatars.discourse-cdn.com/v4/letter/f/ea666f/32.png) [@fomm](https://discuss.konghq.com/u/fomm)
#### Post date: [September 22, 2021, 3:21am UTC](https://discuss.konghq.com/t/install-a-custom-plugin-with-kong-in-a-docker/859/7 "2021-09-22T03:21:56Z")

</div>

If you are trying to install Lua plugin, you can check this video

[![](https://img.youtube.com/vi/yMbTvCbR3Vs/maxresdefault.jpg "How to use third party Lua plugin with Kong") ](https://www.youtube.com/watch?v=yMbTvCbR3Vs)
