Stream Content to Discord Using Kasm and Docker

Streaming to Discord is typically tied to a local desktop environment. You install the Discord desktop client, share your screen, and your machine becomes the broadcast source.
That works fine for casual use, but it becomes limiting when you want to stream from a server, a headless system, or a fully containerized environment. Developers, homelab users, and streamers often run their workloads remotely, yet Discord screensharing has historically been a local-only workflow.
This post introduces kasm-discord-screenshare, an open-source project that enables Discord screensharing with audio from inside a Kasm Workspace using Docker. The stream originates from the container, not your personal computer.
Project repository:
https://github.com/f00d4tehg0dz/kasm-discord-screenshare
The Problem
Discord’s native screenshare assumes:
- A locally installed Discord client
- A graphical desktop session
- Direct access to audio and display devices
Running Discord inside a container is already non-trivial. Getting system audio to pass through to screenshare adds another layer of complexity. As a result, most people default to running Discord on their main machine, even if the content being streamed lives somewhere else.
This creates friction when you want a clean, isolated, reproducible streaming environment.
The Idea
Instead of forcing Discord to live on your local system, run it inside a container that already has:
- A lightweight desktop environment
- PipeWire for audio routing
- Discord Screen Audio support
- A browser and basic utilities
Kasm Workspaces provides the missing piece: a browser-accessible, containerized desktop platform.
By combining Kasm with a purpose-built Discord container, you get a remote desktop where Discord behaves like a normal desktop app and can screenshare with audio.
What is kasm-discord-screenshare
kasm-discord-screenshare is a preconfigured Kasm-compatible Docker image that includes:
- Discord Desktop
- PipeWire audio stack
- discord-screen-audio
- Desktop environment configured for Kasm
Once launched inside Kasm, you open Discord, join a voice channel, and use screenshare normally. The broadcast is sent directly from the container.
High-Level Architecture
- User connects to Kasm through a browser
- Kasm launches the custom workspace image
- Discord runs inside the container
- User joins a Discord voice channel
- Screenshare and audio stream from the container
Your local computer is only acting as a viewer of the Kasm session.
Requirements
- Docker is installed on the host
- Kasm Workspaces installed
- Basic familiarity with Docker and containers
docker pull f00d4tehg0dz/kasm-discord-screenshare:latestAdding the Image to Kasm
In the Kasm admin interface:
- Go to Workspaces
- Click Add Workspace
- Choose Docker Image
- Enter:
- Save and enable the workspace
f00d4tehg0dz/kasm-discord-screenshare:latestThe workspace will now appear in the user dashboard.
Launching Discord
After starting the workspace, open a terminal inside the container:
discordAlternatively, launch Discord from the desktop shortcut if present.
Log in normally with your Discord account.
Starting Screenshare With Audio
- Join a Discord voice channel
- Click Share Screen
- Choose the entire screen or a specific window
- Ensure Sound is enabled
Audio is routed through PipeWire and discord-screen-audio, allowing viewers to hear system audio along with video.
Example Use Cases
- Remote movie streaming
- Watch parties
- Application demos
- Development walkthroughs
- Presentations
- Cloud-hosted broadcast environments
Extending the Image
You can easily add additional software by extending the Docker image.
Example Dockerfile:
FROM f00d4tehg0dz/kasm-discord-screenshare:latest
RUN apt-get update && \
apt-get install -y vlc obs-studio firefox && \
apt-get cleanBuild the image:
docker build -t my-kasm-discord .Use my-kasm-discord as your workspace image in Kasm.
Persisting User Data
To preserve Discord logins and settings between sessions:
- Map a persistent volume to /home/kasm-user
- Enable persistent profiles in Kasm workspace settings
This prevents reconfiguration every time the workspace is launched.
Limitations
- GPU acceleration depends on the host configuration
- Audio routing can vary by system
- Discord updates may occasionally affect screen audio
These are inherent challenges of containerized desktop environments.
Why This Matters
This approach shifts Discord screensharing from a local desktop concern to an infrastructure-level capability.
You gain:
- Portable streaming environments
- Reproducible setups
- Cleaner separation between the personal machine and the broadcast system
- Easier automation and scaling
For developers, streamers, and homelab builders, this opens new possibilities for remote-first content streaming.
Closing Thoughts
Containerized desktops are reaching a point where they can replace many traditional desktop workflows. Running Discord with full screenshare and audio inside Kasm demonstrates how far this model has come.
If you experiment with this project or extend it in interesting ways, consider sharing your results or contributing back.
Repository: https://github.com/f00d4tehg0dz/kasm-discord-screenshare