# Courier Network Requirements

What Courier needs to reach, and what needs to reach it. Courier is
self-hosted: it runs on a Windows Server on your own network, and the RSJ Agents
on your computers reach it there. **Nothing needs to be reachable from the
internet.**

The quick version: allow **inbound TCP 8445** to the Courier server, from the
computers that should show notices. That is the only port Courier listens on.
Everything else is outbound from the server, and only for updates and, if you
set it up, your own Active Directory.

---

## Inbound to the Courier server

| Port | From | What it is |
|---|---|---|
| TCP 8445 (HTTPS) | The computers that run the RSJ Agent | Each agent checks in, waits for a notice and sends its receipts back |
| TCP 8445 (HTTPS) | The computers where people use the console | The console, on the same port, always behind its sign-in |

- The server never opens a connection to a computer to deliver a notice. The
  agent on each computer asks the server.
- There is no plain-http mode. Courier makes its own certificate for HTTPS, so a
  browser warns about it the first time.
- The first administrator account can only be created on the server itself.
  After that the console can be opened from other computers on your network at
  `https://<server name or address>:8445`. To limit it to certain computers, list
  their addresses under **General Settings -> Access**. The RSJ Agents are not
  affected by that list.
- The server answers only to its own host names and addresses. A DNS alias or a
  load-balanced name is refused, so give the deploy script one of the server's
  own names.
- Five wrong passwords from one computer lock that computer out of signing in for
  a minute.
- **Do not make the console reachable from the internet, or through a proxy.**

## The Windows Firewall rule

The installer asks whether to add a rule named **Courier (TCP 8445)**, allowing
inbound TCP 8445 on any network profile. It is ticked by default and is removed
again when you uninstall. If you manage the firewall by Group Policy, untick it
and open the port yourself, scoped to your school's computers. Nothing between
the computers and the server -- a network firewall, a VLAN rule -- should block
TCP 8445.

---

## Outbound from the Courier server

| To | Over | Why | When |
|---|---|---|---|
| Your domain controller | The Windows directory connection, using the read-only account you give it | Reading Active Directory group membership for People notices, and the optional search for computers | Only if you set up a directory account under **Message Settings -> Directory**. It only reads |
| Computers you push the agent to | WinRM, TCP 5985 | **Deploy selected** pushes the RSJ Agent | Only when an administrator chooses it. Off by default on Windows 10 and 11 computers; the deploy script avoids it |
| GitHub (api.github.com, and the download address GitHub gives for the installer file) | HTTPS | Looking for and downloading a newer version | Only when an administrator asks, or has turned on automatic updates (off by default) |

Courier sends nothing about you to RSJ Software, and it has no telemetry. Checking
for and downloading updates is the only time it contacts the internet.

Which ports your domain controllers must allow to the server for the directory
connection is a question for your network team; Courier uses Windows' own
directory access with the account you give it, and does not need an account that
can change anything.

---

## On each computer that shows notices

- The RSJ Agent, which connects out to the Courier server on TCP 8445 for
  Courier's notices (the server does not connect in to deliver one). Courier
  does not install a program of its own on the computers: it runs as a module of the RSJ Agent, which also serves Groundskeeper and
  Caretaker. What the agent does and where it talks is on the
  [RSJ Agent website](https://agent.rsjsoftware.com/).
- Windows computers only.

---

## Checking it from a computer

On a computer that cannot be enrolled, or does not appear under
**Agent Settings, Devices, Registered**, in PowerShell:

```powershell
Test-NetConnection courier-server -Port 8445
```

`TcpTestSucceeded : True` means the port is reachable. If it is not, check that
the server's name resolves from that computer, that the firewall rule exists on
the server, and that nothing between them blocks TCP 8445. If the connection
works but the computer still does not enrol, check you used the current
connection secret: rotating it under Agent Settings (Deploy) means every
computer enrolled with the old one must be enrolled again.

Full pages: [Firewall and Network](https://courier.rsjsoftware.com/docs/Firewall-and-Network)
and [Troubleshooting](https://courier.rsjsoftware.com/docs/Troubleshooting).
