# Using the docker installation in production

**URL:** <https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359>\
**Category:** Configuring the server\
**Created:** [April 26, 2020, 10:52pm UTC](https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359 "2020-04-26T22:52:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![metaloqui](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@metaloqui](https://forum.keycloak.org/u/metaloqui)\
**Post date:** [April 26, 2020, 10:52pm UTC](https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359/1 "2020-04-26T22:52:17Z")

</div>

Is the Docker installation widely used in production environments?

I experimented with it last week and noted that there were a few gaps in the documentation, so got the impression that the bare metal installation might be the preferred route.

Happy to be corrected if that’s not the case, just looking for some guidance here.

---

<div class="post-metadata">

**Author:** ![zonaut](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zonaut/32/666_2.png) [@zonaut](https://forum.keycloak.org/u/zonaut)\
**Post date:** [April 26, 2020, 11:04pm UTC](https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359/2 "2020-04-26T23:04:41Z")

</div>

I don’t see a problem with using it in production, the standalone-ha.xml can be mounted as do providers and themes.  
What seems to be missing in the documentation for you?

---

<div class="post-metadata">

**Author:** ![metaloqui](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@metaloqui](https://forum.keycloak.org/u/metaloqui)\
**Post date:** [April 26, 2020, 11:13pm UTC](https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359/3 "2020-04-26T23:13:35Z")

</div>

Looking at Getting Started, it tells the user to:

```
docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:9.0.3

```

And then to access the admin console.

But if KeyCloak isn’t accessed via TLS, the administration interface is completely inaccessible, throwing an HTTPS Required error. A quick google and a [stackexchange](https://stackoverflow.com/questions/49859066/keycloak-docker-https-required) article later tells me that this has been the case for at least 18 months. It certainly gives the impression that the Docker route is the less-trodden path.

There’s also no mention of docker on the [server installation guide](https://www.keycloak.org/docs/latest/server_installation/index.html). It’s all bare metal.

---

<div class="post-metadata">

**Author:** ![zonaut](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zonaut/32/666_2.png) [@zonaut](https://forum.keycloak.org/u/zonaut)\
**Post date:** [April 26, 2020, 11:24pm UTC](https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359/4 "2020-04-26T23:24:06Z")

</div>

I’ve just run that docker container exactly like you’ve written it down and I can access it over plain localhost:8080 and enter the admin console. I though I try it because I always run even in development behind https behind an Nginx Docker container. But it works without it.

I guess they give you the basic docker example but obviously that’s not enough by any means.  
Depending on your needs you have to add a lot more than that.  
Maybe this will kick you off, here is an example of a docker compose file [https://github.com/zonaut/keycloak-extensions/blob/master/docker-compose.yml](https://github.com/zonaut/keycloak-extensions/blob/master/docker-compose.yml), it’s not a full production example but you can start from that one and expand it a bit according to your needs.

I can understand why they don’t document everything about this in the manual as you have a lot of flexibility with this. Are you running Kubernetes, Docker swarm and so on, depending on all these use cases you will have different configuration so this is more a community kind of thing.

---

<div class="post-metadata">

**Author:** ![Robinyo](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@Robinyo](https://forum.keycloak.org/u/Robinyo)\
**Post date:** [April 27, 2020, 2:24am UTC](https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359/5 "2020-04-27T02:24:43Z")

</div>

> [@zonaut](#):
>
> Kubernetes

See: codecentric Keycloak Helm [chart](https://github.com/codecentric/helm-charts/tree/master/charts/keycloak)

---

<div class="post-metadata">

**Author:** ![jangaraj](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/jangaraj/32/5175_2.png) [@jangaraj](https://forum.keycloak.org/u/jangaraj)\
**Post date:** [April 27, 2020, 5:14am UTC](https://forum.keycloak.org/t/using-the-docker-installation-in-production/2359/6 "2020-04-27T05:14:35Z")

</div>

> [@metaloqui](#):
>
> Looking at Getting Started, it tells the user to:

See [Keycloak Docker HTTPS required - Stack Overflow](https://stackoverflow.com/questions/49859066/keycloak-docker-https-required/49874353#49874353) for standalone docker run. Default http is good for bigger infrastructure, where TLS off loading is done by loadbalancer/reverse proxy and not by Keycloak.

There is a lot of Docker orchestration tools (Kubernetes, Docker Swarm, Docker compose, Cloud Foundry, Mesos, Nomad, OpenShift, Rancher, AWS ECS, …) and it isn’t in the scope of Keycloak manual to cover all of them. But Keycloak/Docker itself has configuration options to support all of them (Or at least I don’t see any problem).
