# Port forwarding to run web services

{% hint style="info" %}
Read time: 4 minutes
{% endhint %}

Q Blocks instances offer support for running web services with public access. This is enabled through port forwarding.

A web service can be forwarded at an open port of the Q Blocks instance and then accessed publicly.

> 🔐 Due to security reasons, all ports are not open. Only some random ports can be opened.

The pre-configured open ports of your instance can be viewed as follows:

1. Go to your [Active Instances](https://www.qblocks.cloud/client/v2/instances) Page.
2. Click on the dropdown icon on your instance row to view instance info.
3. **Extra Ports** section displays the open port as seen below:

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

> 🗒️ Copy the **Extra port** and **Host** values

### Example of a web service:

As an example, let us run **Tensorboard** web service in our instance. Tensorboard is a Machine learning experiment tracking software that can be launched as a web service and then accessed in your browser.

Run the following commands in your instance’s terminal:

```bash
pip install tensorboard
tensorboard --logdir LOG_FOLDER --host=0.0.0.0 --port EXTRA_PORT
```

> Replace <mark style="color:red;">EXTRA\_PORT</mark> with the Port number copied above.

This should launch the service and it should be accessible at the following URL:

```html
http://HOST:EXTRA_PORT
```

The same way, you can launch any web service in your instance at a provided port.

**Please see:**

> *Any application running at a forwarded port is accessible to the public. Right precautions with auth token or password access must be implemented to secure the applications.*

If you still face issues setting it up then don't hesitate to reach out to us at: [support@qblocks.cloud](mailto:support@qblocks.cloud?subject=Unable%20to%20launch%20TensorBoard)


---

# 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.qblocks.cloud/q-blocks-how-to-guide/port-forwarding-to-run-web-services.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.
