> For the complete documentation index, see [llms.txt](https://kb.mago.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.mago.io/mago-stage/network-requirements/on-premises-firewall-ports.md).

# On-premises firewall ports

An on-premises Mago Stage deployment runs several services on the customer’s server. Firewall access depends on which services are enabled and whether a reverse proxy is used.

Only allow access from authorized controller, receiver, administrator, and server networks.

### Core service ports

| Service                | Direction         | Protocol and port | Required by                                                          | Status                                                  |
| ---------------------- | ----------------- | ----------------- | -------------------------------------------------------------------- | ------------------------------------------------------- |
| Mago Stage API         | Inbound to server | TCP 5083          | Controllers, receivers, Administration Portal, and Remote Controller | Required                                                |
| Administration Portal  | Inbound to server | TCP 4000          | Administrator browsers                                               | Required                                                |
| Remote Controller      | Inbound to server | TCP 8080          | Administrators using Mago Remote                                     | Required when Mago Remote is used                       |
| Present web controller | Inbound to server | TCP 5000          | Browser-based controllers                                            | Required when Present is enabled                        |
| Stage VC               | Inbound to server | TCP 3000          | Controllers and receivers using conferencing                         | Required when Stage VC is enabled and accessed directly |

These are the default host ports used by the standard Mago Stage server deployment.

If services are published through a reverse proxy on TCP 443, the original service ports should remain restricted to the server, management network, or reverse proxy.

### Bundled WebRTC ports

The following ports apply when the bundled on-premises WebRTC service is installed.

| Function                    | Direction         | Protocol and port | Purpose                                                                       |
| --------------------------- | ----------------- | ----------------- | ----------------------------------------------------------------------------- |
| WebRTC signaling and health | Inbound to server | TCP 7880          | WebSocket signaling and service health in plain LAN mode                      |
| ICE over TCP                | Inbound to server | TCP 7881          | TCP media fallback                                                            |
| WebRTC media                | Inbound to server | UDP 7882          | Primary real-time audio, video, and screen-sharing media                      |
| WebRTC TLS entry point      | Inbound to server | TCP 443           | Secure WebSocket signaling and TURN over TLS                                  |
| TURN over UDP               | Inbound to server | UDP 3478          | Relayed media when TLS mode is enabled and direct connectivity is unavailable |

For the best real-time performance, allow UDP 7882 between participating devices and the WebRTC server.

TCP fallback can maintain connectivity where UDP is restricted, but it may provide lower performance or reliability for real-time media.

### Port requirements by deployment type

#### Basic deployment

A Basic deployment runs the Mago Stage server and receiver on the same Windows machine.

A controller can run on another supported device, such as an iPad, when it can reach the Basic server over the permitted network.

Basic uses the applicable on-premises service ports documented on this page:

* Allow access to the Mago Stage API from authorized controllers.
* Allow Administration Portal access from authorized administrator devices.
* Allow additional service and WebRTC ports only when the corresponding features are enabled.
* Keep database, Redis, container-management, and other internal service ports restricted to the local server.

When services are published through a reverse proxy, controllers and administrator devices can use TCP 443 instead of directly accessing the underlying service ports.

#### Core deployment

Open the following ports:

| Port | Protocol | Service               |
| ---- | -------- | --------------------- |
| 5083 | TCP      | Mago Stage API        |
| 4000 | TCP      | Administration Portal |

#### Core deployment with Mago Remote

Open the core ports and:

| Port | Protocol | Service           |
| ---- | -------- | ----------------- |
| 8080 | TCP      | Remote Controller |

#### Core deployment with Present

Open the core ports and:

| Port | Protocol | Service                |
| ---- | -------- | ---------------------- |
| 5000 | TCP      | Present web controller |

#### Core deployment with Stage VC

Open the core ports and:

| Port | Protocol | Service                      |
| ---- | -------- | ---------------------------- |
| 3000 | TCP      | Stage VC direct service port |

When Stage VC is published through HTTPS, clients may connect through TCP 443 instead of directly using TCP 3000.

#### Core deployment with bundled WebRTC

Open the core ports and:

| Port | Protocol | Service                                                     |
| ---- | -------- | ----------------------------------------------------------- |
| 7880 | TCP      | WebRTC signaling in plain LAN mode                          |
| 7881 | TCP      | ICE over TCP                                                |
| 7882 | UDP      | WebRTC media                                                |
| 3478 | UDP      | TURN over UDP when TLS mode is enabled                      |
| 443  | TCP      | Secure signaling and TURN over TLS when TLS mode is enabled |

The exact set depends on whether WebRTC uses plain LAN mode or TLS mode.

### Plain LAN mode

In plain LAN mode, clients connect directly to the WebRTC server using:

`ws://<server-address>:7880`

Required ports are:

* TCP 7880 for signaling
* TCP 7881 for ICE over TCP
* UDP 7882 for real-time media

Plain LAN mode should only be used on a trusted private network.

Browser security restrictions may prevent camera or microphone access over an insecure connection. Use TLS mode when browser-based conferencing or screen sharing is required.

### TLS mode

In TLS mode, clients connect using a secure address such as:

`wss://webrtc.magosrv.com`

TLS mode uses:

* TCP 443 for secure signaling and TURN over TLS
* UDP 3478 for TURN over UDP
* TCP 7881 for ICE over TCP
* UDP 7882 for real-time media

The example hostname must be replaced with the DNS name assigned to the deployment.

TLS mode requires a valid certificate matching the WebRTC hostname.

### Source networks

Restrict inbound rules according to the service.

| Service                | Recommended source                                                                  |
| ---------------------- | ----------------------------------------------------------------------------------- |
| Mago Stage API         | Authorized controller, receiver, Portal, Remote Controller, and management networks |
| Administration Portal  | Administrator and management networks                                               |
| Remote Controller      | Administrator and management networks                                               |
| Present web controller | Authorized user and presentation networks                                           |
| Stage VC               | Authorized controller and receiver networks                                         |
| WebRTC                 | Authorized controller, receiver, and conferencing networks                          |

If devices connect from another site, provide access through an approved routed network, site-to-site VPN, remote-access VPN, or secured public entry point.

Do not expose raw container ports directly to the public internet.

### Internal-only services

The standard deployment also contains internal container services that do not require client firewall rules.

These include:

* Database services
* Redis
* YouTube token-provider services
* Container management interfaces
* Internal Docker networking

Do not publish these services to user networks or the public internet.

### Reverse proxy deployments

A reverse proxy can publish Mago Stage services through TCP 443 while keeping the original container ports restricted to the server or management network. The proxy must support WebSockets, uploads, long-lived connections, and the required WebRTC transports. See **On-Premises Certificates and Proxies** for configuration requirements.
