# Multi environment deployment best practice

**URL:** <https://community.livekit.io/t/multi-environment-deployment-best-practice/755>\
**Category:** Agents\
**Tags:** agent-deployment, livekit-cloud\
**Created:** [April 2, 2026, 3:30am UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755 "2026-04-02T03:30:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinod.kumar.s](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@vinod.kumar.s](https://community.livekit.io/u/vinod.kumar.s)\
**Post date:** [April 2, 2026, 3:30am UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/1 "2026-04-02T03:30:23Z")

</div>

I have 2 projects - one for staging and production. I want to deploy the same agent to staging and production with different secrets.  
What is the recommended best practice? How to deal with multiple livekit.toml files?  
How to automate it in github actions?

---

<div class="post-metadata">

**Author:** ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)\
**Post date:** [April 2, 2026, 1:35pm UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/2 "2026-04-02T13:35:37Z")

</div>

The recommended pattern is one deployment per LiveKit Cloud project, using the same codebase but separate deployments and secrets per environment.

When you run `lk agent create`, a `livekit.toml` is generated and tied to the currently selected default project. For staging and production, link both projects in the CLI and switch with `lk project set-default` before deploying. Each project gets its own deployment and independently managed secrets, as described in the [Agent deployment quickstart](https://docs.livekit.io/deploy/agents/quickstart/).

---

<div class="post-metadata">

**Author:** ![vinod.kumar.s](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@vinod.kumar.s](https://community.livekit.io/u/vinod.kumar.s)\
**Post date:** [April 2, 2026, 4:48pm UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/3 "2026-04-02T16:48:14Z")

</div>

@darryncampbell I am still a bit confused…

1. `lk agent create` would create `livekit.toml`file. Should this file be check in to the repo? Or should this file be created from scratch everytime?
2. If `livekit.toml`should be checked into the repo, how can I check in multiple `toml`files for different projects?
3. For future deployments using `lk agent deploy`, how can I point to the right `toml`file when I have multiple `toml`files?

---

<div class="post-metadata">

**Author:** ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)\
**Post date:** [April 3, 2026, 8:08am UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/4 "2026-04-03T08:08:56Z")

</div>

Sure, so:

1. Create the agent locally
2. Run `lk cloud auth` to authenticate against both your dev and prod cloud projects
3. Deploy the agent to your cloud **dev** environment (`lk agent create`, then select the appropriate cloud project and appropriate secrets / env file - note that the LiveKit URL, Key and Secret in the selected env file should match your cloud dev environment). This creates a livekit.toml file, which you can rename to livekit.toml.dev. This also deploys your agent to dev
4. Deploy the agent to your cloud **prod** environment (`lk agent create`, then repeat the steps above, renaming the resulting livekit.toml to livekit.toml.prod)
5. To redeploy your dev agent run `lk agent deploy –secrets-file <your dev env file> –config <your dev toml file>`
6. To redeploy your prod agent run `lk agent deploy –secrets-file <your prod env file> –config <your prod toml file>`
7. Make sure you don’t have environment variables defined for LIVEKIT\_URL etc. Otherwise these will be picked up in preference to the above. This also means you don’t have to worry about `lk project set-default`

---

<div class="post-metadata">

**Author:** ![vinod.kumar.s](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@vinod.kumar.s](https://community.livekit.io/u/vinod.kumar.s)\
**Post date:** [April 3, 2026, 8:14am UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/5 "2026-04-03T08:14:41Z")

</div>

@darryncampbell That was helpful. Two quick clarification:

1. The environment file should have LIVEKIT\_URL, Key and Secret during `lk agent create`but not during future `lk agent deploy`?
2. Any harm in having them assuming they are no change in their values?

---

<div class="post-metadata">

**Author:** ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)\
**Post date:** [April 3, 2026, 8:27am UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/6 "2026-04-03T08:27:13Z")

</div>

Each project has its own URL, key, and secret so your prod and dev will have unique values, but those will not change (they are associated with the project, not the agent)

---

<div class="post-metadata">

**Author:** ![vinod.kumar.s](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@vinod.kumar.s](https://community.livekit.io/u/vinod.kumar.s)\
**Post date:** [April 3, 2026, 6:04pm UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/7 "2026-04-03T18:04:34Z")

</div>

is there an example of deploying a livekit agent using github action?

---

<div class="post-metadata">

**Author:** ![CWilson](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/cwilson/32/135_2.png) [@CWilson](https://community.livekit.io/u/CWilson)\
**Post date:** [April 3, 2026, 6:57pm UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/8 "2026-04-03T18:57:19Z")

</div>

I think this is what you are looking for:

> **[GitHub - livekit/deploy-action: GitHub plugin to control LiveKit Cloud Agents](https://github.com/livekit/deploy-action)**
>
> GitHub plugin to control LiveKit Cloud Agents

---

<div class="post-metadata">

**Author:** ![vinod.kumar.s](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@vinod.kumar.s](https://community.livekit.io/u/vinod.kumar.s)\
**Post date:** [April 4, 2026, 12:15am UTC](https://community.livekit.io/t/multi-environment-deployment-best-practice/755/9 "2026-04-04T00:15:04Z")

</div>

This is great! I like the [Deploy an existing agent on file change](https://github.com/livekit/deploy-action?tab=readme-ov-file#deploy-an-existing-agent-on-a-file-change) example. Is there a way to specifiy which `toml`file to use in that github action example? I will have multiple `livekit.toml` files, oneper environment. I want to point the github action to the right `toml`file as needed.
