# Installastion ClipCascade Server

### Beschreibung:

ClipCascade ist ein Selfhost-Server mit dem sich eine Zwischenablage Synchronisieren lässt.

### Vorrausetzungen:

Wir brauchen wieder eine Feste IP und einen DNS-Namen

### Installation:

#### Server installation:

```
apt install docker.io docker-compose curl
```

Verzeichnis erstellen

```
mkdir /root/clipcascade
```

nun die .env Datei erstellen

```
nano /root/clipcascade/.env
```

Variablen Tabelle

For a comprehensive list of available environment variables, refer to the [Advanced Details](https://github.com/Sathvik-Rao/ClipCascade?tab=readme-ov-file#%EF%B8%8F-advanced-details) section.

<table id="bkmrk-variable-description" tabindex="0"><thead><tr><th>Variable</th><th>Description</th><th>Default Value</th><th>Example</th></tr></thead><tbody><tr><td>`CC_MAX_MESSAGE_SIZE_IN_MiB`</td><td>Defines the maximum allowed message size in MiB. Ignored if `CC_P2P_ENABLED` is set to `true`.</td><td>`1`</td><td>`3`</td></tr><tr><td>`CC_ALLOWED_ORIGINS`</td><td>Specifies the allowed CORS origins for secure cross-origin access.</td><td>`*`</td><td>`https://clipcascade.example.com`</td></tr><tr><td>`CC_P2P_ENABLED`</td><td>Enables or disables peer-to-peer mode. When enabled, `CC_MAX_MESSAGE_SIZE_IN_MiB` is ignored.</td><td>`false`</td><td>`true`</td></tr><tr><td>`CC_SIGNUP_ENABLED`</td><td>Allows or restricts user self-registration.</td><td>`false`</td><td>`false`</td></tr><tr><td>`CC_PORT`</td><td>Specifies the port on which the server listens for incoming connections.</td><td>`8080`</td><td>`1234`</td></tr></tbody></table>

Inhalt:

WICHTIG: CC\_ALLOWED\_ORIGINS ist auch die Public URL für Caddy also Pflicht

```
CC_MAX_MESSAGE_SIZE_IN_MiB=100
CC_ALLOWED_ORIGINS=https://clipcascade.example.com  # Defines allowed CORS origins for security
CC_SIGNUP_ENABLED=false  # Enables or disables user self-registration
CC_P2P_ENABLED=false
```

Nun die Composer Datei

```
nano /root/clipcascade/docker-compose.yml
```

Inhalt

```
services:
  clipcascade:
    image: sathvikrao/clipcascade:latest
    #ports:
    #  - "8080:8080"  # Expose the ClipCascade server on port 8080
    restart: always  # Automatically restart the container if it stops
    volumes:
      - ./cc_users:/database  # Persistent storage for user data
    environment:
      - CC_MAX_MESSAGE_SIZE_IN_MiB=${CC_MAX_MESSAGE_SIZE_IN_MiB}   # Maximum message size in MiB (ignored if P2P mode is enabled)
      - CC_P2P_ENABLED=${CC_P2P_ENABLED}  # Enables or disables peer-to-peer(P2P) mode
      - CC_ALLOWED_ORIGINS=${CC_ALLOWED_ORIGINS}  # Defines allowed CORS origins for security
      - CC_SIGNUP_ENABLED=${CC_SIGNUP_ENABLED}  # Enables or disables user self-registration

  caddy:
    image: caddy:latest
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "8080:80"
    command: caddy reverse-proxy --from ${CC_ALLOWED_ORIGINS} --to clipcascade:8080
    volumes:
      - ./data/caddy/data:/data
      - ./data/caddy/config:/config
```

Nun den container starten

```
cd /root/clipcascade/
docker-compose up -d
```

### Konfiguration:

#### Kennwort ändern:

- **Default Credentials:**
    - **Username:** `admin`
    - **Password:** `admin123`

[![image.png](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/scaled-1680-/MkGdLuSy7gSE5yGF-image.png)](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/MkGdLuSy7gSE5yGF-image.png)

Nun das Kennwort ändern im Menü oben change Password

[![image.png](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/scaled-1680-/BgxzWBZIgjvNpyks-image.png)](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/BgxzWBZIgjvNpyks-image.png)

#### Benutzer anlegen:

Dazu auf Add user klicken

[![image.png](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/scaled-1680-/MPaCZmPey3jispTQ-image.png)](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/MPaCZmPey3jispTQ-image.png)

Daten eingeben und auf submit klicken

[![image.png](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/scaled-1680-/3vAE6kVEuV6hrNZY-image.png)](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/3vAE6kVEuV6hrNZY-image.png)

Nun erscheint der Benutzer in der Liste

[![image.png](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/scaled-1680-/q5Io7bfcaVtgKmFh-image.png)](https://wiki.hacker-net.de/uploads/images/gallery/2025-07/q5Io7bfcaVtgKmFh-image.png)

### Nun noch die ufw Firewall regeln anpassen.

Da hier der Docker container sowieso von außen erreichbar sein soll, brauchen wir hier keine Anspassung für docker.  
Aber ssh soll nur auf der lokalen Netzwerkkarte zur Verfügung stehen

ufw installieren

```
apt install ufw
```

Nun die Regeln setzten, darauf achten das enp6s18 die interne Karte ist ansonsten anpassen

```
ufw allow in on enp6s18 to any port 22
ufw enable
```