> For the complete documentation index, see [llms.txt](https://docs.klyntar.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.klyntar.org/build-core-and-join-network/networks/testnet/your-own-private-testnet/netrunner-and-pm2.md).

# Netrunner and PM2

## Using PM2 for production management

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

PM2 allows you to run services in the background, monitor server resource usage, write logs, and more.

{% hint style="info" %}
**PM2 is the recommended way to run and maintain a node (regular and validator) for Klyntar**
{% endhint %}

To run & work with a testnet you can use these simple commands:

## 1. Start a testnet in a single command:

```
pm2 start runner2.js
```

## 2. Check the active background services

You will see the following

<figure><img src="/files/7m0XOT2ApWGAiaAomT4y" alt=""><figcaption></figcaption></figure>

## 3. Enter monitoring dashboard

```
pm2 monit runner2
```

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

## 4. Read the logs stream

```
pm2 logs runner2
```

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

## 5. Read last N lines of logs from stdout / stderr streams (`nostream` mode)

```
pm2 logs --lines <N> --nostream runner2
```

{% hint style="info" %}

#### Reading logs available even if the service was stopped - so it's useful to understand reasons of downtimes and so on

{% endhint %}

## 6. Stop a testnet

```
pm2 stop runner2
```

{% hint style="info" %}

#### When you stop the testnet and then run it again - the progress will be dropped and testnet will start from height 0 and epoch 0

{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.klyntar.org/build-core-and-join-network/networks/testnet/your-own-private-testnet/netrunner-and-pm2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
