# linuxserver/docker-webtop architecture

> Architecture diagram of the GitHub repository linuxserver/docker-webtop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/linuxserver/docker-webtop
- Repository: https://github.com/linuxserver/docker-webtop

## Overview

##### Main Components

a. Client Layer:
- Web Browser (HTTP/HTTPS access)
- Ports 3000 (HTTP) and 3001 (HTTPS)

b. Container Layer:
- NGINX Web Server (handling HTTP/HTTPS)
- KasmVNC Server (desktop streaming)
- Desktop Environment Options (XFCE/KDE/MATE/i3/Openbox/IceWM)
- Base OS Options (Alpine/Ubuntu/Fedora/Arch/Debian)

c. Storage & Configuration:
- /config volume (persistent storage)
- Docker socket (optional)
- GPU devices (optional)

d. Authentication Layer:
- Basic HTTP Authentication (optional)
- Reverse Proxy Integration (recommended for security)

##### Relationships and Data Flow

**[Web Browser] <--HTTP/HTTPS--> [NGINX] <--> [KasmVNC Server] <--> [Desktop Environment]**
- ^

- [Authentication Layer (Optional)]

**[Container] <---> [Host System]**

- /config       |-- Docker Socket
- GPU Access    |-- Hardware Resources

##### Additional Notes

- Version tags and their corresponding configurations
- Optional mods and extensions support
- Persistent vs. ephemeral storage areas

##### Implementation Details

- Multi-architecture support
- Base image variations
- Desktop environment options
- Security considerations
- Hardware acceleration capabilities
- Volume mounting points
- Network port mappings

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph Container["Docker Container"]
        NGINX["NGINX Web Server"]
        KasmVNC["KasmVNC Server"]
        
        subgraph Desktop["Desktop Environment"]
            WM["Window Manager"]:::wm
            Apps["Applications"]:::apps
            Browser2["Web Browser"]:::browser
        end
        
        subgraph Config["Configuration"]
            DefConfig["Default Configs"]:::config
            SysBin["System Binaries"]:::sysbin
        end
    end

    subgraph Storage["Storage & Resources"]
        ConfigVol["/config Volume"]
        Docker["Docker Socket"]
        GPU["GPU Devices"]
    end

    subgraph Auth["Authentication"]
        BasicAuth["Basic HTTP Auth"]
        ReverseProxy["Reverse Proxy"]
    end

    subgraph CI["CI/CD"]
        Jenkins["Jenkins Pipeline"]:::ci
        GHActions["GitHub Actions"]:::ci
        PackageManager["Package Management"]:::pkg
    end

    Browser --"HTTP:3000\nHTTPS:3001"--> NGINX
    NGINX --> BasicAuth
    BasicAuth --> KasmVNC
    KasmVNC --> WM
    WM --> Apps
    WM --> Browser2
    Container <--> ConfigVol
    Container <--> Docker
    Container <--> GPU

    %% Component Mappings
    click WM "https://github.com/linuxserver/docker-webtop/blob/master/root/defaults/startwm.sh"
    click Browser2 "https://github.com/linuxserver/docker-webtop/tree/master/root/usr/bin/chromium"
    click DefConfig "https://github.com/linuxserver/docker-webtop/tree/master/root/defaults/"
    click SysBin "https://github.com/linuxserver/docker-webtop/tree/master/root/usr/bin/"
    click Jenkins "https://github.com/linuxserver/docker-webtop/tree/master/Jenkinsfile"
    click GHActions "https://github.com/linuxserver/docker-webtop/blob/master/.github/workflows/external_trigger.yml"
    click PackageManager "https://github.com/linuxserver/docker-webtop/blob/master/package_versions.txt"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef wm fill:#97c2fc,stroke:#2d6ac7
    classDef apps fill:#b5d3e7,stroke:#4a90e2
    classDef browser fill:#ffcccb,stroke:#ff0000
    classDef config fill:#ffe5cc,stroke:#ff9933
    classDef sysbin fill:#e6ccff,stroke:#9933ff
    classDef ci fill:#90EE90,stroke:#32CD32
    classDef pkg fill:#FFB6C1,stroke:#FF69B4

    %% Legend
    subgraph Legend
        L1["Window Manager"]:::wm
        L2["Applications"]:::apps
        L3["Web Browser"]:::browser
        L4["Configuration"]:::config
        L5["System Binaries"]:::sysbin
        L6["CI/CD"]:::ci
        L7["Package Management"]:::pkg
    end
```
