# How to easily deploy a temporal server cluster in production？

**URL:** <https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972>\
**Category:** Community Support\
**Tags:** production\
**Created:** [September 20, 2021, 1:22pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972 "2021-09-20T13:22:09Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [September 20, 2021, 1:22pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/1 "2021-09-20T13:22:09Z")

</div>

Dear developers, I am an architect of a banking system. I am trying to use temporal in a new system and consider promoting it. In the development environment, I directly use docker-compose to deploy a single-node temporal server, and it works normal.

The current confusion is how do I deploy a distributed temporal server cluster in a production environment. If I deploy multiple docker-compose nodes like a development environment, is it feasible to implement load balancing through domain name resolution? Can multiple servers share the same database?

I learned that Temporal contains 4 modules, and the official recommendation is to deploy these four modules separately, but I did not find specific documents for this kind of solution. And I don’t want the deployment plan to be too complicated because my system does not have too high throughput.

I hope to get help here, thank you.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [September 20, 2021, 7:20pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/2 "2021-09-20T19:20:18Z")

</div>

Hi @guofeng, were you able to go through info in the docs:

> **[Temporal Server self-hosted production deployment | Temporal documentation](https://docs.temporal.io/docs/server/production-deployment/)**
>
> Overview

and

> **[Configure the Temporal Server | Temporal documentation](https://docs.temporal.io/docs/server/configuration/)**
>
> Temporal Server configuration is found in development.yaml and may contain the following possible sections:

Would be nice to know what’s missing there that would help you move forward with deploying Temporal in your particular desired setup

---

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [September 21, 2021, 5:04am UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/3 "2021-09-21T05:04:10Z")

</div>

Hi tihomir,thanks for your reply, these documents are useful and I got some information from them, but I think there should be a step by step demo, I see a lot of similar questions in the forum and it is hard to know clearly how a distributed cluster should be deployed based on the available information.

For example, if I deploy multiple Temporal clusters how do I handle inter-cluster communication or data synchronization. Will multiple clusters sharing a single datastore cause conflicts. And so on.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [September 21, 2021, 3:37pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/4 "2021-09-21T15:37:38Z")

</div>

@guofeng thanks for the recommendations!  
In addition to the links in the previous post Temporal also provides helm charts repo: [GitHub - temporalio/helm-charts: Temporal Helm charts](https://github.com/temporalio/helm-charts)  
and a set of Docker compose files: [GitHub - temporalio/docker-compose: Temporal docker-compose files](https://github.com/temporalio/docker-compose)

If I may add a bit of constructive feedback, it is very hard to provide specific advice on a particular deployment when details of the deployment are not mentioned in the question 🙂 Note that Temporal is open source and as you have mentioned there are many users that have managed to deploy it in different environments. Providing specific information about your deployment environment and strategies and errors you are running into would allow the community to get a better idea and provide help based on your specific needs.

---

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [September 22, 2021, 8:43am UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/5 "2021-09-22T08:43:45Z")

</div>

Dear tihomir, this is my deployment vision, do you think it can be achieved? Or do you have any suggestions?

 ![未命名文件](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/e/e7ee472f65a7ed62b46eca732e542fd5388413f0.png)

---

<div class="post-metadata">

**Author:** ![Wenquan\_Xing](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wenquan_xing/32/362_2.png) [@Wenquan\_Xing](https://community.temporal.io/u/Wenquan_Xing)\
**Post date:** [September 22, 2021, 5:05pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/6 "2021-09-22T17:05:44Z")

</div>

i would make 2 suggestions:

1. try to deploy the service, one service per docker / k8s pod, i.e.

- docker / k8s pod 1 only run frontend
- docker / k8s pod 2 only run matching
- docker / k8s pod 3 only run history
- docker / k8s pod 4 only run worker

1. either make sure the mysql replication (DB layer replication) is strong consistent, or try not to use it. Temporal depends on DB being strong consistent.

---

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [September 23, 2021, 1:41am UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/7 "2021-09-23T01:41:41Z")

</div>

Thank you, but I want to ensure high availability in two data center. This is a regulatory requirement, there are at least two available services.

---

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [September 23, 2021, 3:29am UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/8 "2021-09-23T03:29:53Z")

</div>

@Wenquan_Xing If I run multiple Temporal Server clusters at the same time and let them user the same database, will there be data conflicts? This is the only problem that hinders me at the moment.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [September 23, 2021, 4:52pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/9 "2021-09-23T16:52:45Z")

</div>

Temporal will make sure that data is not corrupted, but such setup will not be functional as these services will be stealing shards from each other all the time. So it will be 100 times slower than a single cluster setup.

---

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [January 19, 2022, 1:36pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/10 "2022-01-19T13:36:38Z")

</div>

Dear maxim, It’s been a long time coming, but I’m still trying. May I ask what program you suggest? Here are the needs I want to satisfy.  
1, Do not use k8s, but will use docker  
2, Have two clusters that are alive at the same time and share one database.  
3, Make sure that after one cluster is physically down, the Client can continue to get work from the other surviving cluster.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [January 19, 2022, 1:39pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/11 "2022-01-19T13:39:11Z")

</div>

1. K8s is not required to run Temporal
2. Not supported. I’m not sure what you are trying to achieve here. 99% of outages are caused by DB unavailability. So having a single DB is not going to increase your availability much.
3. Not supported. And as I pointed in (2) not really useful.

---

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [January 19, 2022, 1:42pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/12 "2022-01-19T13:42:52Z")

</div>

Our mysql cluster is already highly available through master-slave replication, so if the application is also highly available, then we don’t have to worry about downtime failures.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [January 19, 2022, 1:43pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/13 "2022-01-19T13:43:53Z")

</div>

AFAIK mysql master-slave is not fully consistent during failover events. Temporal cannot function on top of non fully consistent DB.

---

<div class="post-metadata">

**Author:** ![guofeng](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@guofeng](https://community.temporal.io/u/guofeng)\
**Post date:** [January 19, 2022, 1:53pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/14 "2022-01-19T13:53:56Z")

</div>

Ok, thank you. Let me ask another question: how do I specify the development.yaml that I need to use when I build the docker image？

---

<div class="post-metadata">

**Author:** ![Selva](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/selva/32/5361_2.png) [@Selva](https://community.temporal.io/u/Selva)\
**Post date:** [May 18, 2024, 9:56pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/15 "2024-05-18T21:56:05Z")

</div>

@guofeng Just curious to know, How did you solve the HA with different DC? I am also looking for similar solution. We wouldn’t have much time to build another DC after the current DC is gone. As it would be our tier 0 application. It should be fail over with in 5 mins of DC failure

---

<div class="post-metadata">

**Author:** ![Selva](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/selva/32/5361_2.png) [@Selva](https://community.temporal.io/u/Selva)\
**Post date:** [May 18, 2024, 10:07pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/16 "2024-05-18T22:07:21Z")

</div>

Looks like its improved from 2022 - [Self-hosted Multi-Cluster Replication | Temporal Documentation](https://docs.temporal.io/self-hosted-guide/multi-cluster-replication?_ga=2.137076144.1253098822.1715719243-1784881787.1715719243)

Thanks. Will take a look at the replication solution

---

<div class="post-metadata">

**Author:** ![maki\_XIE](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maki_xie/32/2040_2.png) [@maki\_XIE](https://community.temporal.io/u/maki_XIE)\
**Post date:** [July 22, 2024, 3:38am UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/17 "2024-07-22T03:38:00Z")

</div>

> **[27.2. Log-Shipping Standby Servers](https://www.postgresql.org/docs/current/warm-standby.html#SYNCHRONOUS-REPLICATION)**
>
> 27.2. Log-Shipping Standby Servers # 27.2.1. Planning 27.2.2. Standby Server Operation 27.2.3. Preparing the Primary for Standby Servers 27.2.4. Setting Up …

The primary-backup of postgres should work with sync-replication mode, and guess mysql should have a similar thing like this.

---

<div class="post-metadata">

**Author:** ![mikael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikael](https://community.temporal.io/u/mikael)\
**Post date:** [February 18, 2025, 4:29pm UTC](https://community.temporal.io/t/how-to-easily-deploy-a-temporal-server-cluster-in-production/2972/18 "2025-02-18T16:29:10Z")

</div>

hello guys… I am ruuning tempporal with docker-compose on ec2 instance but i have difficulties running/deploying workflows as i cannot figure out the connection to the containers on ec2 to create workflows and workers… i am pretty new to this, i need help
