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

# Ports and firewalls

> How to forward one port on your router to your recorder, so TruRec AI can read your cameras, plus the details your network team needs.

On SaaS, TruRec AI reads your cameras from our cloud, over the internet. To let it in, you add one rule on your router: forward one port to your recorder (your NVR or DVR). One port covers every camera on the recorder. You don't install anything at your site.

New to this? [Networking in plain words](https://docs.trurec.ai/networking/plain-words.md) explains each term.

> [!TIP]
>
> Setting this up for someone else? Send them this page and [Connect a camera with a camera link](https://docs.trurec.ai/getting-started/camera-links.md). Don't send camera passwords by email.

## How it connects

```text theme={null}
TruRec AI, in our cloud
   |  over the internet, to your site's public IP address, port 554 (or 8554)
   v
Your router
   |  forwards that port to your recorder's address, port 554
   v
Your recorder, and the cameras on it
```

TruRec AI only reads video. It doesn't connect to anything else on your network.

## Before you start

You'll need:

* **To sign in to your router.** See [Sign in to your router](https://docs.trurec.ai/networking/sign-in-to-your-router.md).
* **Your recorder's address on your network,** such as `192.168.1.20`, made fixed so it doesn't change. See [Find and fix your recorder's address](https://docs.trurec.ai/networking/fix-your-recorders-address.md).
* **A public IP address for your site.** Most connections have one, but some providers share one between customers. See [CGNAT and public IP addresses](https://docs.trurec.ai/networking/cgnat-and-public-ip.md#how-to-tell).
* **One router, or a plan for two.** If your provider's modem and your own router are both routers, see [Two routers](https://docs.trurec.ai/networking/two-routers.md).

## Set up port forwarding

Every router looks a bit different, but the steps are the same.

**1. Sign in to your router**

From a phone or computer on the site's Wi-Fi. See [Sign in to your router](https://docs.trurec.ai/networking/sign-in-to-your-router.md#sign-in).

**2. Find the forwarding menu**

It's often called **port forwarding**, **virtual server**, **NAT** or **port mapping**, and it's often under an advanced, firewall or NAT menu. If you can't find it, search your router maker's support site for "port forwarding" and your router's model. The model is on the sticker.

**3. Add a rule**

Add a new rule, and fill it in like this. Your router might use different names for each setting.

| Setting | Also called | What to enter |
| - | - | - |
| Name | Description, service name | Anything you like, such as `TruRec` |
| Protocol | Type | **TCP** |
| Outside port | External port, public port, WAN port | **554**. If your provider blocks 554, use **8554**. If there are two boxes for a range, put the same number in both. |
| Inside address | Internal IP, server IP, device, LAN IP | Your recorder's address, such as `192.168.1.20` |
| Inside port | Internal port, private port, LAN port | **554**, the recorder's RTSP port. If your recorder's network settings show a different RTSP port, use that. |

**4. Save it**

Save or apply the rule, and check it's switched on. Some routers need a restart before a new rule works.

**5. Check it from TruRec AI**

Add a camera link and choose **Test connection**. TruRec AI tries the port from our cloud. See [Connect a camera with a camera link](https://docs.trurec.ai/getting-started/camera-links.md). If the setup assistant is on for your workspace, it checks the port for you.

Your camera links then use your site's public IP address and the outside port, such as `203.0.113.7:8554`. See [What a camera link is](https://docs.trurec.ai/getting-started/camera-links.md#what-a-camera-link-is).

If your site's public IP address changes from time to time, your links stop working when it does. Ask your provider for a static IP address. See [Ask your provider](https://docs.trurec.ai/networking/cgnat-and-public-ip.md#ask-your-provider).

## If it doesn't work

Check one thing at a time:

1. **Is the rule saved and switched on?** Some routers need you to choose Apply, or to restart.
2. **Is the inside address exactly your recorder's?** Not the camera-side address some recorders show. See [Find it](https://docs.trurec.ai/networking/fix-your-recorders-address.md#find-it).
3. **Is port 554 blocked?** Some providers block it. Change the outside port to 8554, and keep the inside port at 554.
4. **Does your site have a public IP address?** See [How to tell](https://docs.trurec.ai/networking/cgnat-and-public-ip.md#how-to-tell).
5. **Are there two routers?** See [Two routers](https://docs.trurec.ai/networking/two-routers.md#what-to-do).

Still stuck? [Get help setting up your cameras](https://docs.trurec.ai/support/get-help.md#setup-help).

## Keep it safe

A forwarded port can be reached by anyone on the internet, not just TruRec AI. To protect your recorder:

* **Change the recorder's default password,** if it still has the one it came with. Use a strong password that isn't used anywhere else.
* **Give TruRec AI a view-only user,** not the admin login. See [Create a read-only user](https://docs.trurec.ai/getting-started/read-only-vms-user.md).
* **Forward only the RTSP port.** Never forward the recorder's or a camera's web page, or its admin ports.
* **Use RTSPS** where your recorder or cameras support it.
* **Keep the recorder's firmware up to date.**

See [Keep a port-forwarded camera safe](https://docs.trurec.ai/getting-started/camera-links.md#keep-a-port-forwarded-camera-safe).

## Bandwidth

TruRec AI reads each camera's video as it is, without re-encoding it. So each camera uses about its own stream's bitrate in upload from your site, plus a little overhead. For example, a sub-stream at 500 kbit/s uses about 0.5 Mbit/s of upload, so five cameras like that need about 2.5 Mbit/s.

**Plan for 2–4 Mbit/s of upload per camera.** A typical main stream (1080p H.264) runs at 2–4 Mbit/s, and 4 Mbit/s is a common camera maximum. So a site's total upload need is roughly the number of cameras × 4 Mbit/s, plus some headroom.

You choose the main stream or the sub-stream for each camera. The sub-stream uses less upload bandwidth. The main stream gives better detection of people far away or small in the picture, and sharper clips. You'll find a camera's bitrate on its video or encoder settings page. See [Main stream or sub-stream?](https://docs.trurec.ai/getting-started/rtsp-urls.md#main-stream-or-sub-stream).

## For your network team

The details for whoever looks after your network.

### What connects to what

| From | To | Port | What for |
| - | - | - | - |
| TruRec AI, from our cloud | Your site's public IP address, forwarded by your router to a recorder, camera or VMS | The port you forward. Inside your network, usually TCP 554 for RTSP, or 322 for RTSPS. | Reading video |
| Your team's browsers | Your TruRec AI workspace, at an address ending in `.app.trurec.ai` | TCP 443 (HTTPS) | Using TruRec AI |

### Cameras without a recorder

If the cameras don't record to an NVR or VMS, forward a port to each camera instead. Give each its own outside port, such as 5541, 5542 and 5543, each forwarded to a different camera's RTSP port. Give each camera a fixed address, or reserve one for it.

### Business firewalls

On a business firewall, the forward is often two parts: the forward itself (a virtual IP or destination NAT rule), and a policy that allows the traffic in. If you can limit the rule to certain source addresses, [ask us](https://docs.trurec.ai/support/get-help.md#setup-help) for the addresses to allow.

### Dynamic DNS

If the site's public IP address isn't static, a dynamic DNS name that follows it can be used in the camera links instead of the address.

## Checklist for your network team

* [ ] The recorder, or each camera or VMS, has a fixed address on your network.
* [ ] The router forwards one TCP port (such as 554 or 8554) to the recorder's RTSP port. Or, for cameras without a recorder, one outside port to each camera's RTSP port. No other ports are forwarded to the recorder or the cameras.
* [ ] The site has its own public IP address, not a shared one (CGNAT).
* [ ] Only one router sits between the internet and the recorder, or each router forwards the port.
* [ ] The site's public IP address is static, or has a dynamic DNS name.
* [ ] The recorder's default password has been changed, and TruRec AI uses a view-only user.
* [ ] Each link passes **Test connection** in TruRec AI.
* [ ] The site's upload bandwidth covers the total of the cameras' stream bitrates.

## Coming later: no port forwarding

We're building the TruRec connector, a small program for a computer at your site. It will send your cameras' video out to TruRec AI, so you won't need to forward any ports. It isn't available yet.

> [!NOTE]
>
> **On Enterprise:** if TruRec AI runs in your own environment, it reads your cameras on your own network, and you don't need to forward any ports. We plan network access with you as part of your deployment.


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