EnvMap GitHub

A privileged access manager on one machine, with Docker Compose

You do not need Kubernetes, a licence or a sales call to give a small team recorded, password-free access to its servers. This is the whole path on one machine with Docker Compose, from an empty host to a replayed session, with the backup and upgrade steps people usually skip.

EnvMap is an open-source, self-hosted control plane with a privileged access manager (PAM) in it. People open SSH, RDP and VNC sessions from the browser and never see the password or key, and every session is recorded. One setting turns an installation into the PAM and nothing else, which is what this guide does.

Every command below was run on a test machine while this post was written, including the backup.

What you need#

1. Get the Compose file and choose a key#

bash
mkdir envmap && cd envmap
curl -fsSLO \
  https://raw.githubusercontent.com/ammar-hassoun/envmap/main/deploy/compose/compose.yaml

Create a .env file beside it. ENVMAP_MODE=pam makes the installation the PAM and nothing else. ENVMAP_SECRET_KEY is the key that seals every stored credential and chains the audit log:

bash
printf 'ENVMAP_MODE=pam\nENVMAP_SECRET_KEY=%s\n' "$(openssl rand -hex 32)" > .env
chmod 600 .env

Set the key before the first start. Without one, EnvMap makes a key file on its own data volume, which works, but then a copy of the volume holds both the locked box and its key. With the key in .env, the volume holds no key at all. Keep a copy of .env somewhere safe, apart from your backups.

2. Start it#

bash
docker compose up -d
docker compose ps

Two containers start:

ServiceWhat it does
envmapThe portal. Its port is published on 127.0.0.1:8471 only, so nothing on your network can reach it yet.
guacdApache Guacamole's gateway, which draws RDP and VNC sessions in the browser and writes their recordings. It shares the portal's network and volume and is not published anywhere.

Both run as an unprivileged user on a read-only filesystem with every Linux capability dropped. Everything they keep is in one volume, envmap_data.

3. Sign in for the first time#

Open http://localhost:8471 on the machine, or through an SSH tunnel (ssh -L 8471:127.0.0.1:8471 you@the-host). A new installation has no accounts and no default password: every page goes to Create the first administrator.

  1. Enter your email, your name and a password: at least 10 characters, with upper and lower case letters and a digit.
  2. Scan the QR code with your authenticator app and type the six digits.

You land on Privileged Access. On a PAM-only installation there is no Overview, no clusters and no other menus, only the PAM, its settings, users, roles and the audit log.

4. Allow sessions#

In Settings → Privileged Access, the PAM is already on. Live sessions are a separate switch, so you can build the catalogue before anyone can connect. Tick permit opening a live session on a target and save.

Settings, Privileged Access: the feature switch, live connections and record sessions, all ticked
The top of the page: the feature switch and the two live-session switches.

5. Add your first target#

On the Privileged Access page choose + New target:

Tick production if the host's name should be typed before every session. Save.

Want to store no key at all? Choose EnvMap certificate instead. EnvMap then signs a new key for each session, valid for five minutes, and the host trusts EnvMap's authority with one line of sshd configuration. See SSH without stored keys.

The New target form with name, protocol, address and port, host name, label, username and credential fields
New target. The credential is sealed when you save.

6. Open a session, then replay it#

Choose connect on the row. For a production target EnvMap first asks for the host's name, a ticket link, how long you need and a short summary, and keeps all four with the recording.

The terminal opens in the browser. Type a few commands, then close the tab. Open the Recordings tab: the session is there, with who, where and how long. Replay it at any speed, or open its list of commands. A password typed at a prompt with no echo is never in the recording, because only what the host sends back is recorded.

RDP and VNC work the same way: choose RDP or VNC as the protocol. The gateway is already running.

The replay of an SSH session on web-lb-01, marked recording verified, with its summary, session time and ticket above the player
The session you just opened, in the Recordings tab, ready to replay.

7. Let other people in: TLS in front#

The port stays on 127.0.0.1 on purpose. To let your team use it, run a reverse proxy with a certificate on the same machine. With Caddy, which gets the certificate and passes the WebSocket connections that terminals use, the whole configuration is:

text
envmap.example.com {
    reverse_proxy 127.0.0.1:8471
}

Then tell EnvMap that people arrive over HTTPS, so its cookies are marked secure:

bash
echo 'ENVMAP_COOKIE_SECURE=1' >> .env
docker compose up -d

Never publish the port on 0.0.0.0 without TLS in front. It holds the credentials to your servers.

8. Back up what matters#

Three things, kept apart:

  1. The key: your .env file.
  2. The database: a consistent copy, taken while EnvMap runs. The image has no sqlite3 command, so its own Python does it. The copy is written to the data volume because docker compose cp cannot read the container's in-memory /tmp:

    bash
    docker compose exec envmap /venv/bin/python -c \
      "import sqlite3; d = sqlite3.connect('/data/portal-backup.db'); sqlite3.connect('/data/portal.db').backup(d); d.close()"
    docker compose cp envmap:/data/portal-backup.db ./portal-backup.db
    docker compose exec envmap rm /data/portal-backup.db
  3. The recordings, in pam-sessions/ on the volume. They are evidence, so keep them as long as your policy asks.

The simplest complete backup is a copy of the whole envmap_data volume, taken after docker compose stop.

9. Upgrade#

bash
docker compose pull
docker compose up -d

Before a new version touches the database, EnvMap copies it to /data/backups/, and keeps the newest five. To stay on one release instead of the newest, add ENVMAP_VERSION= and a release number to .env.

What a one-machine install cannot do#

Everything else is the same product: access requests approved by a second person, SSH certificates, runbooks beside the terminal, live watch and take-over, and the hash-chained audit log.

Try it first without installing#

The demo is the real screens with pretend data. More about the PAM: the PAM page, how it compares with JumpServer, Teleport, Warpgate and Guacamole, and how a session recording is built. The full installation reference, every Compose variable included, is in the docs.

EnvMap home · Docs · GitHub