Kasm Workspaces on Ubuntu: Stream Isolated Desktops to Any Browser

HomeLab tutorial - IT technology blog
HomeLab tutorial - IT technology blog

Comparing Remote Access: Why I Swapped VNC/RDP for Container Streaming

Early in my HomeLab journey, I relied on traditional protocols like RDP or VNC. They work, but they’re often clunky. These methods capture the screen of a machine and push those pixels to your client. The result? It usually feels sluggish, demands specific client apps, and opens security holes if you expose those ports to the web.

Kasm Workspaces flips the script with Container Streaming. Instead of booting a heavy Virtual Machine, Kasm fires up a lightweight Docker container for each session. It uses the KasmVNC protocol to stream the desktop via WebRTC or WebSockets. You don’t need to install a thing on your laptop or tablet. If you have a modern browser, you’re ready to go.

Security is where this approach really shines. In a standard VM, a single malicious link can compromise your entire OS. With Kasm, sessions can be completely ephemeral. Log out, and the container is instantly nuked. Every trace of that session—from browser history to malware—vanishes. It provides a level of isolation that RDP simply can’t achieve without massive resource overhead.

The Reality of Kasm: Pros and Cons

After running Kasm for over 14 months, I’ve learned that it isn’t magic—it involves clear trade-offs. Here is the breakdown of what actually matters for a HomeLab user.

The Pros

  • Zero-Trust Architecture: Everything is sandboxed. If a session gets hijacked, the attacker is stuck inside a restricted container, far away from your host files.
  • Total Portability: I’ve accessed my full Ubuntu dev environment from a locked-down office PC and even a 5-year-old iPad at a cafe. It just works.
  • High Density: You can run 15+ isolated browser sessions on hardware that would struggle to handle three Windows VMs.
  • Fluid Integration: Audio and clipboard sharing are seamless. If you’re watching a video or copying code, it feels like the app is running natively on your machine.

The Cons

  • RAM Hunger: Containers are light, but modern browsers are not. A single Chrome session usually eats 400MB to 800MB of RAM. You’ll want 8GB minimum for a smooth multi-session experience.
  • Heavy Images: Kasm desktop images are beefy. Each one ranges from 1.5GB to 3.5GB. If you download every app in the registry, your SSD will fill up fast.
  • Upload Speed Matters: While WebRTC is efficient, you’ll want at least 10Mbps upload speed for a lag-free experience when accessing your lab remotely.

The Ideal Hardware Specs

Kasm is particular about its environment. While it runs on various distros, Ubuntu 22.04 or 24.04 provides the most stable experience because the official scripts are built for them. Deploying Kasm is a foundational skill for anyone wanting to share internal tools securely without the friction of managing individual VPN accounts for every user.

For a reliable setup, aim for these targets:

  • OS: Ubuntu 24.04 LTS (A fresh install is highly recommended).
  • CPU: 2 Cores (4+ Cores if you plan on streaming video or heavy IDEs).
  • RAM: 8GB is the sweet spot for a small team or personal use.
  • Storage: 50GB SSD (Avoid HDDs; the container startup time will be painful).
  • Swap: Mandatory. Even with 64GB of RAM, the installer will stop if it doesn’t detect at least 1GB of swap.

Installation Guide: Getting Kasm Running on Ubuntu

We’ll use the official installer. It automates the Docker setup, creates the virtual network, and configures the local database for you.

Step 1: System Preparation and Swap Config

Check your swap status first. Many VPS providers disable it by default, which will crash the Kasm installer. Let’s fix that and update the system.

# Refresh repositories and upgrade
sudo apt update && sudo apt upgrade -y

# Verify swap status
swapon --show

# If empty, create a 4GB swap file
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# Ensure swap persists after reboot
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Step 2: Download the Kasm Release

Move to your /tmp folder to keep the root directory clean. We’ll pull the latest stable release (v1.15.0 as of this writing).

cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.15.0.0638dd.tar.gz
tar -xf kasm_release_1.15.0.0638dd.tar.gz

Quick tip: Check the Kasm downloads page to ensure you’re grabbing the newest version link before running the curl command.

Step 3: Trigger the Installer

The script handles everything. I use the --accept-eula flag to skip the manual prompt. If you need to use a port other than 443, you can specify it here, but defaults are usually best for the initial setup.

sudo bash kasm_release/install.sh

Expect this to take 5 to 10 minutes. The script has to pull several gigabytes of core Docker images for the proxy, manager, and database services.

Step 4: Secure Your Credentials

When the script finishes, it will dump a list of passwords into your terminal. Stop! Do not clear your screen. You need to save the Admin User and Standard User credentials immediately. Losing these means diving into the database container for a manual reset—save yourself the headache.

Kasm UI Login Credentials

-----------------------------------------
  Admin User: [email protected]
  Password: [YourUniquePassword]
-----------------------------------------
  Standard User: [email protected]
  Password: [YourUniquePassword]
-----------------------------------------

Step 5: First Launch and Testing

Navigate to https://your-server-ip. Your browser will warn you about a self-signed certificate. This is normal. Click “Advanced” and proceed. Log in with the admin account and follow these steps to start your first session:

  1. Select Workspaces from the top navigation bar.
  2. The registry shows pre-installed apps like Chrome or basic Ubuntu.
  3. Click an icon (like Chrome) and hit Launch Session.
  4. A new tab opens. Within 3-5 seconds, you’ll have a full browser running on your server, streamed perfectly to your desktop.

Step 6: Persistence and SSL

By default, Kasm deletes everything when you close a session. If you want your files to stay, go to Workspaces -> Edit (pencil icon) -> Persistent Profile. I enable this for my coding environment but keep it off for my “burner” browser used for testing suspicious links.

For a professional feel, set up a reverse proxy like Nginx Proxy Manager or a Cloudflare Tunnel. This lets you use a real SSL certificate and a custom domain like lab.yourdomain.com instead of a raw IP address.

Share: