> For the complete documentation index, see [llms.txt](https://docs.noports.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.noports.com/usage/basic-usage.md).

# npt Usage

### Quick Start

```bash
npt -f @<your_client_atsign> -t @<your_device_atsign> -r @rv_[am|ap|eu|oc] -d <name> \
-p <remote-port> -l <local-port>
```

### Overview

This guide covers the basics to understanding the parameters of npt and invoking npt.

The NoPorts Tunnel, or npt for short, provides an end to end encrypted TCP Tunnel without the need for inbound listening ports on either of your machines.

### Options

<table><thead><tr><th width="100">Option</th><th width="134">Required / Default</th><th width="230">Value Format</th><th width="382">Description</th></tr></thead><tbody><tr><td>-f</td><td><strong>required</strong></td><td>Atsign</td><td>The client Atsign, a.k.a. the <strong>from</strong> Atsign, since we are connecting from the client.</td></tr><tr><td>-t</td><td><strong>required</strong></td><td>Atsign</td><td>The device Atsign, a.k.a. the <strong>to</strong> Atsign, since we are connecting to the device.</td></tr><tr><td>-r</td><td><strong>required</strong></td><td>Atsign</td><td><p>The Atsign of the relay service used to establish the session connection. NoPorts currently provides coverage in 4 regions:</p><p>@rv_am - Americas</p><p>@rv_eu - Europe</p><p>@rv_ap - Asia/Pacific<br>@rv_oc - Oceania</p></td></tr><tr><td>-d</td><td><strong>required</strong></td><td>String<br><em>Only <code>[a-z0-9_-]</code> allowed.</em><br><em>Maximum of 36 characters.</em></td><td>Allows multiple devices to run sshnpd under a single device name.</td></tr><tr><td>-p</td><td><strong>required</strong></td><td>Port number.<br><em>Between 1-65535.</em></td><td>The port you are connecting to on the device/remote side. This port must be included in the --permit-open list and/or policy allowances.</td></tr><tr><td>-l</td><td>"0"</td><td>Port number<br><em>Between 1024-65535.</em></td><td>The port you are connecting to on the client/local side. Defaults to any unused port.</td></tr><tr><td>-h</td><td>"localhost"</td><td>DNS / ip address</td><td>The host that the daemon will connect to. nslookup is resolved on the remote machine where the daemon is running.</td></tr><tr><td>-K</td><td>N/A</td><td>N/A</td><td>Keep alive. If a session ends, try to create a new session and re-bind the port. If you are using this in a script or as a daemon, it's recommended that you handle restarts externally (e.g. with an init system) and do not rely on npt -K.</td></tr><tr><td>-T</td><td>"30s"<br>"24h" (with -K)</td><td>Human readable duration:<br>e.g. "7d" or "1h,14m,30s"</td><td>How long to keep the npt session open if there have been no connections. To "never" timeout, use "-T 0" which sets a timeout of 365 days.</td></tr><tr><td>-x</td><td>N/A</td><td>N/A</td><td><p>Starts the session in the background under a different process id, then exits, printing the bound port to stdout.</p><p>Note that the background npt session will automatically close due to the timeout feature (see -T).</p><p>If you are scripting npt, this feature means you will lose control over the session process, do not use this feature if you also intend to control when npt stops or if you need to detect when the npt session dies.</p></td></tr><tr><td>-v / -q</td><td>N/A</td><td>N/A</td><td>Use -v for verbose logging.<br>Use -q for quiet (i.e. less) logging.</td></tr></tbody></table>

### Example

```bash
npt -f @alice_client -t @alice_device -d my_server -r @rv_am -p 3389 -l 33389
```

### Use Cases

{% content-ref url="/pages/f0ZZQzMPcerYMHsbOiw6" %}
[RDP](/use-cases/rdp.md)
{% endcontent-ref %}

{% content-ref url="/pages/91NY3Ha8Uy9I7loW436y" %}
[SFTP](/use-cases/sftp.md)
{% endcontent-ref %}

{% content-ref url="/pages/JO4Som2PYbhCBqNpFjQm" %}
[Web Server](/use-cases/web-server.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.noports.com/usage/basic-usage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
