DeepSeek Harness in Docker: image, ports and data
Running DeepSeek Harness in a container is half startup and half persistence. Sessions, plugins, and configuration live under DSH_HOME; without a volume, a rebuild resets everything.
Three things a container loses
Three kinds of data decide how much configuration you repeat.
| Data | Location | If lost |
|---|---|---|
| Sessions | DSH_HOME/sessions | Conversation history gone |
| Plugins and config | DSH_HOME and profile | Reinstall and reconfigure |
| Keys and settings | Config directory | Re-enter models and keys |
All three sit under DSH_HOME. Mount the right directory and all three survive; mount only sessions and plugin configuration still disappears.
Do not store data on a container path. Container paths disappear with the container; mounts must point to host directories or named volumes.
Mounting the volume
The core container action; path consistency matters.
- Prepare a host directory, such as ~/dsh-data.
- Mount it to DSH_HOME when starting the container.
- Set the environment variable so DSH uses the same path.
- After startup, confirm sessions and config subdirectories appear.
- Reuse the same mount on rebuild to restore data.
Paths must match. If the environment variable points at A and the volume mounts at B, data writes to a temporary container path and the volume appears useless.
Named volumes work too. Bind mounts are easier to inspect and back up; named volumes are managed by Docker and need export commands when migrating. Confirm the directory is writable on first start; otherwise DSH may start but fail to persist.
Ports and access
Port mapping defines who can reach the service.
- The service listens on a container port mapped to a host port.
- Prefer mapping to 127.0.0.1 for local-only access.
- For LAN access, evaluate authentication and source limits first.
- Public access needs a reverse proxy, TLS, and authentication.
- Do not use 0.0.0.0 for convenience; it widens exposure.
Port mapping is not authentication. Reachability is not permission; authentication belongs to the service or proxy layer. Container networking differs from the host; when 127.0.0.1 cannot reach the container, check mapping and listen address instead of changing service config randomly.
Plugin persistence
Plugins install into a profile, and profiles live under DSH_HOME.
- Confirm plugins installed into the profile under the mounted directory.
- Verify with dsh plugin --profile web list.
- Rebuild and verify again.
- Keep plugin configuration and keys under DSH_HOME too.
- Migrate by copying the whole directory, not just plugin packages.
"Plugin present but config gone" usually means config wrote elsewhere. Check paths and environment variables. Plugins still need network access inside the container; verify registry reachability.
Rebuild order
Rebuilding is not delete and start; order prevents loss.
- Stop the old container and confirm no writes are in progress.
- Back up the mounted directory for rollback.
- Start the new container with the same mount and DSH_HOME.
- Check sessions, plugins, and configuration.
- Remove the old container and image only after verification.
Back up before rebuilding, and record versions. A wrong volume configuration leaves only the backup as a fallback. Image tag, DSH version, and plugin list help return to the previous combination.
Four failures
Four failure classes dominate containers.
- Data lost after rebuild: volume missing or wrong path; compare environment variable and mount.
- Plugins disappear: installed into a container path; confirm the profile is under the mount.
- Port unreachable: mapping or listen address; curl locally first.
- Permission errors: container user cannot write the mount; adjust permissions or user.
The common entry is "inspect paths inside the container." Looking only at the host cannot confirm where data went. Keep container logs before deleting.
Security prerequisites
Containers add isolation and a new exposure surface.
- Trusted images: official or self-built; avoid unknown bundles.
- Minimal ports: map only what is needed, preferably localhost.
- No keys in images: inject through environment variables or mounted config.
- Tight plugin permissions: containers do not justify loosening least privilege.
- Regular updates: base image and DSH both need security updates.
Isolation is not security. Containers limit impact but do not replace authentication, permissions, and source verification.
Next steps
Mount the volume before ports and plugins. For the three container install methods, read How to install DeepSeek Harness in Docker. For Linux, read Running DeepSeek Harness desktop on Linux. For remote security, read How to configure remote access.
Sources: DeepSeek Harness docs, dsh CLI README, deepseek-harness repository
FAQ
Mounting a data volume matters because sessions, plugins, and configuration live under DSH_HOME in DeepSeek Harness. Without a volume they disappear when the container is rebuilt.
Map container ports to a local host address when possible, such as 127.0.0.1:port:container-port. Mapping to all interfaces exposes DeepSeek Harness to the LAN or internet.
Plugins that disappear after a container rebuild usually mean DSH_HOME is not on the volume or plugins were installed into another path. Align the environment variable and mount.
A container adds isolation, but DeepSeek Harness plugins still run under sandbox modes, with permissions, paths, and device access limited by the container. GUI plugins may not work.
Related Terms
- DSH_HOME
- DSH_HOME is the data root for DeepSeek Harness, holding configuration, sessions, plugins, and cache; it can be set by environment variable.— DeepSeek Harness docs
- data volume
- A Docker data volume is storage independent of the container lifecycle; data persists on the host after the container is removed.— DeepSeek Harness docs
- port mapping
- Port mapping binds a container port to a host port, determining how external clients reach the service.— dsh CLI README
- image
- An image is the base filesystem and dependency snapshot for a container; trusted sources reduce supply-chain risk.— deepseek-harness repository
Sources
- DeepSeek Harness docs· deepseek-harness
- dsh CLI README· deepseek-ai
- deepseek-harness repository· deepseek-ai