<p>The correct way to do that was to <code>docker exec</code> into the container, and <code>cardano-cli</code> works just fine from there.</p>

CC BY-SA 4.0
2021-06-22T08:50:10.020Z
2021-06-22T08:50:10.020Z
Adam
<p>To run cardano-cli in the container:</p>
<p><code>docker exec -it  -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli</code></p>
<p>So to check the tip:
<code>docker exec -it  -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli query tip --mainnet</code></p>
<p>I put cardano-cli as an alias:
<code>alias cardano-cli='docker exec -it  -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli'</code>. That way you can just invoke the cli as if the cardano-cli was in your PATH.</p>

CC BY-SA 4.0
2021-06-22T10:10:24.897Z
2021-06-22T10:10:24.897Z
Richard Runds
<p>I am running a Cardano node using docker, on the testnet, and now I need to check if it works properly and accepts <code>cardano-cli</code> arguments like querying and what not.</p>
<p>Is there a convenient way to do it?</p>

CC BY-SA 4.0
2021-06-21T18:31:45.693Z
What happens when you enter cardano-cli into the terminal of the docker container running the Cardano node?
jnprogrammer
CC BY-SA 4.0
2021-06-22T08:49:11.607Z
Resolving it, as I reached success with connecting to the docker container and running the queries from there, and everything works fine.
Adam
<cardano-cli><cardano-node>
How can you check if a local node is running properly?
# How can you check if a local node is running properly?

(Asked by: username_0 on 2021-06-21)

I am running a Cardano node using docker, on the testnet, and now I need to check if it works properly and accepts `cardano-cli` arguments like querying and what not.

Is there a convenient way to do it?

**Tags:** cardano-cli, cardano-node
> **Comments:**
> **username_1**: What happens when you enter cardano-cli into the terminal of the docker container running the Cardano node?  
> **username_0**: Resolving it, as I reached success with connecting to the docker container and running the queries from there, and everything works fine.  

---

## 2 answers

### Answer by username_0 on 2021-06-22. Score: 1 | Accepted answer

The correct way to do that was to `docker exec` into the container, and `cardano-cli` works just fine from there.


---

### Answer by username_2 on 2021-06-22. Score: 2

To run cardano-cli in the container:

`docker exec -it -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli`

So to check the tip:
`docker exec -it -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli query tip --mainnet`

I put cardano-cli as an alias:
`alias cardano-cli='docker exec -it -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli'`. That way you can just invoke the cli as if the cardano-cli was in your PATH.


---

