Repository navigation
getting started
| Requirement | Minimum Version | Why |
|---|---|---|
| Bash | 4.4+ | Required for empty-array expansion under set -u
|
| Docker Engine | Any modern version | Daemon must be running and accessible by your user |
| Docker Compose | v2 plugin (docker compose) or standalone (docker-compose) |
DAM auto-detects which is available |
| Linux | Primary target | Tested on common distributions; other Unix-like systems may work |
| curl | Any | Required only for self-update
|
| column | Any (part of util-linux) |
Required by DAM's operational commands for table formatting |
DAM explicitly checks these at startup:
-
Bash version: exits immediately with
"bash 4.4+ required"if the version check fails. -
Docker binary: checks
command -v docker- exits with"'docker' command not found". -
Docker daemon: checks
docker info- exits with"Docker daemon is not running or you lack permission". -
Docker Compose: checks both
docker compose versionanddocker-compose version- exits if neither is available.
bash --version # Must be 4.4+
docker --version # Docker must be installed
docker info # Daemon must be running
docker compose version # v2 plugin (preferred)
# or: docker-compose --version # v1 standalone (fallback)Download and run the interactive installer:
sudo curl -fsSL https://gh.upputuri.in/dam.sh -o /tmp/dam.sh && sudo chmod +x /tmp/dam.sh && sudo /tmp/dam.sh install && rm /tmp/dam.shThe installer will:
-
Ask for search directories - where your Docker Compose app folders live (defaults:
/opt/stacks,/opt/projects,~/apps,~/stacks) -
Ask for excluded folder names - directory names to always ignore (defaults:
recovered,recovered-configs,unused,backups) -
Ask for a command name - how you'll invoke DAM globally:
- Enter a name like
dkr(default) ordam→ commands becomedkr start …,dam update …, etc. - Enter
none→ installs raw commands:start,stop,kill,update, … directly (the installer checks for system conflicts first)
- Enter a name like
-
Ask about custom update scripts - whether
update*.shscripts should be allowed to run automatically without prompting. If "No", DAM will interactively ask you for permission each time it finds one. - Optionally set a self-update SHA-256 hash. Note: It is only there for highly strict security environments where administrators want to manually approve and verify every single update before allowing the script to pull it. For normal use, leaving it blank is the best approach.
After completion:
- The temporary quick-install script is copied to
/usr/local/bin/docker-app-manager, so deleting/tmp/dam.shis safe - Command symlinks are created based on your choice
- Configuration is saved to
/etc/docker-app-manager.conf
git clone https://gh.upputuri.in/dam.git
cd dam
sudo ./dam.sh installThis is identical to Method 1 but starts from a local clone. The installer symlinks the cloned script to /usr/local/bin/docker-app-manager, so edits to the cloned file are reflected globally.
chmod +x dam.sh
./dam.sh start <app-name>
./dam.sh update all except <app3>
./dam.sh cleanupWhen not installed (no /etc/docker-app-manager.conf exists), DAM uses these fallback defaults:
-
Search directories:
/opt/stacks,/opt/projects,~/apps,~/stacks(only directories that actually exist) -
Excluded directories:
recovered,recovered-configs,unused,backups -
Search depth:
3(controlled byMAX_SEARCH_DEPTHin config)
Folder exclusions are case-sensitive and match directory basenames exactly.
# If you chose a custom command name (e.g. dkr):
dkr --help
dkr list
# If you chose "none" (raw commands):
start --help
listYou should see the DAM usage summary and a list of discovered applications.
DAM expects one Docker Compose project per directory. Each directory must contain at least one of:
compose.yamlcompose.ymldocker-compose.yamldocker-compose.yml
Or, for update operations, an update*.sh script.
Example layout:
/opt/stacks/
├── <app3>/
│ └── compose.yaml
├── <app-name>/
│ └── docker-compose.yml
├── <app-name>/ # Actual app name is <app-name> but renamed the dir to <app-name> for easy remembering
│ └── docker-compose.yml
├── <app2>/
│ ├── compose.yaml
│ └── update-<app2>.sh
└── recovered/ ← ignored by default (in EXCLUDE_DIRS)
└── old-app/
The directory basename becomes the app name used in DAM commands. In this example: <app3>, <app-name>, <app2>, <app-name>.
| File/Path | Purpose |
|---|---|
/usr/local/bin/docker-app-manager |
Copy of a /tmp or /var/tmp source; otherwise a symlink to your dam.sh script |
/usr/local/bin/<cmd> |
Symlink(s) to docker-app-manager (your chosen command name or raw action names) |
/etc/docker-app-manager.conf |
Bash-sourceable configuration file |
- Usage Guide - learn all available commands
- Configuration - customize search paths, excludes, and behavior
- Application Discovery - how DAM finds your apps
This document covers every configuration variable, option, and setting in DAM.
/etc/docker-app-manager.conf
This file is created by the install or config commands. It is a Bash-sourceable file - the script loads it directly via source "$CONFIG_FILE".
# Auto-generated by Docker Apps Lifecycle Manager
SEARCH_DIRS=("/opt/stacks" "/home/user/apps")
EXCLUDE_DIRS=("recovered" "recovered-configs" "unused" "backups")
CUSTOM_CMD_NAME="dkr"
ALLOW_CUSTOM_UPDATE_SCRIPTS="false"
UPDATE_SHA256="abc123..."
UPDATE_URL="https://gh.upputuri.in/dam.sh"
MAX_SEARCH_DEPTH="3"- If
/etc/docker-app-manager.confexists → its values are used - If the config file does not exist → fallback defaults are used (see each variable below)
- After loading (or falling back),
declare -pchecks ensureSEARCH_DIRSandEXCLUDE_DIRSare set to empty arrays if they were not defined
| Property | Value |
|---|---|
| Purpose | Directories to search for Docker Compose app folders |
| Type | Bash array of absolute paths |
| Default |
/opt/stacks, /opt/projects, $HOME/apps, $HOME/stacks - but only directories that actually exist are included |
| Set by |
install / config interactive wizard |
| Can be overridden | Yes, by editing the config file directly |
| Behavior when empty | No apps are discovered; all commands that require app selection will fail |
| Behavior with invalid paths | Non-existent directories are silently skipped during search (only valid directories are used) |
Example:
SEARCH_DIRS=("/opt/stacks" "/opt/projects" "/home/ruth/apps")Notes:
- Paths must not contain spaces (the installer validates this during setup)
- During
sudoexecution without a config file, DAM resolves the real user's home viagetent passwd "$SUDO_USER"instead of using root's$HOME - The search uses
find -mindepth 1 -maxdepth "${MAX_SEARCH_DEPTH}"- apps up to 3 levels deep (by default) are discovered. This depth is configurable viaMAX_SEARCH_DEPTH.
| Property | Value |
|---|---|
| Purpose | Directory names (not full paths) to exclude from app discovery |
| Type | Bash array of directory basenames |
| Default |
("recovered" "recovered-configs" "unused" "backups") (when no config file exists) |
| Set by |
install / config interactive wizard |
| Can be overridden | Yes, by editing the config file directly |
| Behavior when empty | No directories are excluded |
| Clearing | During setup, enter none to clear all exclusions |
Example:
EXCLUDE_DIRS=("recovered" "recovered-configs" "unused" "templates" "archive")Notes:
- Exclusion is by basename only and is case-sensitive - a directory matching the exact casing of
recoveredat any depth under any search root will be excluded - Excluded apps appear in
listoutput with an "excluded" status marker - Excluded apps are skipped during
alloperations with a[SKIP]message - The
findcommand uses-name "$excl" -prunewhich prevents descending into excluded directories at all
| Property | Value |
|---|---|
| Purpose | The command name used to invoke DAM globally |
| Type | String |
| Default |
"dkr" (offered during install; defaults to empty string - "" - if none is chosen, which enables raw multicall mode) |
| Set by |
install / config interactive wizard |
| Can be overridden | Yes, by editing the config file and running install refresh
|
Modes:
| Value | Resulting Commands | Symlinks Created |
|---|---|---|
"dkr" (or any name) |
dkr start ..., dkr update ...
|
/usr/local/bin/dkr → /usr/local/bin/docker-app-manager
|
"" (empty / none) |
start ..., stop ..., kill ..., update ...
|
One symlink per action in /usr/local/bin/
|
Conflict detection:
- During install, if raw mode is selected, the installer checks every supported action name against
command -vto detect conflicts with existing system commands - If a conflict is found, the user is forced to choose a custom name
- If no conflicts are found, a warning is displayed and confirmation is required
Internal behavior:
- The
CUSTOM_CMD_NAMEvalue also sets theCMD_PREFIXvariable, which affects usage/help output formatting
| Property | Value |
|---|---|
| Purpose | Whether update*.sh scripts run automatically during update
|
| Type | String ("true" or "false") |
| Default | "false" |
| Set by |
install / config interactive wizard |
| Accepted values |
true, TRUE, yes, YES, y, Y → treated as true; anything else → false
|
Behavior by value:
| Value | What Happens When update*.sh Exists |
|---|---|
true |
Custom script runs immediately without prompting |
false (default) |
DAM prompts the user: "Do you want to run this custom update script? [y/N]" |
false + non-interactive |
Warning logged, custom script skipped, falls back to compose update |
| Property | Value |
|---|---|
| Purpose | URL used by self-update to download the latest version |
| Type | String (HTTPS URL) |
| Default |
"https://gh.upputuri.in/dam.sh" (hard-coded in the script header) |
| Set by | Hard-coded in the script (can be manually added to config) |
| Validation | Must start with https:// (checked during self-update) |
Notes:
- The official default URL is hard-coded in the script.
- The
install/configwizards do not prompt for this, to ensure the official URL is used. - If you must use a custom URL, you can manually add
UPDATE_URL="..."to the config file to override the hard-coded value. - If empty during
self-update, an error is displayed
| Property | Value |
|---|---|
| Purpose | Optional SHA-256 checksum for verifying self-update downloads. Note: It is only there for highly strict security environments where administrators want to manually approve and verify every single update before allowing the script to pull it. For normal use, leaving it blank is the best approach. |
| Type | String (64-character hex hash) |
| Default | Empty (no verification) |
| Set by |
install / config wizard (optional) |
| Behavior when set | After downloading the updated script, its sha256sum is compared against this value. If they don't match, the update is aborted. |
| Behavior when empty | No checksum verification is performed |
| Property | Value |
|---|---|
| Purpose | Maximum directory depth when searching for apps in SEARCH_DIRS
|
| Type | Integer |
| Default | 3 |
| Set by | Manually added to config (not prompted during installation) |
| Validation | DAM does not validate this value before passing it to find; use a non-negative integer |
Notes:
- By default, DAM searches up to 3 directories deep from your defined
SEARCH_DIRS. - If you have deeply nested apps, you can increase this limit by manually adding
MAX_SEARCH_DEPTH="10"to your configuration file. - Decreasing it can speed up discovery if you have a massive directory tree.
- An invalid value causes the
findsearch to fail; app discovery may then return no results.
These variables are not directly user-configurable but are derived from the configuration:
| Variable | Derived From | Purpose |
|---|---|---|
CMD_PREFIX |
CUSTOM_CMD_NAME |
The command name prefix (empty string if raw mode) |
P_CMD |
CMD_PREFIX |
Formatted prefix for help output (e.g., "dkr " with trailing space) |
CONFIG_FILE |
Hard-coded | Always /etc/docker-app-manager.conf
|
FIND_PRUNE_ARGS |
EXCLUDE_DIRS |
find arguments for pruning excluded directories |
ASSUME_YES |
-y / --yes CLI flag |
Skips confirmation prompts when true
|
CLEANUP_MODES |
with keyword in CLI |
Array of cleanup targets (vol, net, buildx, img, all) |
LOG_ARGS_RAW |
CLI arguments to logs
|
Array of log keyword arguments |
GET_RESOURCE_RAW |
CLI argument to get
|
The resource type to retrieve |
APP_DIR_CACHE |
Runtime cache | Associative array caching app directory lookups |
You can edit /etc/docker-app-manager.conf directly. After editing:
sudo <cmd> install refreshThis re-reads the config and refreshes all symlinks without running the interactive wizard.
Caution: Since the config file is sourced as Bash, syntax errors will cause the script to fail. Use proper Bash array syntax:
# Correct:
SEARCH_DIRS=("/opt/stacks" "/home/user/apps")
# Incorrect (will break):
SEARCH_DIRS="/opt/stacks, /home/user/apps"DAM does not read environment variables for configuration (other than standard ones like HOME, SUDO_USER, EUID). All configuration is via the config file or command-line flags.
The one exception is that ALLOW_CUSTOM_UPDATE_SCRIPTS, UPDATE_SHA256, and UPDATE_URL can technically be set as environment variables, but in practice they are always read from the config file.