Skip to main content

RTMP Server Basics: Ingest, Relay, Playback, and Security

November 9, 2026 Use Cases

Understand an RTMP server from encoder ingest to relay and playback. Plan bandwidth, access controls, encryption and checks for a self-managed streaming setup.

An RTMP server receives a live feed from an encoder and can forward it to another streaming destination. Browser playback is a separate part of the design: a common path packages the media as HLS and serves it over HTTP or HTTPS to a compatible player. Receiving an encoder connection does not prove that viewers can watch, that publishing is restricted or that the connection is encrypted.

For a self-hosted workflow, decide which parts you need to operate before choosing server resources. A relay-only path differs from one that re-encodes video, produces several renditions, records broadcasts and serves viewers directly. This guide uses the NGINX RTMP module as a concrete architecture example, with separate transport protection and viewer delivery. It is a design and acceptance guide, not an installation recipe.

Give every component one clear role

The encoder turns your selected audio and video sources into the outgoing feed. Its publishing configuration identifies the server, application and stream. The RTMP ingest application receives that feed; a relay forwards media onwards, while a transcoder changes its encoded representation. HLS packaging creates playlists and media segments for HTTP delivery. These responsibilities can share a machine, but they remain distinct operations.

Role Position in the media path Inputs and outputs Operational and security responsibility
RTMP ingest Between the encoder and the server's downstream processing Accepts the encoded audio/video feed under an application and stream name Admit authorised publishers, protect the contribution transport and observe incoming media.
Streaming relay Between the ingest server and another streaming endpoint Forwards the feed to a destination, or pulls a remote feed into the local server Control destinations and their credentials, account for each outgoing copy and observe the receiving endpoint.
HLS playback Between the packaging output, HTTP delivery service and viewer Serves playlists and media segments to a compatible player Protect HTTP delivery, apply viewer access policy to the media resources and observe actual playback.
Swipe to view the full table

RTMP and RTMPS describe contribution transport in this design. Plain RTMP is unencrypted; RTMPS wraps RTMP in TLS. HLS describes another delivery mechanism, using HTTP resources rather than asking the browser to play the encoder's RTMP URL directly. Encrypting the encoder link does not automatically encrypt the HLS delivery link, and encrypting either link does not decide who may publish or watch.

Map the encoder-to-viewer path

Use the following labelled path as a bounded design. The NGINX RTMP backend and the TLS proxy run on the same host, with the backend listening only on loopback. The HLS delivery service has its own HTTPS endpoint. Keep their listener addresses and ports distinct so two services are not assigned the same socket.

Encoder → RTMPS/TLS proxy → loopback RTMP ingest → HLS packager → HTTPS delivery → HLS-compatible viewer. An optional branch is RTMP ingest → controlled relay destination. Insert an external transcoder before packaging only when the required output needs re-encoding; label the new outputs separately.

The NGINX RTMP module documents push and pull relays, HLS output, recording, HTTP callbacks and integration with FFmpeg for transcoding. Its example HLS path uses H.264 video and AAC audio. A push relay publishes to a remote server; a pull relay obtains a stream from another server. Neither a relay directive nor enabling HLS is an instruction to generate a new set of encoded quality levels automatically.

The TLS layer here is the separate NGINX stream SSL module combined with its TCP proxy module. The SSL module supplies TLS support for a stream proxy, and the proxy passes the decrypted connection to the local RTMP backend. This avoids treating an RTMP listener as inherently RTMPS-capable. A valid certificate and private key belong to the TLS endpoint; protect the key and maintain certificate renewal as part of operating that endpoint.

F5's RTMP dynamic-module installation page describes NGINX Plus packaging and then refers to the module project for further configuration. Keep that packaging context separate from an open-source build or distribution package. The capability model above comes from the documented module and proxy components; it is not a claim that an arbitrary Linux image already contains them.

Separate forwarding, re-encoding and packaging

A relay creates another delivery path for the feed. Transcoding changes the encoded media, such as producing a different resolution or bitrate, using an external tool in the module's documented FFmpeg integration. HLS packaging writes the playlists and fragments used by the delivery server. Treat those as separate resource and failure boundaries rather than calling all three “streaming”.

For a single compatible H.264/AAC feed, the module's HLS example provides a packaging path. If you need several encoded renditions, include the transcoding stage and each output in the design. The fact that HLS can support adaptive playback does not mean a server has created multiple renditions merely because its HLS switch is enabled.

A viewer also needs a player that handles the intended HLS output. The HTTP service must serve both the playlist and its referenced media segments with the appropriate content types. The module documents that HTTP serving configuration separately from the RTMP application. A page displaying a player, or a successful request for its HTML, is not evidence that the media resources can be retrieved and decoded.

Build a symbolic capacity worksheet

Use your own stream, viewer and retention inputs. Let bᵢ be each incoming stream's combined audio/video bitrate in bits per second, vᵢ its simultaneous direct viewers, rᵢ its relay destinations receiving that bitrate, and tᵢ its duration in seconds. Count separate renditions at their own bitrates. These symbols are inputs to payload arithmetic, not suggested traffic levels.

Quantity Payload calculation What the result leaves out
Incoming media rate Sum of bᵢ across active inputs Protocol overhead and connection behaviour.
Direct-viewer outgoing rate Sum of bᵢ × vᵢ for the renditions actually served Playlist requests, transport overhead, retries and changing audience/rendition selection.
Relay outgoing rate Sum of bᵢ × rᵢ for unchanged relay copies Transport overhead and any different bitrate at a destination.
Media transferred over a constant-rate interval Rate in bits per second × duration in seconds ÷ 8 Container/protocol overhead and changing rates over time.
Recorded media payload Sum of recorded bitrate × recorded duration ÷ 8 Container overhead, extra copies, temporary files and retained HLS data.
Swipe to view the full table

Add the viewer and relay outgoing paths when both originate from the same server. When a delivery network sits between the origin and viewers, separate origin-to-delivery traffic from delivery-to-viewer traffic; do not count the entire audience as direct origin connections without modelling that path. For changing bitrates or audiences, calculate separate intervals or use actual traffic measurements. HLS can use ordinary web servers and delivery networks, but the chosen distribution path determines where each transfer occurs.

CPU planning needs a separate record: which streams are only forwarded, which are re-encoded, and how many outputs are generated with which codec and settings. Record processor use, dropped or failed work and playback behaviour under your intended workload. The existence of FFmpeg integration establishes a processing route, not a CPU budget or viewer-capacity guarantee.

Recording storage and HLS working storage also differ. The module can record FLV files; its HLS path holds playlists and fragments, with cleanup enabled by default to remove old HLS material. Decide recording retention and additional-copy policy explicitly. Measure the working directory and retained recordings during your evaluation, and include those observations alongside network and processor use.

Protect publishing and playback independently

Treat the stream name and publishing credential as different concepts. The module's URL format identifies an application and stream; inventing an obscure stream name is not an authentication implementation. Its on_publish HTTP callback can decide whether a publishing request proceeds. Build that decision around an authorised credential and the permitted application/stream, and reject missing, invalid or revoked credentials.

The callback mechanism uses HTTP response codes: a successful 2xx response permits the session, while rejection uses a non-success response; 3xx has redirect semantics and is not an authentication-denial response. Operate the authorisation endpoint so it approves only the intended publisher and stream. Protect credentials from disclosure in shared configuration, screenshots and logs, and include revocation in the operating procedure.

Address restrictions are another layer. The module supports separate allow/deny rules for publishing and RTMP playing, evaluated in order. In the chosen TLS-proxy design, the backend connection originates from the proxy, so allowing loopback does not identify the remote encoder. Use the publishing callback for that decision and keep the backend listener inaccessible directly from outside the host.

For a private HLS stream, protect the HTTP resources separately. An RTMP on_play decision does not authorise an HTTP request for an HLS fragment. NGINX provides HTTP access controls, including username/password validation, address restrictions and subrequest-based decisions. Apply the chosen policy to the playlist and segments, and exercise it through the actual player; protecting only the page that embeds the player leaves a different access path.

Document the exposed listeners and the peers allowed to reach them. Admit the encrypted contribution endpoint from intended publishers, expose the HTTPS delivery endpoint according to the viewer policy, and restrict administration, statistics and authorisation services. The loopback RTMP backend should not be opened as a public alternative. Plain RTMP commonly uses TCP 1935, but a port number itself supplies neither encryption nor authentication.

Trace a test feed all the way through

Prepare an authorised, non-sensitive test source and a known stream name under the design's publishing policy. In OBS, add the intended source, inspect the Audio Mixer for the correct audio input, and start streaming with the configured server and credential. The official quick-start recommends a trial before the real broadcast. An encoder reporting that it is streaming is the first observation, not the final acceptance result.

At ingest, inspect the configured RTMP access/error logs and the protected statistics endpoint. The module exposes RTMP statistics as XML through rtmp_stat, and its access logging is configurable. Look for the intended application, stream and publisher, then observe media activity while the encoder is running. If no publisher appears, work backwards through authorisation, endpoint address, listening socket, network reachability and TLS errors before changing the HLS player.

If the design includes a relay, observe the same feed at the receiving destination. Local ingest proves only the encoder-to-ingest leg. An active local feed with no remote receipt narrows the investigation to the relay path: destination application/stream, destination credentials, connectivity and the relay's logs. Test each destination separately so one working output does not conceal another failing one.

For HLS, inspect the configured HLS directory for the intended playlist and new fragments, then open the intended HTTPS playback endpoint in the HLS-compatible player. Observe continuing video and audio and the player's network requests for the playlist and segments. A playlist that loads while segment requests fail points to HTTP resource paths or access policy; files that never appear move the investigation back to ingest, compatible media, packaging configuration or directory access.

Finally, attempt publishing with an invalid test credential and request the private playback resources without viewer authorisation. Both should fail under this design. Stop the authorised feed and observe the resulting server/player state; record how you will distinguish an ended broadcast from an unexpected interruption. Retain the actual observations and unresolved failures before accepting the workflow, rather than recording an expected result as a successful test.

Assign ownership before using the server

For Cloud VPS, we supply self-managed infrastructure. You install and operate the streaming components, authorisation service, certificates, delivery configuration, monitoring and recovery arrangements. The operating decision includes patching, credential rotation, recording retention and response to a failed broadcast; it is not completed by provisioning a VPS.

Proceed when the complete path has an owner, the resource worksheet uses your actual inputs, authorised playback works and rejected access behaves as intended. If you need someone else to operate these streaming layers, change the operating model before committing the workflow. Ingest, relay and playback are useful capabilities only when their boundaries—and the responsibilities between them—are explicit.

Give your project a server of its own

Confirm that your deployment is supported. Choose resources for the full setup and measure usage as your project grows.

Peter French
About the author

Peter French

Peter French is the Managing Director at Virtarix, with over 17 years in the tech industry spanning cloud hosting, cybersecurity, and data protection.

View author profile