Cameras and network
Argus reads video from your cameras over your local network. This page covers the camera streams Argus can use, which hosts talk to each other, and the ports to open.
Camera streams
Argus reads a camera through its stream address, such as rtsp://192.168.1.100:554/stream. You add each camera by its address. rtsp, rtsps, http and https addresses work.
Argus decodes streams with FFmpeg. H.264 is the safest choice of video codec.
If the camera needs a user name and password, put them in the address:
rtsp://<user>:<password>@192.168.1.100:554/stream
Argus stores the address as you enter it, in the site database. Only admins see the user name and password in it, in the camera's edit form. Operators, the Copilot, error messages and the audit log never show them. Still, create a camera account that can only view the stream, and use that.
To find the stream address, check the camera's manual or its web settings. Many cameras offer a main stream and a smaller second stream. The smaller stream uses less CPU, GPU and memory on the edge node. See Sizing.
Who connects to what
Cameras never connect to Argus. Browsers connect only to the site node, over HTTPS.
| From | To | Port | Why |
|---|---|---|---|
| Edge node | Camera | The camera's RTSP port, 554 unless you changed it | Reads the stream for detection, all the time. |
| Site node | Camera | The camera's RTSP port | Runs Test Connection and shows camera previews on the Dashboard page. |
| Browser | Site node | 443 (HTTPS), and 80, which redirects to HTTPS | Dashboard, site API, Copilot, clip playback and live video. |
| Edge node on another host | Site node | 5432 (PostgreSQL), 6379 (Redis), 8333 (clip storage) | Reads its camera list, sends detection events, gets clip requests, uploads clips. |
| Site node (Caddy) | Edge node on another host | 8001 | Fetches the node's live video for the Live Wall. |
Site node (site-api) | Edge node | 8001 | Asks the node to run a camera discovery scan. Only when you use Scan network. |
| Edge node | Cameras on its network | UDP 3702 multicast, then the camera's ONVIF web port | Camera discovery. Only when you use Scan network. |
The built-in edge node edge-1 runs on the site node, so its connections stay inside Docker.
Each camera preview on the Dashboard page, and each connection test, opens its own stream from the site node to the camera. The edge node keeps one stream open per camera, and serves it to every Live Wall viewer. If a camera limits how many streams it serves at once, allow for this.
Argus doesn't need internet access to run. After the install, you can close outbound internet access for the site node and edge nodes, and Argus keeps working. While the hosts can reach the internet:
- The optional status link reports site status, if you turn it on.
- Workflows with a webhook, API call or notification step send requests to the addresses you enter.
- With a public DNS name (
SITE_DOMAIN), Caddy renews its certificate. That needs ports80and443reachable from the internet.
Usage statistics of the detection library are turned off in the edge node image.
Firewall
On the site node, the Compose file publishes only Caddy's ports:
| Port | Service | Who should reach it |
|---|---|---|
443 | HTTPS: dashboard, site API, clips and live video | Operator browsers. |
80 | Redirect to HTTPS, and certificate checks for a public DNS name | Operator browsers. From the internet only when you use SITE_DOMAIN. |
Set HTTPS_BIND_ADDRESS to publish them on one network interface only.
If you run edge nodes on other hosts, the site node also publishes PostgreSQL (5432), Redis (6379) and the clip storage (8333) on its LAN interface. Allow only your edge nodes to reach them. On each edge host, allow only the site node to reach port 8001.
Docker writes its own firewall rules for published ports. Rules that you add with tools such as ufw or firewalld don't apply to these ports. Restrict them with a network firewall in front of the host, or in Docker's DOCKER-USER chain.
For example, to let only the edge hosts 192.168.1.61 and 192.168.1.62 reach PostgreSQL, Redis and the clip storage through the LAN interface eth0 of the site node:
LAN_IF=eth0
for port in 5432 6379 8333; do
iptables -I DOCKER-USER -i "$LAN_IF" -p tcp -m conntrack --ctorigdstport "$port" --ctdir ORIGINAL -j DROP
for edge in 192.168.1.61 192.168.1.62; do
iptables -I DOCKER-USER -i "$LAN_IF" -p tcp -s "$edge" -m conntrack --ctorigdstport "$port" --ctdir ORIGINAL -j RETURN
done
done
Keep -i with the LAN interface, so that traffic between the containers is not affected. Save the rules with your distribution's tools, so that they survive a restart.
Traffic between the site node and edge hosts on these ports is not encrypted. Keep them on an isolated network segment or VLAN.
Clip playback and live video
The browser gets everything from the same HTTPS address as the dashboard:
- Clips. When you open an alert clip, the site API reads it from the clip storage and streams it to the signed-in browser. The clip storage itself is not published.
- Live video. The Live Wall loads each camera from its edge node, through Caddy, at
/edge/<node-name>/live/<camera id>. The site API gives each signed-in user a link that is valid for 5 minutes. The edge node refuses requests without a valid link. A stream that is already open keeps running.
Each edge node registers where browsers reach it: /edge/<node-name>, for example /edge/edge-1 for the built-in node. This works from any computer that can open the dashboard. A node doesn't register any other address. If browsers must reach a node somewhere else, an admin pins that address for the node in Cameras & Edge Nodes > Edge Nodes. Don't use an http:// address: browsers block it on an HTTPS dashboard.
If your clip storage is exposed separately over HTTPS, you can set CLIP_PUBLIC_URL to its address. Clip requests then redirect to a link there that is valid for 10 minutes. Leave it empty unless you need it.
Camera discovery (ONVIF)
With Scan network, an admin can let an edge node find ONVIF cameras on its network and fill in their stream address. See Find cameras with Scan network. It is an aid for adding cameras. Cameras without ONVIF, or on another subnet, are still added by address, and video is still read over RTSP.
How the scan works
The edge node sends one ONVIF discovery message (WS-Discovery, UDP multicast to 239.255.255.250:3702) on its own network segment. Such a message doesn't pass routers, so the scan only finds cameras on the same subnet as the node. Cameras that answer are listed. The scan sends no camera login, because any device on the network can answer.
When an admin selects a camera and enters its login, the edge node asks that camera, and only that camera, for its stream addresses. The login is never logged, and only stored if the admin saves the camera.
The scan is limited to keep it from being turned against other hosts:
- Private addresses only. The node only contacts private addresses (RFC 1918, and IPv6 unique local addresses). It never contacts loopback, link-local addresses including cloud metadata, multicast or public addresses, Docker's default bridge range
172.17.0.0/16, or Argus' own internal network. To allow cameras on other ranges, for example self-assigned169.254.0.0/16addresses, list them inONVIF_ALLOWED_NETWORKS(IP addresses or CIDRs) in the edge node's settings. - Only the camera that answered. Every address a camera hands back, for its services and its streams, must be the same IP address the answer came from. Host names are refused. A device can't point the node at another host.
- Limits. The node only looks up streams for cameras its own scan found in the last 15 minutes, at most two at a time, each within 10 seconds.
- Signed requests. The site asks the edge node to scan over the node's internal port
8001, with requests signed byLIVE_STREAM_SECRET. Each request is valid for that one node, once, for a short time. Caddy never forwards these requests from browsers.
Put the edge node on the camera network
Multicast doesn't cross Docker's default bridge network. So in the default install, discovery is off, and Scan network says that discovery is not available on the node. To turn it on, add one of these Compose files to COMPOSE_FILE in .env on the host that runs the edge node:
| File | What changes | Use it when |
|---|---|---|
docker-compose.onvif-macvlan.yml (recommended) | The edge node gets an extra network interface with its own address on the camera network. It stays on Argus' internal networks, so nothing else changes: Caddy and the site reach the node as before. | The host is connected to the camera network by cable. |
docker-compose.onvif-host.yml | The edge node uses the host's network directly. PostgreSQL, Redis and the clip storage are published on the host's 127.0.0.1 for it, and Caddy and the site reach the built-in node at host.docker.internal:8001. If you set CADDY_EDGE_UPSTREAMS yourself, write the built-in node there as edge-1=host.docker.internal:8001. The node's port 8001 is then open on the host's network: it needs a valid signed link or request, but firewall it if the network shouldn't reach it. On a host with several network cards, set ONVIF_INTERFACE_IP to the address on the camera network. | Macvlan is not possible, for example in a cloud network, or with switches and Wi-Fi access points that drop the extra network address. |
For the macvlan file, set four values in .env: the host's network card on the camera network, that network's subnet and gateway, and a free, fixed address for the edge node outside the DHCP range. Use your own values:
COMPOSE_FILE=docker-compose.yml:docker-compose.gpu.yml:docker-compose.onvif-macvlan.yml
ONVIF_LAN_PARENT=eth0
ONVIF_LAN_SUBNET=192.168.1.0/24
ONVIF_LAN_GATEWAY=192.168.1.1
ONVIF_LAN_IP=192.168.1.240
Then run docker compose up -d.
With macvlan, the host itself can't reach the edge node's camera-network address. Other hosts and the cameras can. This is how macvlan works in Linux, and doesn't affect Argus.
Edge nodes on other hosts need the same change on their own host. The site also needs to know how to reach each node for scans: set EDGE_API_UPSTREAMS in the site node's .env, in the same name=host:port form as CADDY_EDGE_UPSTREAMS. If you leave it empty, the site uses CADDY_EDGE_UPSTREAMS. The site sends a camera login to a node only over the internal network or HTTPS, never as plain HTTP across another network.
Setting ONVIF_DISCOVERY=on without putting the node on the camera network only finds nothing.
Add a camera
- In the dashboard, open Cameras & Edge Nodes.
- Under Add New Camera, enter a Camera Name and the stream address as Source URI.
- Click Test Connection. The site node opens the stream and shows one frame. The first frame from an RTSP camera can take a while to arrive, so wait before you try again.
- Choose a Detection Profile and an Assigned Edge Node.
- Save the camera.
The assigned edge node picks up the camera within 10 seconds. You don't need to restart anything when you add, change, turn off or delete a camera.
An unassigned camera is not watched by any edge node. If a camera has stored events, you can't delete it. Turn it off instead, so its history stays searchable. For the camera settings, see Cameras and edge nodes.
Test without a camera
The docker-compose.test-rtsp.yml file adds a small RTSP server (MediaMTX) that streams a video file on a loop. Use it to try Argus before your cameras are connected.
-
Put an H.264 MP4 file at
data/sample-video/vtest.mp4. -
Start the test stream:
docker compose -f docker-compose.yml -f docker-compose.test-rtsp.yml up -d --build mediamtx rtsp-test-publisher -
Add a camera with the source URI
rtsp://mediamtx:8554/testcamand assign it toedge-1. The first connection test can take 20 to 30 seconds.
This address works for the site node and for edge-1, which run in the same Docker network. The test stream has no password, so it is published on the site node's loopback address only. Edge nodes on other hosts can't use it.
When you're done, delete or turn off the test camera, then remove the test stream:
docker compose -f docker-compose.yml -f docker-compose.test-rtsp.yml rm -sf mediamtx rtsp-test-publisher
Troubleshoot camera connections
| What you see | What to check |
|---|---|
| Test Connection fails | The site node can reach the camera's RTSP port. The address, user name and password are right. Try the address in a video player on the site node's network. |
| The test works, but the camera never produces detections | The camera is assigned to an edge node, turned on, and that edge node shows as online in Cameras & Edge Nodes. The edge node can reach the camera too. Check docker compose logs edge-node. |
| A Live Wall tile stays empty | The edge node shows as online. For an edge node on another host, its name and address are in CADDY_EDGE_UPSTREAMS and the site node can reach its port 8001. No http:// address is pinned for the node, and EDGE_PUBLIC_URL is not an http:// address. LIVE_STREAM_SECRET is the same on the site node and the edge node. |
| Scan network says discovery is not available | The node is on Docker's default network. Add docker-compose.onvif-macvlan.yml or docker-compose.onvif-host.yml. See Camera discovery (ONVIF). |
| Scan network finds no cameras | ONVIF is turned on in the camera, and the camera is on the same subnet as the edge node's camera-network address. A camera on a public or link-local address is skipped unless its range is in ONVIF_ALLOWED_NETWORKS. |
| Live feed disconnected or Signal Lost on the Dashboard page | The site node can't read the stream. The camera may have reached its limit of open streams. |
| An edge node shows as offline | It checks in every 10 seconds and shows as offline after 30 seconds without a check-in. Check that the container is running and can reach ports 5432, 6379 and 8333 on the site node, and that its EDGE_DB_PASSWORD matches the site node's. |
| An edge node shows as Redis unreachable | The node is running, but can't deliver detections. Check that redis runs on the site node, that the edge host can reach port 6379, and that its EDGE_REDIS_PASSWORD matches the site node's. Detections made meanwhile are dropped. |