Portainer Templates logo

Portainer Templates

Kasm Kasm

Remote DesktopBusiness

Kasm Workspaces is a docker container streaming platform for delivering browser-based access to desktops, applications, and web services. Kasm uses devops-enabled Containerized Desktop Infrastructure (CDI) to create on-demand, disposable, docker containers that are accessible via web browser. Example use-cases include Remote Browser Isolation (RBI), Data Loss Prevention (DLP), Desktop as a Service (DaaS), Secure Remote Access Services (RAS), and Open Source Intelligence (OSINT) collections. The rendering of the graphical-based containers is powered by the open-source project KasmVNC.

Image details

Pulls: 532k
Architectures: amd64, arm64
Image size: 278 MB
Latest: 1.19.0
User: linuxserver
Created: Jul 08, 2022
Updated: 5 days ago
Status: active

Configuration

Type
Container
Platform
linux
Image
linuxserver/kasm:latest
Privileged
Yes
Ports
3000:3000/tcp443:443/tcp
Volumes
/opt : /srv/lsio/kasm/opt/profiles : /srv/lsio/kasm/profiles/dev/input : /dev/input/run/udev/data : /run/udev/data
Env vars
KASM_PORT=443DOCKER_HUB_USERNAME=USERDOCKER_HUB_PASSWORD=PASSDOCKER_MTU=1500
Restart
unless-stopped

Template by technorabilia

Notes

Portainer App Templates by Technorabilia, based on data provided by LinuxServer.io.

Ensure to create the following volume directories on the host file system, or modify the paths in the volume mapping section under the advanced options below, as needed.

mkdir -p /srv/lsio/kasm/opt
mkdir -p /srv/lsio/kasm/profiles

Installation

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select the app you wish to deploy, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo

docker run -d --name Kasm \
  --privileged \
  -p 3000:3000/tcp \
  -p 443:443/tcp \
  -e 'KASM_PORT=443' \
  -e 'DOCKER_HUB_USERNAME=USER' \
  -e 'DOCKER_HUB_PASSWORD=PASS' \
  -e 'DOCKER_MTU=1500' \
  -v /srv/lsio/kasm/opt:/opt \
  -v /srv/lsio/kasm/profiles:/profiles \
  -v /dev/input:/dev/input \
  -v /run/udev/data:/run/udev/data \
  --restart=unless-stopped \
  linuxserver/kasm:latest

Save this file as compose.yaml and run docker compose up -d
Use this only as a guide.

services:
  kasm:
    image: linuxserver/kasm:latest
    ports:
      - 3000:3000/tcp
      - 443:443/tcp
    volumes:
      - /srv/lsio/kasm/opt:/opt
      - /srv/lsio/kasm/profiles:/profiles
      - /dev/input:/dev/input
      - /run/udev/data:/run/udev/data
    environment:
      KASM_PORT: '443'
      DOCKER_HUB_USERNAME: USER
      DOCKER_HUB_PASSWORD: PASS
      DOCKER_MTU: '1500'
    privileged: true
    restart: unless-stopped

Save each file below into a folder, then run kubectl apply -f .
Written for k3s, but works on any cluster: bind mounts use hostPath, named volumes get a persistent volume claim, and ports are exposed via a LoadBalancer service.

kasm-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kasm
  labels:
    app: kasm
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kasm
  template:
    metadata:
      labels:
        app: kasm
    spec:
      containers:
        - name: kasm
          image: linuxserver/kasm:latest
          env:
            - name: KASM_PORT
              value: '443'
            - name: DOCKER_HUB_USERNAME
              value: USER
            - name: DOCKER_HUB_PASSWORD
              value: PASS
            - name: DOCKER_MTU
              value: '1500'
          ports:
            - containerPort: 3000
              protocol: TCP
            - containerPort: 443
              protocol: TCP
          volumeMounts:
            - name: kasm-data-0
              mountPath: /opt
            - name: kasm-data-1
              mountPath: /profiles
            - name: kasm-data-2
              mountPath: /dev/input
            - name: kasm-data-3
              mountPath: /run/udev/data
          securityContext:
            privileged: true
      volumes:
        - name: kasm-data-0
          hostPath:
            path: /srv/lsio/kasm/opt
        - name: kasm-data-1
          hostPath:
            path: /srv/lsio/kasm/profiles
        - name: kasm-data-2
          hostPath:
            path: /dev/input
        - name: kasm-data-3
          hostPath:
            path: /run/udev/data

kasm-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: kasm
spec:
  type: LoadBalancer
  selector:
    app: kasm
  ports:
    - name: 3000-tcp
      port: 3000
      targetPort: 3000
      protocol: TCP
    - name: 443-tcp
      port: 443
      targetPort: 443
      protocol: TCP

Save this file as ~/.config/containers/systemd/kasm.container

[Unit]
Description=Kasm

[Container]
Image=linuxserver/kasm:latest
ContainerName=kasm
PublishPort=3000:3000/tcp
PublishPort=443:443/tcp
Environment=KASM_PORT=443
Environment=DOCKER_HUB_USERNAME=USER
Environment=DOCKER_HUB_PASSWORD=PASS
Environment=DOCKER_MTU=1500
Volume=/srv/lsio/kasm/opt:/opt
Volume=/srv/lsio/kasm/profiles:/profiles
Volume=/dev/input:/dev/input
Volume=/run/udev/data:/run/udev/data
PodmanArgs=--privileged

[Service]
Restart=always

[Install]
WantedBy=default.target

Then reload systemd and start the service:

systemctl --user daemon-reload
systemctl --user start kasm

For a system-wide service, use /etc/containers/systemd/ and drop --user.

For more installation options, see the Documentation in our GitHub repo

linuxserver.io
Blog Discord Discourse GitHub Open Collective
The LinuxServer.io team brings you another container release featuring:
  • regular and timely application updates
  • easy user mappings (PGID, PUID)
  • custom base image with s6 overlay
  • weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
  • regular security updates

Find us at:
  • Blog - all the things you can do with our containers including How-To guides, opinions and much more!
  • Discord - realtime support / chat with the community and the team.
  • Discourse - post on our community forum.
  • GitHub - view the source for all of our repositories.
  • Open Collective - please consider helping us by either donating or contributing to our budget

linuxserver/kasm

Scarf.io pulls GitHub Stars GitHub Release GitHub Package Repository GitLab Container Registry Quay.io Docker Pulls Docker Stars Jenkins Build
Kasm Workspaces is a docker container streaming platform for delivering browser-based access to desktops, applications, and web services. Kasm uses devops-enabled Containerized Desktop Infrastructure (CDI) to create on-demand, disposable, docker containers that are accessible via web browser. Example use-cases include Remote Browser Isolation (RBI), Data Loss Prevention (DLP), Desktop as a Service (DaaS), Secure Remote Access Services (RAS), and Open Source Intelligence (OSINT) collections.
The rendering of the graphical-based containers is powered by the open-source project KasmVNC.
kasm

Supported Architectures

We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.
Simply pulling lscr.io/linuxserver/kasm:latest should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
The architectures supported by this image are:
| Architecture | Available | Tag | | :----: | :----: | ---- | | x86-64 | ✅ | amd64-\ | | arm64 | ✅ | arm64v8-\ |

Application Setup

This container uses Docker in Docker and requires being run in privileged mode. This container also requires an initial setup that runs on port 3000.
Unlike other containers the web interface port (default 443) needs to be set for the env variable KASM_PORT and both the inside and outside port IE for 4443 KASM_PORT=4443 -p 4443:4443
Unraid users due to the DinD storage layer /opt/ should be mounted directly to a disk IE /mnt/disk1/appdata/path or optimally with a cache disk at /mnt/cache/appdata/path
Access the installation wizard at https://your ip:3000 and follow the instructions there. Once setup is complete access https://your ip:443 and login with the credentials you entered during setup. The default users are:

Currently Synology systems are not supported due to them blocking CPU scheduling in their Kernel.

Upgrading KASM

In order to upgrade Kasm, first make sure you are using the latest docker image, and then perform the in app update from the installation wizard. Docker image update and recreation of container alone won't upgrade Kasm.
Following the upgrade, you will need to update any workspace image tags to match the new version.

GPU Support

During installation an option will be presented to force all Workspace containers to mount in and use a specific GPU. If using an NVIDIA GPU you will need to pass -e NVIDIA_VISIBLE_DEVICES=all or --gpus all and have the NVIDIA Container Toolkit installed on the host. Also if using NVIDIA, Kasm Workspaces has native NVIDIA support so you can optionally opt to simply use that instead of he manual override during installation.

Gamepad support

In order to properly create virtual Gamepads you will need to mount from your host /dev/input and /run/udev/data. Please see HERE for instructions on enabling gamepad support.

Persistant profiles

In order to use persistant profiles in Workspaces you will need to mount in a folder to use from your host to /profiles. From there when configuring a workspace you can set the Persistant Profile Path to IE /profiles/ubuntu-focal/{username}/, more infomation can be found HERE.

Reverse proxy

A sample for SWAG can be found here. Post installation you will need to modify the "Proxy Port" setting under the default zone to 0 as outlined here to launch Workspaces sessions.

Strict reverse proxies

This image uses a self-signed certificate by default. This naturally means the scheme is https. If you are using a reverse proxy which validates certificates, you need to disable this check for the container.

Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.
>!NOTE >Unless a parameter is flagged as 'optional', it is mandatory and a value must be provided.

docker-compose (recommended, click here for more info)

---
services:
  kasm:
    image: lscr.io/linuxserver/kasm:latest
    container_name: kasm
    privileged: true
    security_opt:
      - apparmor:rootlesskit #optional
    environment:
      - KASM_PORT=443
      - DOCKER_HUB_USERNAME=USER #optional
      - DOCKER_HUB_PASSWORD=PASS #optional
      - DOCKER_MTU=1500 #optional
    volumes:
      - /path/to/kasm/data:/opt
      - /path/to/kasm/profiles:/profiles #optional
      - /dev/input:/dev/input #optional
      - /run/udev/data:/run/udev/data #optional
    ports:
      - 3000:3000
      - 443:443
    stop_grace_period: "90s" #optional
    restart: unless-stopped

docker cli (click here for more info)

docker run -d \
  --name=kasm \
  --privileged \
  --security-opt apparmor=rootlesskit `#optional` \
  -e KASM_PORT=443 \
  -e DOCKER_HUB_USERNAME=USER `#optional` \
  -e DOCKER_HUB_PASSWORD=PASS `#optional` \
  -e DOCKER_MTU=1500 `#optional` \
  -p 3000:3000 \
  -p 443:443 \
  -v /path/to/kasm/data:/opt \
  -v /path/to/kasm/profiles:/profiles `#optional` \
  -v /dev/input:/dev/input `#optional` \
  -v /run/udev/data:/run/udev/data `#optional` \
  --stop-timeout="90s" `#optional` \
  --restart unless-stopped \
  lscr.io/linuxserver/kasm:latest

Parameters

Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.
| Parameter | Function | | :----: | --- | | -p 3000:3000 | Kasm Installation wizard. (https) | | -p 443:443 | Kasm Workspaces interface. (https) | | -e KASM_PORT=443 | Specify the port you bind to the outside for Kasm Workspaces. | | -e DOCKER_HUB_USERNAME=USER | Optionally specify a DockerHub Username to pull private images. | | -e DOCKER_HUB_PASSWORD=PASS | Optionally specify a DockerHub password to pull private images. | | -e DOCKER_MTU=1500 | Optionally specify the mtu options passed to dockerd. | | -v /opt | Docker and installation storage. | | -v /profiles | Optionally specify a path for persistent profile storage. | | -v /dev/input | Optional for gamepad support. | | -v /run/udev/data | Optional for gamepad support. | | --stop-timeout= | Increase container shutdown delay to give Kasm services time to stop cleanly. | | --security-opt apparmor=rootlesskit | Some hosts require this on top of privileged for namespacing to work properly inside the DinD layer. |

Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend FILE__.
As an example:
-e FILE__MYVAR=/run/secrets/mysecretvariable

Will set the environment variable MYVAR based on the contents of the /run/secrets/mysecretvariable file.

Umask for running applications

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

Docker Mods

Docker Mods Docker Universal Mods
We publish various Docker Mods to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.

Support Info

  • Shell access whilst the container is running:
```bash
docker exec -it kasm /bin/bash
```
  • To monitor the logs of the container in realtime:
```bash
docker logs -f kasm
```
  • Container version number:
```bash
docker inspect -f '{{ index .Config.Labels "build_version" }}' kasm
```
  • Image version number:
```bash
docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/kasm:latest
```

Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.
Below are the instructions for updating containers:

Via Docker Compose

  • Update images:
* All images:

    ```bash
    docker-compose pull
    ```

* Single image:

    ```bash
    docker-compose pull kasm
    ```
  • Update containers:
* All containers:

    ```bash
    docker-compose up -d
    ```

* Single container:

    ```bash
    docker-compose up -d kasm
    ```
  • You can also remove the old dangling images:
```bash
docker image prune
```

Via Docker Run

  • Update the image:
```bash
docker pull lscr.io/linuxserver/kasm:latest
```
  • Stop the running container:
```bash
docker stop kasm
```
  • Delete the container:
```bash
docker rm kasm
```
  • Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)
  • You can also remove the old dangling images:
```bash
docker image prune
```

Image Update Notifications - Diun (Docker Image Update Notifier)

>!TIP >We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Building locally

If you want to make local modifications to these images for development purposes or just to customize the logic:
git clone https://github.com/linuxserver/docker-kasm.git
cd docker-kasm
docker build \
  --no-cache \
  --pull \
  -t lscr.io/linuxserver/kasm:latest .

The ARM variants can be built on x8664 hardware and vice versa using lscr.io/linuxserver/qemu-static
docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Versions

  • 16.04.26: - Update for 1.18.1 release. Use rolling service images. Bump docker to v29.
  • 13.11.25: - Pin docker to v28 to avoid API deprecation issues.
  • 22.10.25: - Update for 1.18.0 release.
  • 08.06.25: - Deprecate develop branch.
  • 03.06.25: - Rebase to Ubuntu Noble. Update for 1.17.0 release.
  • 09.11.24: - Update base image for 1.16.1 release.
  • 24.09.24: - Add base users in docker build logic to survive container upgrades.
  • 17.09.24: - Update base image for 1.16.0 release and fix Nvidia support.
  • 16.02.24: - Update base image for 1.15.0 release.
  • 22.08.23: - Update base image for 1.14.0 release.
  • 07.04.23: - Add mod layer for ingesting LSIO images for 1.13.0 release.
  • 28.03.23: - Pin compose to 2.5.0 to be in sync with upstream requirements.
  • 05.11.22: - Rebase to Jammy, add support for GPUs, add support for Gamepads.
  • 23.09.22: - Migrate to s6v3.
  • 02.07.22: - Initial Release.

Serve Kasm on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying kasm.example.com to http://Kasm:3000

Add this to your Caddyfile

kasm.example.com {
	reverse_proxy http://Kasm:3000
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs Kasm
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Port already in use

If deployment fails with "Bind for 0.0.0.0:3000 failed: port is already allocated", something else on your server is using that port.

  • Find what's using it: sudo ss -tlnp | grep :3000
  • Stop the other service, or pick a different host port. In 3000:3000 only the left number is yours to change, the right one belongs to the app.

Running but the page won't load

The container is up but nothing appears in your browser.

  • Use your server's real IP: http://your-server-ip:3000. The 0.0.0.0 link Portainer shows isn't a real address.
  • Give it a minute after first deploy, Kasm can take a while to initialise.
  • Make sure your firewall allows the port, e.g. sudo ufw allow 3000

Permission denied on volumes

If the logs show "permission denied", the app can't write to its data folder on the host.

  • Fix the ownership: sudo chown -R 1000:1000 /srv/lsio/kasm/opt (and the same for the other mapped folders)

Image won't pull

Test the pull directly on the host: docker pull linuxserver/kasm:latest

  • "manifest unknown" means the tag no longer exists. This template uses latest, so try pinning a specific version instead.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: amd64, arm64
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect Kasm --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Privileged mode

This template runs the container in privileged mode, giving it full access to your host.

  • Only deploy it if you trust the app.
  • If deployment is blocked, your Portainer security settings or hardened host may not allow privileged containers.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

Similar apps