Skip to content

william1nguyen/uvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Docker Ubuntu Manager

Docker Ubuntu OpenVPN License: MIT Status

Fast setup for an Ubuntu server with Docker, including SSH access, persistent data, OpenVPN configuration, and optional GUI mode.


Demo

πŸ”‘ noVNC Login

noVNC Login

πŸ–₯️ XFCE Desktop

XFCE Desktop

🌐 Chrome Browser

Chrome Browser

πŸ’» XFCE Terminal

XFCE Terminal

πŸ”’ SSH Access

SSH Access

Quick Start (TL;DR)

Copy-paste these 3 lines to bring up the lab instantly:

git clone https://github.com/william1nguyen/uvm.git
cd uvm
make start --gui

Now open http://localhost:6080/vnc.html and you’re in πŸš€

Table of Contents

  1. Features
  2. Prerequisites
  3. Docker Compose Workflow
  4. Make Help
  5. SSH Access
  6. GUI Mode (--gui)
  7. OpenVPN Management
  8. Apply VPN Config to a Container
  9. Verifying VPN Connection
  10. Apply Push Routes on OpenVPN Server
  11. Notes
  12. TODO

Features

  • Quick setup of Ubuntu server containers
  • Persistent data storage
  • Integrated OpenVPN server with client management
  • Private and external network configuration for lab isolation
  • Optional GUI desktop with Chrome browser via VNC/noVNC

Prerequisites

Ensure your Docker environment is ready:

  • Docker and Docker Compose installed
  • Basic understanding of container networking

⚠️ Note: Orbstack does not support isolated networks, which is not suitable for this lab setup. It is recommended to use standard Docker: Orbstack issue #1944


Docker Compose Workflow

The Makefile provides the following targets:

Start Lab

# Normal mode
make start

# VPN mode (vpn)
make start mode=vpn

# GUI mode (--gui)
make start --gui

This will start all containers defined in:

  • Normal: deployments/ubuntu/server/docker-compose.yml
  • VPN: deployments/vpn/docker-compose.yml
  • GUI: deployments/ubuntu/gui/docker-compose.yml

Make Help

You can list all available commands with:

make help

Lazy Ubuntu - Available commands

apply-push-routes     Apply push routes to OpenVPN server
apply-vpn-config      Apply VPN config to a container (SERVER=<name>)
listconfigs           List OpenVPN profiles on server
reset                 Reset lab (remove containers, networks, volumes, images)
start                 Start lab (normal / vpn / gui)
stop                  Stop current lab
verify-vpn-config     Verify VPN interface & routes inside container (SERVER=<name>)

Reset Lab

make reset

This cleans up:

  • Networks
  • Containers
  • Volumes
  • Images

List OpenVPN Profiles

make listconfigs

Equivalent to:

docker exec openvpn ./listconfigs.sh

SSH Access

After starting the lab, you can connect to any ssh-ubuntu container via SSH:

ssh root@localhost -p 2222
  • Username: root
  • Password: rootpassword

πŸ”‘ Ports may vary if you run multiple containers. Check the docker-compose mapping or logs.


GUI Mode (--gui)

To start an Ubuntu server with a lightweight desktop (XFCE) and Google Chrome:

make start --gui

This will:

Access Methods

Launching Chrome

Inside the VNC session:

  • Double-click Google Chrome (Optimized) icon on desktop, OR
  • Run:
/root/start-chrome.sh

OpenVPN Management

Apply VPN Config to a Container

make apply-vpn-config SERVER=<container_name>

Steps performed:

  1. Fetch PROFILE_ID from OpenVPN server:
docker exec openvpn ./listconfigs.sh
  1. Copy client configuration to host and target container:
docker cp openvpn:/opt/Dockovpn_data/clients/${PROFILE_ID}/client.ovpn ./data/client.ovpn
docker cp ./data/client.ovpn <container_name>:/client.ovpn
  1. Install OpenVPN and run client in container:
docker exec -d <container_name> bash -c "apt-get update && apt-get install -y openvpn && openvpn --config /client.ovpn --daemon"

Note: Ensure ./data directory exists on host.


Apply Push Routes on OpenVPN Server

make apply-push-routes

This will:

  1. Copy push-routes.conf from host into OpenVPN server:
docker cp ./config/push-routes.conf openvpn:/opt/Dockovpn/config/push-routes.conf
  1. Append routes to server configuration:
docker exec -d openvpn bash -c "cat /opt/Dockovpn/config/push-routes.conf >> /opt/Dockovpn/config/server.conf"

Verifying VPN Connection

make verify-vpn-config SERVER=<container_name>

This checks:

  • VPN interface creation:
ip addr show tun0
  • Routing table:
ip route show

Output is formatted for readability.


Notes

  • DATA_DIR is ./data and used for storing client configuration files.
  • CONFIG_DIR is ./config and contains push-routes.conf.
  • VPN_SERVER is default openvpn; adjust if container name differs.
  • Ensure proper network isolation when testing VPN routes.
  • Always verify network interfaces and firewall rules after configuration.

TODO

  • Assign a dedicated private IP for each ssh-ubuntu server instead of port mapping.
  • Add option to load a GUI interface for Ubuntu servers (e.g., lightweight desktop environment).
  • Isolate resources (CPU, memory, disk) for each Ubuntu server container to prevent interference.
  • Consider automating VPN configuration application after container creation.
  • Implement monitoring/logging for each Ubuntu server container.

About

Ubuntu server with Docker, SSH, persistent storage, and OpenVPN

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published