# 4.2 Your First Program Deployment

Let's deploy the token program we developped in last module. First you need to update the program id to make sure no other program deployed with that program id exists already.

You can check by typing your program id `your_token_example_123.aleo` in the seach bar of one of the Aleo block explorers:

* [Provable Explorer](https://testnet.explorer.provable.com/)
* [Aleoscan](https://testnet.aleoscan.io/)
* [Aleo123](https://testnet.aleo123.io/)
* [Aleo.Info](https://testnet.aleo.info/)

If a program with that ID exists already, you should update your program's ID:

1. At the top of your Leo file, when defining the program:

   ```rust
   program your_token_example_123.leo {
   ```
2. In the `program.json` file at the root of your project:

   ```json
     "program": "your_token_example_123.aleo",
   ```

{% hint style="warning" %}
Make sure to use a program ID with more than 10 characters, less than that and you will have to pay an extra namespace fee that can be pretty high an make the deploy transaction fail.
{% endhint %}

Once you have made sure your program ID does not exist yet, you must set a private key for an Aleo wallet with funds to pay for the deployment fees. For that you need to extract your private key from your Leo Wallet by following [those steps.](https://help.leo.app/hc/en-us/articles/26027641632788-How-do-I-access-my-Private-Key)

Then, set your private key in `.env` file at root of your Leo application

```
PRIVATE_KEY="PASTE_PRIVATE_KEY_HERE"
NETWORK="testnet"
ENDPOINT=https://api.explorer.provable.com/v1
```

Deploy the program using the leo CLI

```
leo deploy
```

You should have seen a confirmation that your Aleo application was deployed in the form of a transaction ID that looks like the following `at1rkkpqu5k4rt86zzccczw6cxeyvrl7hxydvvv7dhl7zr7p9w40c8s70kwm8`.&#x20;

Paste your transaction ID to view the details of your deployment transaction on one of the Aleo chain explorers above.

## Optinal arguments

* `--record`: Record to pay for fee privately. If one is not specified, a public fee will be taken.
* `--dry-run`: To just generate a test transaction without submitting it to the network.

{% hint style="info" %}
If you want to deploy on another network like mainnet, just update the NETWORK parameter for the .env file at the root of your projet.
{% endhint %}

## Fee

Here's a breakdown for the fee for a deployement transaction:

* **Transaction Storage** - Storing your program's instructions on the ledger.
* **Program Synthesis** - Generating proving and verifying fee for your program.
* **Namespace** - Paying a premium for special names, each letter below 10 characters is exponentially  more expensive.
* **Priority Fee** - Making sure your transaction gets included when there are multiple other competitors in the memepool.
