A fully-featured Ubuntu 24.04 desktop environment running in a Docker container with remote access capabilities via SSH, NoMachine, and VS Code Server.
- Ubuntu 24.04 Desktop: Full GNOME desktop environment
- Remote Access:
- SSH server on port 2222
- NoMachine remote desktop on port 4003
- VS Code Server (web-based) on port 8585
- Development Tools:
- Build essentials (gcc, make, etc.)
- Git, Vim, Nano, tmux
- Python 3 with pip and pipx
- Node.js (LTS) via NVM
- Poetry (Python package manager)
- Claude Code CLI
- Docker-in-Docker support
- Browsers: Google Chrome and Firefox pre-installed
- VS Code: Desktop version installed with optional web-based server
- Persistent Storage: Home directory persists between container restarts
-
Clone this repository:
git clone <repository-url> cd docker
-
Set up environment variables:
cp .env.example .env
-
Generate a secure password hash:
./generate-password-hash.sh
Copy the generated hash to your
.env
file. -
Build and run the container:
docker-compose up -d
Variable | Default | Description |
---|---|---|
USERNAME |
default-user | Container user name |
USER_UID |
1000 | User ID (match your host user for file permissions) |
USER_GID |
1000 | Group ID |
USER_PASSWORD_HASH |
- | Hashed password for the user (required) |
USER_PASSWORD |
- | Plain text password (less secure alternative) |
Variable | Default | Description |
---|---|---|
VSCODE_PORT |
8585 | Port for VS Code Server |
VSCODE_HOST |
0.0.0.0 | Binding host |
VSCODE_TOKEN |
- | Access token for security |
VSCODE_SERVER_BASE_PATH |
- | URL base path (e.g., /vscode) |
ssh -p 2222 your-username@localhost
- Install NoMachine client on your host machine
- Connect to
localhost:4003
- Use your container credentials to log in
Navigate to http://localhost:8585
in your browser (if enabled).
dockerfile
: Container image definitiondocker-compose.yml
: Service configuration.env.example
: Example environment variablesgenerate-password-hash.sh
: Utility to create secure password hashesworkspace/
: Mounted directory for your projects
- dev-home: Persistent home directory storage
- ./workspace: Host directory mounted at
~/workspace
in container
- Password Security: Always use
USER_PASSWORD_HASH
instead of plain text passwords - Privileged Container: Runs with elevated privileges for systemd compatibility
- Port Exposure: Only expose necessary ports in production environments
The container includes Docker CLI and can optionally connect to the host's Docker daemon by uncommenting this line in docker-compose.yml
:
# - /var/run/docker.sock:/var/run/docker.sock
- Ensure all required ports are available
- Check Docker logs:
docker-compose logs
- Verify the password was set correctly in
.env
- Check if services are running:
docker exec ubuntu-dev systemctl status ssh nxserver
- Ensure
USER_UID
andUSER_GID
match your host user
The container logs all initialization steps to /var/log/container-init.log
. To view:
docker exec ubuntu-dev cat /var/log/container-init.log
- Docker Engine 20.10+
- Docker Compose 2.0+
- 8GB+ RAM recommended for desktop environment
- 20GB+ disk space
This project was fully developed using Claude Code - Anthropic's AI-powered coding assistant.
[Your License Here]