A curated collection of Bash scripts for managing and maintaining Linux home servers.
dcu is a powerful and user-friendly Bash script designed to simplify the management of Docker Compose services. It provides a comprehensive set of features for starting, stopping, monitoring, and updating services, all with a focus on efficiency and ease of use.
- Start or stop all Docker Compose services with a single command
- Manage individual services with targeted commands
- Display detailed status of running containers and services
- Check for available updates for services, with interactive selection for applying updates
- Apply updates to all services or specific services
- Parallel processing for faster operations
- Enhanced logging with color-coded output
-
Clone this repository:
git clone https://github.com/meminens/homelab-toolkit.git cd homelab-toolkit -
Make the script executable:
chmod +x docker/dcu
-
Add the script to your PATH:
export PATH="$PATH:$HOME/homelab-toolkit/docker"
To make this change permanent, add the above line to your shell configuration file (e.g.,
~/.bashrcor~/.zshrc).
Run dcu with one of the following commands:
dcu start # Start all Docker Compose services
dcu stop # Stop all Docker Compose services
dcu status # Display status of all services
dcu st <service> # Start a specific service
dcu sp <service> # Stop a specific service
dcu rs <service> # Restart a specific service
dcu update # Check for updates and interactively apply them- Base Directory: By default,
dculooks for Docker Compose projects in$HOME/Docker/Hub. You can override this by setting theDCU_BASE_DIRenvironment variable. - Parallel Jobs: The maximum number of parallel jobs for processing services is set to 16 by default. This can be adjusted by modifying the
MAX_PARALLEL_JOBSvariable in the script.
-
Start all services:
dcu start
-
Check for updates and selectively apply them to desired services:
dcu update
-
Stop a specific service:
dcu sp Immich
-
Use a custom base directory:
DCU_BASE_DIR=/custom/path dcu status
- Ensure that
jqandregctlare installed for update checking functionality. You can install them using your package manager (e.g.,sudo apt install jqorsudo pacman -S regctl). - The script supports multiple Docker Compose file naming conventions, including
docker-compose.yml,docker-compose.yaml,compose.yml, andcompose.yaml.
For more information, run:
dcu help