Harnessing Kasm: A Comprehensive Guide to Setup and Usage
Written on
Introduction to Kasm
Kasm is a powerful container-based streaming solution that enables users to deploy Docker containers on a server, which can then be accessed via a web browser. This tool is ideal for a range of applications, from browser isolation to product development. In this guide, I will walk you through the setup process and the functionalities of Kasm.
Getting Started
To begin using Kasm, you will need a server, which can either be a local machine or a cloud-based server. For this tutorial, we will utilize a cloud server.
Minimum System Requirements for Kasm
- 2 CPU Cores
- 4 GB RAM
- 50 GB Storage (SSD preferred)
Supported Operating Systems:
- Ubuntu 18.04/20.04
- Debian 9/10
- CentOS 7/8
- Oracle Linux 7/8
For this demonstration, we will use Ubuntu 20.04.
Setting Up a Linode Server
To simplify the process, this guide will focus on using a Linode server. This allows you to try out the service for free, with new accounts receiving $100 in credits, which is more than enough to cover the approximate $20 monthly cost of running Kasm.
Steps for Setup
- Click on "Create" in Linode.
- Select a supported image.
- Choose the nearest region.
- Pick a Linode plan with shared CPUs.
- Name your Linode under the label section.
- Set a root password.
- Click on "Create Linode."
Once your server is created, log in using your preferred command line tool (Command Prompt for Windows or Terminal for Linux/Mac) with the password you just set.
Next, initiate the installation of the Kasm server. To ensure optimal performance, let’s create a swap partition as recommended by Kasm.
Verifying and Configuring the Swap Partition
Check if the swap partition exists with the appropriate command.
Next, add this swap partition to the fstab file to ensure it mounts on boot.
After that, download the Kasm setup files and unzip them.
Start the setup script and once it completes, record your credentials for the Kasm web UI. You can access your Kasm server interface via the public IP address of your Linode instance. Feel free to keep the default password or reset it in the profiles section.
What is Browser Isolation?
Kasm serves as a secure intermediary between your device and the internet. It streams information through its browser while keeping your identity safe by eliminating cookies and other identifying elements. When your session concludes, it can be easily discarded—essentially functioning as a virtual machine.
To enhance your browsing experience, you can adjust the streaming quality using the three buttons on the screen, which helps minimize latency.
Setting Up Native Browser Support for Kasm
Using Firefox:
- Download the Kasm addon from the Firefox marketplace.
- Activate it in your add-ons settings.
- Update the IP address to that provided by Linode in the addon options.
- In your Kasm Dashboard, set the default behavior to display Firefox.
Using Chrome:
- Get the Kasm extension from the Chrome Marketplace.
- Enable it in your extensions list.
- Change the IP address to that of your Linode.
- Adjust the default behavior in the Kasm Dashboard to show Chrome.
This setup allows you to open links in an isolated environment simply by right-clicking and selecting the Kasm option.
Creating Users and Groups
User management is handled within the Admin tab of the Dashboard. You can create users with a username and password, maintaining comprehensive information such as:
- Name
- Realm (Single Sign-On Authentication)
- Notes
- Lock status (for excessive sign-in attempts)
- Disabled status (for admin-initiated account disabling)
- Reset options for two-factor authentication
- Organizational affiliation
- Phone number
Groups are limited to Admin and Users by default. To create a new group, you need to specify a name and priority level. If permissions overlap, the group with the lower priority will take precedence.
Monitoring and Logging
The Admin Dashboard provides detailed monitoring statistics, including:
- User activity
- Current statistics
- Image usage
- Live sessions
- Agent performance
- Domain usage
To observe active sessions, navigate to the Sessions tab. For logging, you can access all Kasm logs via the designated tab. You can monitor Docker containers by executing the “docker ps” command to view running components.
Web Filtering
Web Filtering restricts access to certain websites as determined by the Admin. To create a filtering policy:
- Access the Web Filter section in the Admin Dashboard.
- Create a new policy, filling in the required name field.
- You can specify whitelisted and blacklisted sites, as well as enable Safe Search.
Persistent Profiles
Persistent Profiles allow certain aspects of the image to remain intact even after the instance is closed. This feature requires the use of the default Admin group. Select the desired image, edit it, and define a persistent profile path.
In addition, Kasm offers advanced features like Staging and Session Casting, which are beyond the scope of this article but worth exploring.
In conclusion, Kasm is a versatile and valuable tool that can be set up on either a cloud server or a physical server. My experience with Kasm has been positive, and while I plan to transition to a bare metal server, the cloud setup has proven to be convenient and effective. If you’re interested in this type of solution, utilizing the cloud version is both hassle-free and straightforward. I hope you find this tutorial informative.
Note: This article is not sponsored by Kasm or Linode.
Kasm Workspaces Overview
Explore Kasm Workspaces, a container-based solution that streamlines your development and browsing experience.
Kasm Workspaces Simplified: The Essential Guide for New Users
This video offers a simplified introduction to Kasm Workspaces, ideal for users new to the platform.