Encrypted packages (databases, PKI, client profiles) with safe restore and a pre-restore safety copy, usable for server-to-server migration across container and system-service installs. New Management page, ovp_backups volume, migrations code in the profiler image, server name in package names. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
5.6 KiB
Containers (variants A and B)
Install the whole suite with Docker: nothing but Docker is needed on the host. This page: choose a variant, check the requirements, install. Next pages: Operations (update, backup, rollback), Reference (.env, ports, volumes), Troubleshooting.
Quick start
On a host with Docker (root or a member of the docker group):
git clone <repository> && cd OpenVPN-Monitoring-Simple
deploy/docker/install.sh --variant b # or --variant a, see the table below
The script prints the URL and the administrator login and password (shown once). Open the URL, then follow First steps.
Variants
Two variants, both installed and updated by the scripts in deploy/docker/:
| Variant A: one container | Variant B: one container per component | |
|---|---|---|
| Compose file | docker-compose.allinone.yml |
docker-compose.yml |
| Containers | ovp-allinone (nginx, gunicorn, gatherer, uvicorn, OpenVPN under supervisord) |
ovp-ui, ovp-api, ovp-gatherer, ovp-profiler |
| Image build | deploy/allinone/Dockerfile (build context: repository root) |
one Dockerfile per component (APP_UI, APP_CORE, APP_PROFILER) |
| Choose it when | one host, simplest operation, one thing to start/stop/back up | you want to restart, scale or inspect components separately, or follow the usual one-process-per-container practice |
| Trade-off | a failing process is restarted by supervisord, the container stays up; one image to rebuild for any change |
more moving parts, internal network ovp-net |
Both variants use the same five named volumes with the same in-container paths, the same environment variables and the same published ports. Backups look identical.
Only one variant can run per host. Both publish the same host ports (
80/tcp,1194/udpby default) and use fixed container names (ovp-*). The scripts refuse to start a variant while a container of the other one is running.
Requirements
- Docker Engine with the compose plugin (
docker compose, v2, preferred) ordocker-compose. Variant B needs docker compose 2.17 or newer (the profiler image is built withadditional_contexts; the olddocker-composev1 does not support it). Variant A is not affected. - The Docker daemon running and usable by the user that runs the scripts (root, or a member of the
dockergroup). - Access to
/dev/net/tunon the host and theNET_ADMINcapability (already set in the compose files). - Free disk space: about 2 GB for images and builds, plus room for backups (the scripts check both).
- Internet access for the first build (base images, npm, pip) and for the backup helper image (
alpine:3). For offline hosts see Troubleshooting. opensslis optional (random secret otherwise comes from/dev/urandom).
Install
Clone the repository, change into it and run the script (as root or a docker user):
# Variant B: one container per component
deploy/docker/install.sh --variant b
# Variant A: everything in one container
deploy/docker/install.sh --variant a
# Options
deploy/docker/install.sh --variant b --project ovpmon --http-port 8080 --vpn-port 1194 --admin-user admin
| Option | Meaning |
|---|---|
--variant a|b |
required |
--project NAME |
compose project name = prefix of the volume names (default ovpmon: volumes ovpmon_db_data, ...) |
--http-port N |
host port of the UI (written to .env as OVPMON_HTTP_PORT, default 80) |
--vpn-port N |
host UDP port of OpenVPN (OVPMON_VPN_PORT, default 1194) |
--admin-user NAME |
login of the first administrator (default admin) |
What install.sh does:
- Preflight: docker and compose, running daemon, the other variant is not running, no foreign container with the same names, ports free, free disk space.
.envnext to the compose files, only if it does not exist: mode 600, randomJWT_SECRET, initial administrator with a generated 24-character password. An existing.envis never overwritten (--http-port/--vpn-portonly set their own keys in it).- Build, start (
docker compose up -d), write the state file.ovpmon-deploy(variant and project; used byupdate.sh,backup.sh,restore.sh), wait up to 3 minutes for the health checks. - Initial administrator: when the users table is not empty,
OVPMON_INITIAL_ADMIN_*are removed from.envand the container that reads them is recreated (variant B:app-api, variant A:ovpmon). If the table cannot be read or is empty, the lines stay in.envand a warning says so. - Result: URL, ports, and the administrator login and password. The password is shown once and stored nowhere else.
JWT_SECRETis never printed.
Running it again is safe: it rebuilds and starts, keeps .env, and makes no new administrator.
Then follow First steps (sign in, initialize the PKI, start the VPN server). Put TLS in front of the UI (see Security).
Without the script
cat > .env <<EOT
JWT_SECRET=$(openssl rand -hex 32)
OVPMON_INITIAL_ADMIN_USER=admin
OVPMON_INITIAL_ADMIN_PASSWORD=<strong password>
EOT
chmod 600 .env
docker compose up -d --build # variant B
docker compose -f docker-compose.allinone.yml up -d --build # variant A
After the first start remove the two OVPMON_INITIAL_ADMIN_* lines from .env and recreate app-api (B) or ovpmon (A).
Next
First steps · Operations · Reference · Troubleshooting · Choose another method