LogDeck supports managing Docker containers across multiple Docker hosts simultaneously. This feature enables monitoring and controlling containers on local, remote, and SSH-connected Docker daemons from a single interface.
- Go 1.21 or higher
- Network connectivity to target Docker hosts
- Appropriate authentication credentials for remote hosts
For SSH connections to remote Docker hosts:
- SSH client installed on the server
- SSH key-based authentication configured
- Valid SSH private key with appropriate permissions (0600)
- Docker daemon running on remote host
- User account with Docker socket permissions on remote host
For TCP connections:
- Docker daemon configured to listen on TCP port (typically 2375 or 2376)
- Network access to the Docker daemon port
- TLS certificates (recommended for production)
Configure Docker hosts using the DOCKER_HOSTS environment variable. The format is:
DOCKER_HOSTS=name1=host1,name2=host2,name3=host3
Each host entry consists of:
- name: A friendly identifier for the host (alphanumeric, no spaces)
- host: The Docker daemon connection URL
The = delimiter separates the name from the host URL, while , separates multiple host entries.
DOCKER_HOSTS=local=unix:///var/run/docker.sockUsed for connecting to the local Docker daemon via Unix socket.
DOCKER_HOSTS=remote=ssh://user@hostname
DOCKER_HOSTS=remote=ssh://user@192.168.1.100Used for secure connections to remote Docker daemons over SSH. Requires SSH key authentication.
DOCKER_HOSTS=remote=tcp://192.168.1.100:2375
DOCKER_HOSTS=secure=tcp://192.168.1.100:2376Used for direct TCP connections to Docker daemons. Port 2376 typically indicates TLS encryption.
DOCKER_HOSTS=local=unix:///var/run/docker.sockDefault configuration when DOCKER_HOSTS is not set.
DOCKER_HOSTS=local=unix:///var/run/docker.sock,production=ssh://deploy@prod.example.comDOCKER_HOSTS=prod=ssh://deploy@prod.example.com,staging=ssh://deploy@staging.example.com,dev=tcp://dev.example.com:2375DOCKER_HOSTS=local=unix:///var/run/docker.sock,prod-us=ssh://root@us-prod.example.com,prod-eu=ssh://root@eu-prod.example.com,staging=tcp://staging.example.com:2375- Generate SSH key pair if not already available:
ssh-keygen -t ed25519 -C "logdeck-docker-access"- Copy public key to remote host:
ssh-copy-id user@remote-host- Verify SSH access:
ssh user@remote-host docker psWhen running LogDeck via Docker Compose, mount the SSH directory:
services:
logdeck:
volumes:
- ~/.ssh:/root/.ssh:roThis provides the container access to your SSH keys for authentication.
For enhanced security, use SSH agent forwarding instead of mounting keys:
services:
logdeck:
environment:
- SSH_AUTH_SOCK=/ssh-agent
volumes:
- ${SSH_AUTH_SOCK}:/ssh-agentAdd remote hosts to known_hosts to avoid verification prompts:
ssh-keyscan remote-host >> ~/.ssh/known_hostsOr disable strict host key checking (not recommended for production):
# In ~/.ssh/config
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/nullexport DOCKER_HOSTS="local=unix:///var/run/docker.sock,remote=ssh://user@remote-host"
./logdeck-serverversion: "3.8"
services:
logdeck:
image: logdeck:latest
ports:
- "8080:8080"
environment:
- DOCKER_HOSTS=local=unix:///var/run/docker.sock,remote=ssh://deploy@prod.example.com
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ~/.ssh:/root/.ssh:roSymptom: Cannot connect to remote Docker host
Solutions:
-
Verify network connectivity:
ping remote-host telnet remote-host 22 # for SSH telnet remote-host 2375 # for TCP
-
Check SSH authentication:
ssh -v user@remote-host docker ps
-
Verify Docker daemon is running:
ssh user@remote-host systemctl status docker
-
Check Docker daemon configuration:
ssh user@remote-host cat /etc/docker/daemon.json
Symptom: Permission denied errors when accessing Docker
Solutions:
-
Add user to docker group on remote host:
sudo usermod -aG docker username
-
Verify Docker socket permissions:
ls -l /var/run/docker.sock
-
Check SELinux/AppArmor policies if applicable
Symptom: SSH authentication failures
Solutions:
-
Verify key permissions:
chmod 600 ~/.ssh/id_ed25519 chmod 644 ~/.ssh/id_ed25519.pub chmod 700 ~/.ssh
-
Check SSH agent:
ssh-add -l ssh-add ~/.ssh/id_ed25519 -
Test SSH connection:
ssh -vvv user@remote-host
Symptom: Server fails to start with configuration error
Solutions:
-
Validate
DOCKER_HOSTSformat:- Ensure
=separator between name and host - Ensure
,separator between entries - Check for trailing commas or spaces
- Ensure
-
Verify host URLs:
- SSH:
ssh://user@host(notssh:user@host) - TCP:
tcp://host:port(nottcp:host:port) - Unix:
unix:///path/to/socket(three slashes)
- SSH:
-
Check for special characters in host names:
- Use only alphanumeric characters and hyphens
- Avoid spaces, special characters in friendly names
- Current single-host setups will continue to work without changes
- Default configuration uses local Unix socket if
DOCKER_HOSTSis not set - Add
DOCKER_HOSTSenvironment variable to expand to multiple hosts - No database migration required
- Frontend automatically adapts to single or multi-host mode
The system maintains backward compatibility:
- Existing container operations work on the default host
- API responses include host information even for single-host setups
- Frontend displays host filter even with single host configured
- No breaking changes to existing API contracts