Webtop - Running Linux Desktop inside a Container in the Browser

Hari Prasad
featurepreneur
Published in
2 min readJul 1, 2021

What is Webtop?

LinuxServer.io introduced this concept of Webtop, which is a Lightweight Linux-based container with a Full Desktop Environment running in the Browser with A basic window manager, Pixel-perfect resolution for rendering, Audio support, Clipboard support, On-screen keyboard support, and remote file management for uploads/downloads.

The images are available in both Ubuntu and Alpine flavors

  • XFCE
  • KDE
  • MATE
  • i3
  • Openbox
  • IceWM

Although it is a Lightweight Linux Container, We can install Software Applications like VLC, Libre Office, VSCode, etc…

Before moving onto the hands-on part, Check whether you install Docker on your system, if not install using the below command.

sudo snap install dockerdocker --versiondocker-compose --version

Let’s get started

We can spin up the webtop using either docker-compose.yml or Docker CLI. In this case, I’m using the docker-compose.yml file

First, create a folder, go inside it and create a folder named config for volumes.

$ mkdir webtop
$ cd webtop
$ mkdir config

Create a docker-compose.yml file and use nano or VSCode to edit it

$ touch docker-compose.yml
$ nano docker-compose.yml
(or)$ code .

docker-compose.yml

---
version: "2.1"
services:
webtop:
image: ghcr.io/linuxserver/webtop:alpine-mate
container_name: webtop
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/India
volumes:
- your-folder-path-to/webtop/config:/config
ports:
- 3000:3000
shm_size: "1gb"
restart: unless-stopped

Here I used alpine-mate, you can choose different flavors from the link below.

Note - If you use the KDE and i3 flavors for Ubuntu need to be run in privileged mode to function properlyAdd "privileged: true" in your docker-compose.yml file

For PUID and PGID, use the below command

$ idoutput - uid=1000(user) gid=1000(user)

Copy the path of the config folder and paste it into volumes.

Leave rest as default, Now run the docker-compose.yml file

docker-compose up 

If you want your container to run in the background use -d for detached mode

It will take some to spin up. After the container started running, go to the browser and type http://localhost:3000/ in URL

Now, you can see Linux desktop is running in your browser with full functionality.

Thank you for reading, I hope you found this article useful.

If you face any issues comment below.

--

--