# Run a Node with Docker

This guide outlines the process of setting up and operating a KUB node using [Docker](https://docs.docker.com/engine/install/). Docker provides a streamlined and efficient method for running KUB Mainnet nodes, including [Validator Node](/run-a-kub-node/run-a-validator-node.md), [Full Node](/run-a-kub-node/run-a-full-node.md), and [Archive Node](/run-a-kub-node/run-an-archive-node.md) configurations.

## Core Components

Running a KUB node using Docker is designed to simplify node deployment by providing pre-configured [Docker Compose](https://docs.docker.com/compose/install/) setups. It encapsulates all the essential services required to run various types of KUB Mainnet nodes, ensuring a quick and reliable deployment.

## Prerequisites

Before you begin, ensure you have the following software installed on your system:

* [Docker](https://docs.docker.com/engine/install/): A platform for developing, shipping, and running applications in containers.
* [Docker Compose](https://docs.docker.com/compose/install/): A tool for defining and running multi-container Docker applications.

## Getting Started

### Initial Setup

To initiate the node deployment, you'll first need to clone the [`bkc-node-docker`](https://github.com/kub-chain/bkc-node-docker) repository and navigate into the `mainnet` directory, which contains the specific configurations for the KUB Mainnet.

```sh
git clone https://github.com/kub-chain/bkc-node-docker
cd bkc-node-docker/mainnet
```

### Node Configuration Approach

Unlike some other blockchain node setups that rely on `.env` files for configuration, `bkc-node-docker` adopts a different strategy. It provides distinct `docker-compose` files tailored for each node type.

This approach simplifies configuration by allowing you to select the appropriate `docker-compose` file directly when launching your node, eliminating the need for extensive environment variable management.

### Launching Your KUB Node

Once you've successfully navigated to the `bkc-node-docker/mainnet` directory, you can proceed to launch your desired KUB node type using the respective Docker Compose command. These commands will start the node services in the background, allowing them to run continuously.

{% tabs %}
{% tab title="Validator Node" %}

```sh
docker compose -f docker-compose.validator.yaml up -d
```

{% endtab %}

{% tab title="Full Node" %}

```sh
docker compose -f docker-compose.fullnode.yaml up -d
```

{% endtab %}

{% tab title="Archive Node" %}

```sh
docker compose -f docker-compose.archivenode.yaml up -d
```

{% endtab %}
{% endtabs %}

## Managing Your KUB Node

Docker Compose provides robust tools for interacting with and managing the various containers that comprise your KUB node.

### Monitoring Node Status

The [`bkc-node-docker`](https://github.com/kub-chain/bkc-node-docker) setup includes integrated monitoring solutions to help you keep track of your node's health and synchronization progress.

### **Grafana Monitoring Dashboard**

A Grafana dashboard is available for detailed monitoring and visualization of your node's metrics. Access it by navigating to [`http://localhost:8080`](http://localhost:8080/) in your web browser.

* **Default Username**: `admin`
* **Default Password**: `admin`

### **Stats Dashboard**

For a more concise overview of your node's operational statistics, you can access the Stats Dashboard at [`http://localhost:8090`](http://localhost:8090/) in your browser.


---

# 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.kubchain.com/run-a-kub-node/run-a-node-with-docker.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.
