Play Audio Headlessly with cvlc

Use VLC's interface-less binary to play local files or network streams from a terminal, cron job, or SSH session.

LinuxvlcaudioheadlesscvlcLow risk
Run cvlc --play-and-exit music.mp3 to play a file and exit when done, or cvlc http://example.com:8000/stream.mp3 to tune into a stream.

01Command

Command
$ cvlc --play-and-exit music.mp3
cvlc http://example.com:8000/stream.mp3   # internet radio

02What it does

cvlc is VLC with no GUI attached — the same codecs and network stack, minus the interface. --play-and-exit makes it quit after the playlist finishes, which matters for scripts and cron-triggered playback. It handles everything VLC does: internet radio, Shoutcast/Icecast streams, and audio over SSH into a machine with speakers.

03Risk

RiskLow risk
RequirementsVLC (sudo apt install vlc / sudo dnf install vlc)
!Warning: cvlc holds the terminal while playing — use the rc interface (cvlc -I rc) for keyboard control or run it with nohup/ampersand to background it.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • vlc(1) — Linux man page
    Ubuntu Manpages · technical · 2026-09-17
    Evidence: VLC man page documenting cvlc (VLC without interface) and --play-and-exit for quitting after playback.

Last verified: 2026-09-17 · Category: Media