> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup a Node

> Run a peaq validator node in Docker on a VM that meets the hardware requirements. Sync the chain history and upgrade a running node while keeping its volume.

Your machine has to match the [node hardware requirements](https://docs.peaq.xyz/peaqchain/build/getting-started/connecting-to-peaq.md#node-hardware-requirements). The `c5ad.xlarge` instance from AWS is one machine type that satisfies them.

## Run the node

1. Install Docker on your VM ([how to install Docker on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)).
2. Create and run the container from the validator node image:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
sudo docker run -d -v peaq-storage:/chain-data -p 127.0.0.1:9944:9944 peaq/parachain:peaq-v0.0.113 \
--collator \
--parachain-id 3338 \
--chain ./node/src/chain-specs/peaq-raw.json \
--base-path chain-data \
--port 30333 \
--rpc-port 9944 \
--rpc-methods=unsafe \
--unsafe-rpc-external \
--runtime-cache-size 64 \
--rpc-cors=all \
--out-peers 50 \
--in-peers 50 \
-- \
--port 30343 \
--sync fast \
--rpc-port 9977
```

The RPC port is bound to `127.0.0.1`, so the unsafe RPC methods are only reachable from the VM itself. Never publish port 9944 to the internet while `--rpc-methods=unsafe` is set.

3. Wait until the node syncs with the chain's block history. This takes a few hours, depending on your connection speed.

A fully synced node looks like this:

![validator-2](https://mintcdn.com/peaq/2Vy2W4qW7FfmdArp/assets/img/validator-2.png?fit=max\&auto=format\&n=2Vy2W4qW7FfmdArp\&q=85\&s=6aee1f92610d05c614d3ea119c40a0ff)

## Upgrade a running node

1. Stop your Docker container, keeping the Docker volume.
2. Copy the command above.
3. If you already generated session keys, remove `--unsafe-rpc-external` and `--rpc-methods=unsafe` from it.
4. Run the updated image.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.