馃摎 Reference guide

Manage Docker with Dockhand

Install Dockhand on a Linux Docker host, turn on login, and start, stop, and deploy containers from the browser.

TL;DR

Dockhand is a browser page for Docker on a machine you control. It starts and stops containers, shows logs, and deploys Compose stacks. Install it, turn on a login, and keep that page off the public internet.

What it is

Dockhand is a self-hosted Docker management app. It talks to the Docker engine through the Docker socket, then gives you a dashboard, a container list, a shell, logs, and a Compose editor. Its own data sits in SQLite, so a home server does not need a second database.

The homelab edition is the free one. The source is on GitHub under the Business Source License. Every account that can sign in is an admin. Role limits are an Enterprise feature. These steps use Docker on Linux and the local socket.

Install it

The project鈥檚 quick start publishes port 3000 on every interface. On a home server, bind it to localhost instead. You can open the page on the same machine, and nothing else on the network can reach it yet.

  1. Confirm Docker answers:
docker ps
  1. Start Dockhand:
docker run -d \
  --name dockhand \
  --restart unless-stopped \
  -p 127.0.0.1:3000:3000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v dockhand_data:/app/data \
  fnsys/dockhand:latest
  1. Open http://localhost:3000.

latest is the tag in the manual鈥檚 quick start. Read the release notes before you pull a newer image onto a host that is already in use.

The container runs as a non-root user. If the page says permission denied, it cannot read the socket. Check the socket鈥檚 group, remove the container, and start it again in that group. The dockhand_data volume stays in place.

stat -c '%g' /var/run/docker.sock
docker rm -f dockhand
docker run -d \
  --name dockhand \
  --restart unless-stopped \
  --group-add GID \
  -p 127.0.0.1:3000:3000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v dockhand_data:/app/data \
  fnsys/dockhand:latest

Replace GID with the number stat printed. Leave the container as a normal user. The manual鈥檚 run-as-root shortcut gives it more access than this fix needs.

Turn on login

Login is off the first time the page opens.

  1. Go to Settings, then Authentication.
  2. Create a local user with a username and a long password you do not use anywhere else.
  3. Turn on Enable authentication.
  4. Reload the page and sign in.

Do that before you let any other device open the page. If Dockhand is reachable past localhost while login is off and the socket is mounted read-write, anyone who can open the page can create containers on the host. The UI warns about that. After sign-in works, a second computer on the LAN can use the page. Recreate the container with -p 3000:3000 in place of the localhost bind when you want that. Still do not forward port 3000 on the router.

Run a container

The Containers page lists what the engine already has. The row actions cover the daily jobs.

  1. Open Containers.
  2. Start, Stop, or Restart the container you care about.
  3. Open Logs for the output, or Terminal for a shell in a running container.
  4. Click Create container for one image. Set the image, a name, the ports, and any folders to mount.

Deploy a stack

A stack is a Compose file Dockhand can start and edit.

  1. Open Stacks and click Create stack.
  2. Enter a short lowercase name. That name becomes the Compose project name, and Docker uses it as the prefix on the stack鈥檚 volumes.
  3. Paste the Compose file into the editor.
  4. Put ordinary settings in the environment panel on the right. Those are written to the stack鈥檚 env file.
  5. Click the key icon on a password or a token to store it as a secret. Dockhand injects secrets when it deploys and does not write them to the env file. A later docker compose up from the shell sees that variable as empty, so redeploy from Dockhand.
  6. If something already uses the ports in the file, stop that stack first.
  7. Check Deploy immediately, then click Create.

Reuse the project name of a stack that is already on the machine when the old volumes should stay attached. A new name creates new volumes, and the app looks empty even though the old data is still on disk. Leave both volumes alone until you know which one the app is using.

Stop frees the ports. Down removes the stack鈥檚 containers and networks. Do not remove volumes on the way down. Deleting a volume deletes the files in it.

A stack you already started with docker compose, or from another management page, shows up as Untracked. Dockhand can start and stop it. Import it from Stacks when you want to edit the file. Point at the folder that holds the Compose file. The files stay where they are.

A relative path such as ./config has to exist on the host, at the same path Dockhand sees. The named-volume install above does not do that. Use the manual鈥檚 matching-path setup: mount a host folder at the same path inside the container, and set the data directory to that path. If you already created the login, copy the old data across first, including db/ and the hidden encryption key. Pointing the data directory at an empty folder opens an empty database.

If it doesn鈥檛 work

Stay safe

  • Login is off until you enable it. Turn it on before any other device can open the page. Until then, anyone who can reach Dockhand can create containers on the host.
  • Do not publish port 3000 on the internet, and do not forward it on the router. A signed-in user can start containers, and access to the Docker socket is root-level access to the host. Keep the page on localhost, or reach it through a VPN.
  • In the free edition, every account that can sign in is an admin. Use a unique password and do not share it.

Sources

Spot something wrong or outdated? Leave a comment below. Every comment is reviewed to keep these posts accurate.

By commenting, you agree to our Terms of use and confirm this is your own work. Short quotes are fine with a credit and link. Copied, unsafe, or abusive comments are removed. See something copied? Say so here.