# Temporal auto-setup and temporal server

**URL:** <https://community.temporal.io/t/temporal-auto-setup-and-temporal-server/18056>\
**Category:** Server Deployment\
**Created:** [July 30, 2025, 10:11am UTC](https://community.temporal.io/t/temporal-auto-setup-and-temporal-server/18056 "2025-07-30T10:11:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anuragsriv](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/anuragsriv/32/7572_2.png) [@anuragsriv](https://community.temporal.io/u/anuragsriv)\
**Post date:** [July 30, 2025, 10:11am UTC](https://community.temporal.io/t/temporal-auto-setup-and-temporal-server/18056/1 "2025-07-30T10:11:41Z")

</div>

Hi,

We are trying to deploy temporal-server image in our production deployment. But for schema initialization and default namespace, we are still dependent on temporal auto-setup. Our deployment is helm chart based.

I wanted to check what is the recommended way to initialize schema and namespace for temporal server container?

I wonder why temporal server does not come with an optional step to initialize these basic infrastructure for it to run.

Thanks,

Anurag.

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [July 31, 2025, 3:03pm UTC](https://community.temporal.io/t/temporal-auto-setup-and-temporal-server/18056/2 "2025-07-31T15:03:16Z")

</div>

Hi,

> I wanted to check what is the recommended way to initialize schema and namespace for temporal server container?

Depending on the database, you can use one of these tools

- sql [https://github.com/temporalio/temporal/tree/main/tools/sql](https://github.com/temporalio/temporal/tree/main/tools/sql)

- cassandra: [https://github.com/temporalio/temporal/tree/main/tools/cassandra](https://github.com/temporalio/temporal/tree/main/tools/cassandra)

here is some related documentation as well [https://docs.temporal.io/self-hosted-guide/upgrade-server](https://docs.temporal.io/self-hosted-guide/upgrade-server)

For namespace creation, you can use [temporal cli](https://docs.temporal.io/cli) ([temporal operator namespace create …](https://docs.temporal.io/cli/operator)) or the [temporalio/admin-tools](https://hub.docker.com/r/temporalio/admin-tools) image which contains temporal cli.

Antonio

---

<div class="post-metadata">

**Author:** ![Jason\_Walker](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/jason_walker/32/7598_2.png) [@Jason\_Walker](https://community.temporal.io/u/Jason_Walker)\
**Post date:** [August 4, 2025, 12:23pm UTC](https://community.temporal.io/t/temporal-auto-setup-and-temporal-server/18056/3 "2025-08-04T12:23:27Z")

</div>

If I’m understanding that correctly, the concept then would be to build and run temporal-sql-tool from some management station, outside of the Kubernetes cluster, to initialize a database (postgres, in our case) for temporal.

The directions we had been looking involved building temporal-sql-tool to run in a container, and either use a temporal-sql-tool image or a modified version of auto-setup image to run as a Kubernetes job with an on-install and/or pre-upgrade hook.

The complication of using the out-of-box auto-setup image for this is that the auto-setup image never terminates - after running the database and schema setup, it immediately starts running a temporal server, so we have some difficulty detecting in Kubernetes that the setup portion is finished.

I’ve been reading through the documentation and the forum here, but I haven’t found examples of using a Kubernetes job to perform initial setup followed by a normal long-running image of the temporal server - were we looking at the wrong approach there, are new temporal databases generally configured from ‘outside’ of the k8s cluster?

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [August 4, 2025, 5:13pm UTC](https://community.temporal.io/t/temporal-auto-setup-and-temporal-server/18056/4 "2025-08-04T17:13:29Z")

</div>

Hi,

Let me know if this helps [GitHub - temporalio/helm-charts: Temporal Helm charts](https://github.com/temporalio/helm-charts?tab=readme-ov-file#install-with-your-own-postgresql)

You should be able to run `temporal-sql-tool` from [https://hub.docker.com/r/temporalio/admin-tools](https://hub.docker.com/r/temporalio/admin-tools)

Antonio
