# Deploy

By deploying the program, the needed tables will be automatically created or changed (if you're redeploying an existing program) in the Mercury database. Moreover, it will live on our servers and execute the specified logic. If you have specified an `on_close` function it will run for every new ledger close and perform the required operations.&#x20;

Once your program is ready you have to deploy it by running a command with the mercury-cli. It can run with Mainnet or Testnet data.

## Deploy on Mainnet

```sh
mercury-cli --jwt $MERCURY_JWT --local false --mainnet true deploy
```

## Deploy on Testnet

```bash
mercury-cli --jwt $MERCURY_JWT --local false --mainnet false deploy
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mercurydata.app/zephyr-full-customization/learn/get-started-set-up-and-manage-the-project/deploy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
