MKS DevEnv

Configuration

Environment variables and configuration options for DevEnv Pro

Configuration

Complete guide to configuring DevEnv Pro for your needs.

Environment Variables

Required Variables

Create docker/.env from .env.example:

cd docker
cp .env.example .env

Passwords

VariableDefaultDescription
CODE_SERVER_PASSWORDdevenvCode-Server authentication
RDP_PASSWORDdevenvRDP/xrdp authentication
VNC_PASSWORDdevenvVNC authentication (legacy)

Guacamole Database

VariableDefaultDescription
GUACAMOLE_DB_NAMEguacamole_dbPostgreSQL database name
GUACAMOLE_DB_USERguacamole_userDatabase user
GUACAMOLE_DB_PASSWORDguacamole_passDatabase password

SSH Access

VariableExampleDescription
SSH_PUBLIC_KEYssh-rsa AAAA...Public key for passwordless SSH

Generate your key:

cat ~/.ssh/id_rsa.pub

GitHub Integration

VariableExampleDescription
GITHUB_TOKENghp_xxxxxxxxxxxxGitHub personal access token

Create at: https://github.com/settings/tokens

Required scopes: repo, read:org, workflow

Display Settings

VariableDefaultDescription
VNC_RESOLUTION1920x1080Display resolution
VNC_DEPTH`24Color depth (16 or 24)

Timezone

VariableDefaultDescription
TZEurope/MadridContainer timezone

Find your timezone at: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Port Mapping

Host PortContainerServiceNotes
222222SSHChanged from 22 to avoid conflict
33893389RDPStandard RDP port
80818080GuacamoleChanged from 8080 for Coolify
84438443Code-ServerStandard HTTPs alternative

If you have services running on these ports, update the port mappings in docker-compose.yaml.

Volumes

Persistent Data Volumes

VolumePurposeLocation
mks-devenv-workspaceWorkspace files/workspace
mks-devenv-configApp configs/root/.config
mks-devenv-vscodeVS Code settings/root/.vscode
mks-devenv-vscode-dataCode-Server data/root/.local/share/code-server
mks-devenv-claudeClaude Code config/root/.claude
mks-devenv-ssh-keysSSH keys/root/.ssh
mks-guacamole-dbGuacamole database/var/lib/postgresql/data

Backup and Restore

Backup volumes:

# List volumes
docker volume ls

# Backup a volume
docker run --rm -v mks-devenv-workspace:/data -v $(pwd)/backup:/backup alpine tar czf /backup/backup.tar.gz /data

# Restore a volume
docker run --rm -v mks-devenv-workspace:/data -v $(pwd)/backup:/backup alpine tar xzf /backup/backup.tar.gz

Custom Configuration

Extending devenv-full

To add custom software to devenv-full:

  1. Edit docker/devenv-full/Dockerfile
  2. Add packages in the appropriate RUN section
  3. Rebuild:
    docker compose up -d --build devenv

Adding Extensions to VS Code

VS Code extensions are installed during build. To add more:

Edit docker/devenv-full/Dockerfile:

RUN code-server --install-extension <extension-id>

Custom Dotfiles

The container includes custom dotfiles from docker/base/dotfiles/:

  • Tmux: Custom configuration with utilities (tx, txout, cx)
  • Oh My Posh: Custom theme (mks-local.omp.json)
  • Alacritty: Modern terminal configuration
  • Claude Model: Model switcher script

Security

Password Management

Always change default passwords before deploying to production!

  1. Change .env passwords before first startup
  2. Change Guacamole admin after first login
  3. Use SSH keys instead of passwords for SSH
  4. Rotate secrets regularly

SSH Key Setup

Generate SSH key if you don't have one:

ssh-keygen -t ed25519 -C "your@email.com"

Add to .env:

SSH_PUBLIC_KEY="ssh-ed25519 AAAA... your@email.com"

Firewall Rules

On your VPS, ensure these ports are open:

# UFW example
ufw allow 22/tcp    # SSH
ufw allow 3389/tcp  # RDP
ufw allow 8081/tcp  # Guacamole
ufw allow 8443/tcp  # Code-Server

Coolify Integration

Traefik Labels

The stack includes Traefik labels for automatic HTTPS routing:

devenv services:

  • Desktop: lab1-helsinki.desktop.mks2508.systems
  • Code-Server: lab1-helsinki.code.mks2508.systems
  • SSH: lab1-helsinki.ssh.mks2508.systems (TCP)

Guacamole:

  • Web UI: lab1-helsinki.guacamole.mks2508.systems

Resource Limits

Code-Server has resource limits (configured in code-server compose):

  • CPUs: 2
  • Memory: 4GB

Adjust if needed in docker/code-server/docker-compose.yaml.

Actions

On this page