# Setup via LocalHost

This guide will help understand how to install a PlayAI Node on a local Computer or Single Node. There are two major part, first is setting prerequisites to run a node and second is setting up node by running few commands listed in steps. At the end of document there is a demo video of this whole process and what a successful node deployment look like on a machine.

## Setting Environment

### Install Git

Install Git on your system if you haven't already. Verify the installation by running `git --version` in your terminal. Expect an output showing the Git version. [Link](https://git-scm.com/downloads)

```python
Command: git --version 
Expceted Sample output: >> git version 2.39.5 (Apple Git-154)
```

### Install docker

Download and install Docker from the official website. Check the installation with `docker --version`, expecting an output displaying the Docker version. [Link](https://docs.docker.com/engine/install/)

```python
Command: docker --version
Expected Sample Output: >>Docker version 27.0.3, build 7d4bcd8
```

### Install Docker Compose

If not already installed (usually included with Docker Desktop), install it separately. Verify with `docker-compose --version.`

```python
Command: docker-compose --version
Expected Sample Output: >> Docker Compose version v2.28.1-desktop.1
```

If you don’t have it already, go to this [link](https://docs.docker.com/compose/install/) and install.&#x20;

***

## Running PlayAI Node

Now all the dependency part is sorted and we are moving towards the steps to run a PlayAI node. Below is step by steps guide to run a node, which include downloading repo from PlayAI official github page. Make sure to keep node specific values ready that you’ll need in step 4, refer to step 4 for these values

1. Clone the PlayAI Node Client repository using

```python
git clone <https://github.com/PlayAINetwork/PlayAI-Node-Client.git> 
```

2. Navigate to the cloned directory using

```python
cd PlayAI-Node-Client
```

3. **Create and Configure `.env`** add your wallet address, signer key, main server address, and node token ID.
4. Run below command to open file in write mode and paste and setup the below variables then press `CTRL + X` then `Y` and then `Enter` to save this file

```python
nano .env 
```

```python
NODE_WALLET_ADDRESS='xx'
NODE_SIGNER_KEY='xx'
NODE_TOKEN_IDS=[x,x]
```

5. Pulling latest Node Client Containers, you’ll see some logs in the terminal, that confirms that you’re pulling latest container. This step is required to pull latest container, even if you are not setting it first time and you want to pull latest updates just run below command

```python
docker-compose pull 
```

6. Now we have container ready, start the node in detached mode using

```python
docker-compose up -d 
```

7. Check if the node is running using `docker ps`. Expect to see the node container listed

```python
Command: docker ps 
```

Sample output from running this command

<figure><img src="/files/qVW9pTqUnLxh91DhR0Re" alt=""><figcaption></figcaption></figure>

8. Shutting down all services ( Do not use CTRL+C or Command+C to shut down nodes )

```python
docker-compose down 
```

9. To see live logs run below command ( optional ). This will show live logs of what’s happening with node, it will show some requests are coming and something is saving back to our database and all. Which confirm finally that your node is health and running and getting computations requests from our backends

```python
docker-compose logs -f 
```

10. For closing live logs press `ctrl + C`. Don’t use `ctrl + c` to shut down the node service, use docker-compose down only which will remove some of the unnecessary files from last and you’ll have fresh node live whenever you start node again.

***

### Demo Video

{% embed url="<https://www.loom.com/share/1acf117387c14ce9b2530ad5d60207a0?sid=9e4ecfb4-d051-401a-9ec4-0d5bcc0a8460>" %}


---

# 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.playai.network/oasis-nodes/how-to-run-the-node/setup-via-localhost.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.
