Guide · Open source
How to use livego: run a Go live streaming server
Updated · written with AI from the project's own documentation and checked against our catalogue data
livego is an open-source live streaming server written in Go. You send it a live feed over RTMP, usually from broadcasting software or ffmpeg, and viewers can watch that feed over RTMP, HTTP-FLV or HLS. This guide shows you how to start the server, push a stream into it, and play it back, so you can test or self-host a basic live endpoint.
Quick start
- 1Install Docker. Make sure Docker is installed and running on your machine. Docker is the only prerequisite the install section lists for the image route.
- 2Start livego. Run the Docker command that maps ports 1935, 7001, 7002 and 8090. The server then listens for RTMP and serves the other protocols.
- 3Request a channel key. Open http://localhost:8090/control/get?room=movie in a browser and copy the key it returns.
- 4Push a stream. Send video to rtmp://localhost:1935/live/{channelkey} using broadcasting software or the ffmpeg command in this guide.
- 5Play the stream. Open the HTTP-FLV or HLS address in a player that supports it, or use the RTMP address in an RTMP-capable player.
What livego does and which protocols it supports
livego is described as a simple, efficient live broadcast server. It is written in pure Go and is cross-platform. You publish video to it and it serves that video back to viewers.
- Transport protocols: RTMP, AMF, HLS and HTTP-FLV
- Container formats: FLV and TS
- Encoding formats: H264, AAC and MP3
Install livego with Docker
The simplest route is the Docker image. Docker is the only prerequisite listed. The command below starts livego and maps the four ports it uses: 1935 for RTMP, 7001 for HTTP-FLV, 7002 for HLS and 8090 for the management interface.
If you prefer not to use Docker, the README says you can download a pre-built binary from the project's releases page and run it from the command line.
docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -p 8090:8090 -d gwuhaolin/livegoBuild livego from source
If you want to read or change the code, clone the repository and build it. The README lists go build or make build as the build step from inside the livego directory.
- Requires the Go toolchain for building from source
git clone https://github.com/gwuhaolin/livego.git
cd livego
go buildGet a channel key and push a stream
Once the service is running, request a channel key from the management interface. The README uses a room named movie as the example. Copy the key it returns; you will use it in the push address.
Push your video to the RTMP address with the key. The default app name is live, so replace {appname} with live unless you have changed it. The README gives an ffmpeg example that reads a local FLV file and pushes it without re-encoding. You can also use broadcasting software that can publish to an RTMP URL.
- Get the key: http://localhost:8090/control/get?room=movie
- Push address: rtmp://localhost:1935/{appname}/{channelkey}
ffmpeg -re -i demo.flv -c copy -f flv rtmp://localhost:1935/{appname}/{channelkey}Play back the stream over RTMP, HTTP-FLV or HLS
Viewers can watch the same stream in three ways. Use the addresses below, with {appname} set to live by default. The example room name is movie.
HLS is the most widely compatible for browsers and mobile devices in general use, but the README only lists the URL and does not describe player setup. For HTTPS HLS, the README says to generate a server.key and server.crt pair, place them next to the executable, and set use_hls_https to true in livego.yaml (false by default).
- RTMP: rtmp://localhost:1935/{appname}/movie
- HTTP-FLV: http://127.0.0.1:7001/{appname}/movie.flv
- HLS: http://127.0.0.1:7002/{appname}/movie.m3u8
- HLS over HTTPS: set use_hls_https to true in livego.yaml after placing server.key and server.crt beside the executable
Configure livego with command-line options
You can change ports, log level and other behaviour with flags. Run the help command to see the full list on your build. Settings you may change include listen addresses for each server, the config file name, the FLV output directory and the HLS keep-after-end behaviour.
- --rtmp_addr: RTMP listen address
- --httpflv_addr: HTTP-FLV listen address (default :7001)
- --hls_addr: HLS listen address (default :7002)
- --api_addr: management interface address (default :8090)
- --config_file: configuration file name (default livego.yaml)
- --flv_dir: output directory for FLV files (default tmp)
- --hls_keep_after_end: keep HLS files after the stream ends
- --level: log level (default info)
./livego -hWhat people use it for
- Testing an RTMP push workflow from ffmpeg against a local server
- Trying HLS playback on your own machine before choosing a hosted service
- Running a small self-hosted live endpoint for a internal or personal project
- Reading and modifying a compact Go streaming server to learn how RTMP works
Frequently asked questions
Is livego free to use?
livego is released under the MIT licence, according to the project's analysis. The MIT licence generally permits use, modification and redistribution, but read the licence file in the repository for the exact terms.
What do I need to run livego?
The Docker route requires Docker. To build from source you need Go and the repository cloned with git. You can also download a pre-built binary from the releases page and run it from the command line.
How do I push a stream to livego?
Get a channel key from http://localhost:8090/control/get?room=movie, then publish to rtmp://localhost:1935/{appname}/{channelkey}. The default app name is live. You can use ffmpeg or broadcasting software that supports RTMP.
Which playback formats does livego support?
The README lists RTMP, HTTP-FLV and HLS for playback. HLS is served at port 7002 by default, and HTTP-FLV at port 7001.
Can I use HLS over HTTPS with livego?
Yes. Generate server.key and server.crt, place them in the same directory as the executable, and set use_hls_https to true in livego.yaml. It is false by default.
How does livego compare to nginx-rtmp-module, SRS or MediaMTX?
The README does not compare livego with these projects, so this guide cannot rank them. livego is a small Go server that you can read and modify, while the other projects are separate tools with their own feature sets. Check each project's documentation for the features you need, such as scaling or authentication.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
livego suits developers and hobbyists who want a small, readable Go server for RTMP push and HLS or HTTP-FLV playback on their own machines. It is a poor fit for large public broadcasts that need a managed CDN, or for non-technical users who want a point-and-click tool, because setup and use happen on the command line.
Install options & downloads