Home > Software > How to Deploy Kasm Workspaces with Docker Compose

How to Deploy Kasm Workspaces with Docker Compose

Anastasios Antoniadis

Discover the seamless process of deploying Kasm Workspaces with our in-depth guide. Learn to set up this innovative platform to deliver browser-based desktops, applications, and web services securely and efficiently.

Docker (1)

Kasm Workspaces is a cutting-edge platform that delivers containerized applications and desktops through a browser. It’s designed to cater to the increasing demand for secure, remote access solutions, offering a unique blend of flexibility, security, and simplicity. Utilizing Docker, Kasm Workspaces can be easily deployed, scaled, and managed. This guide will walk you through setting up Kasm Workspaces using Docker Compose, enabling you to provide browser-based access to applications and desktop environments effortlessly.

Prerequisites

Before you start, ensure you have:

  • Docker installed on your system.
  • Docker Compose installed on your system.
  • Basic understanding of Docker concepts and the YAML syntax used in Docker Compose files.

Step 1: Prepare Your Environment

Create a directory dedicated to your Kasm Workspaces setup. This directory will contain your Docker Compose file (docker-compose.yml) and any additional configuration files or directories you might need.

mkdir kasm-docker && cd kasm-docker

Step 2: Create a Docker Compose File

Create the docker-compose.yml file:

touch docker-compose.yml

Open this file in a text editor and insert the following configuration:

version: '3.7'
services:
  kasm_db:
    image: kasmweb/mysql:0.0.2
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: kasm_db_root_password
      MYSQL_DATABASE: kasm
      MYSQL_USER: kasm_user
      MYSQL_PASSWORD: kasm_db_user_password
    volumes:
      - kasm_db_data:/var/lib/mysql

  kasm_redis:
    image: redis:6.2.1-alpine
    restart: always

  kasm_server:
    image: kasmweb/kasm_release:1.10.0
    restart: always
    depends_on:
      - kasm_db
      - kasm_redis
    ports:
      - "443:443"
    volumes:
      - kasm_data:/opt/kasm/current
    environment:
      DB_HOST: kasm_db
      REDIS_HOST: kasm_redis
      KASM_RELEASE: "1.10.0"

volumes:
  kasm_db_data:
  kasm_data:

Configuration Explained:

  • kasm_db: Sets up a MySQL database container for Kasm Workspaces. Environment variables are used to define the root password, database name, and user credentials.
  • kasm_redis: Deploys a Redis container, used by Kasm Workspaces for caching and session management.
  • kasm_server: Configures the main Kasm server container, linking it to the database and Redis containers. It exposes port 443 for HTTPS access to the Kasm UI.
  • volumes: Declares named volumes for persisting database data and Kasm server data, ensuring data retention across container restarts.

Step 3: Launch Kasm Workspaces

With your docker-compose.yml file ready, start Kasm Workspaces by running:

docker compose up -d

This command will download the necessary Docker images (if not already present) and start the Kasm containers in detached mode.

Step 4: Access Kasm Workspaces

Once the containers are up and running, access the Kasm Workspaces UI by navigating to https://<your-server-ip> in your web browser. You will be greeted with the Kasm login page.

The default login credentials are:

  • Username: admin
  • Password: changeme

Changing the default password immediately after the first login is strongly recommended for security reasons.

Step 5: Configure and Use Kasm Workspaces

After logging in, you can configure your Kasm Workspaces environment, including creating user accounts, defining workspace images, and setting up access controls. Users can then access their designated workspaces securely through a web browser, enjoying a seamless remote desktop or application experience.

Conclusion

Deploying Kasm Workspaces with Docker Compose offers a streamlined approach to providing secure, containerized desktops and applications accessible via web browsers. This setup simplifies deployment and enhances the manageability and scalability of your remote access solutions. Whether for remote work, educational purposes, or secure browsing needs, Kasm Workspaces provides a flexible and secure platform that meets the diverse requirements of modern digital environments.

Anastasios Antoniadis
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x