# Localnet

## Run a local Clockwork node

To deploy Clockwork on your machine for local development, you must first [**install the CLI**](/welcome/installation.md). When this is done, you can launch a local Clockwork instance with the following command:

```bash
clockwork localnet
```

## Deploy your program

To deploy your own programs to the localnet, you can use either the Anchor CLI, Clockwork CLI, or Solana CLI. As a shortcut, the Clockwork CLI provides a `--bpf-program` flag for deploying the localnet with a pre-built program binary.&#x20;

{% tabs %}
{% tab title="Anchor" %}

```sh
anchor deploy
```

{% endtab %}

{% tab title="Clockwork" %}

```sh
clockwork localnet \
    --bpf-program <ADDRESS_OR_KEYPAIR> <PROGRAM_FILEPATH>
```

{% endtab %}

{% tab title="Solana" %}

```bash
solana program deploy \ 
    --program-id <ADDRESS_OR_KEYPAIR> <PROGRAM_FILEPATH>
```

{% endtab %}
{% endtabs %}

The Clockwork localnet additionally works out of the box with your Anchor tests. To run Anchor tests with the localnet, use the following command:

```sh
anchor test --skip-local-validator
```

## Stream logs

To stream logs from your localnet, you can use the Solana CLI.

```bash
solana logs --url l
```


---

# 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.clockwork.xyz/reference/localnet.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.
