A docker container for running Holochain and installing hApps to host them as always-on nodes.
Besides holochain and hc, the following commands are available in the container to manage the hApp lifecycle:
list_happshapp_config_fileinstall_happenable_happdisable_happuninstall_happ
- Docker installed and running.
The container images are available from GitHub Packages.
# Log in to GitHub Container Registry
docker login ghcr.io
# Pull the latest image
docker pull ghcr.io/holo-host/edgenodeTo run the container with persistent storage, you need to map a local directory on your host machine to the /data volume in the container.
- Create the directory for persistent storage:
- Run the container in the background:
docker run --name edgenode -dit \
-v $(pwd)/holo-data:/data \
ghcr.io/holo-host/edgenode To access an interactive shell in the running container:
docker exec -it edgenode su - nonrootYou can use the install_happ script to install a hApp from a JSON configuration file. URLs for both .happ and .webhapp files are supported.
- Get another interactive shell to the container.
- Run the script:
su - nonroot
install_happ <config.json>
enable_happ <APP_ID>To list installed hApps, use the list_happs script.
- Get another interactive shell to the container.
- Run the script:
su - nonroot
export ADMIN_PORT=<admin_port>
list_happs $ADMIN_PORTOr with default port:
list_happsHolochain logs are redirected to /data/logs/holochain.log inside the container for persistence.
- If using a volume mount (e.g.,
-v $(pwd)/holo-data:/data), access logs directly from the host at./holo-data/logs/holochain.log. - To copy logs from a running container:
docker cp edgenode:/data/logs/holochain.log . - View live logs:
docker exec -it edgenode tail -f /data/logs/holochain.log
Logs are rotated daily (see Process Management and Logging) with 7 days retention.
To deploy in production using the Holochain conductor:
- Remove any prior containers if you need to:
docker stop edgenode && docker rm edgenode - Run the Container The Holochain conductor will start up automatically with the container:
docker run --name edgenode -dit \
-v $(pwd)/holo-data:/data \
-p 4444:4444 \
ghcr.io/holo-host/edgenode-
Conductor Configuration
The Conductor configuration in this container operates on certain conventions:
- Admin port must be
4444 lair_rootmust be empty- Configuration must use LSB-compliant paths
- Admin port must be
-
Persistent Configuration The conductor configuration is persisted through the same volume mount structure as sandbox mode:
/etc/holochain→/data/holochain/etc/var/local/lib/holochain→/data/holochain/var
-
Install hApp(s)
install_happ <config.json>
5. Enable hApp(s)
enable_happ <APP_ID>
The container uses advanced process management and logging for reliability in production.
- tini as PID 1: The init system
tiniis used as the container's PID 1. It handles process supervision, reaps zombie processes, and can restart the Holochain conductor if it crashes (configured via entrypoint.sh). - Non-root User: All processes run as user ID 65532 (nonroot) for security.
- Supervisor Behavior: entrypoint.sh execs
tini -- holochain run ..., ensuring proper signal handling and restarts. Manualhc runcommands inside the container are also supervised.
- Redirection: Holochain output is redirected to
/data/logs/holochain.logusing> /data/logs/holochain.log 2>&1in entrypoint.sh. This captures stdout/stderr for persistence. - Persistence: Logs are stored in the
/datavolume, ensuring they survive container restarts. - Directory Setup: entrypoint.sh creates
/data/logsif it doesn't exist.
- Configuration: Defined in
/etc/logrotate.d/holochain.conffor daily rotation, keeping 7 days of logs, with compression (gzip). - Background Loop: entrypoint.sh starts a background loop (
while true; do logrotate /etc/logrotate.d/holochain.conf; sleep 86400; done) to run rotation daily.
This setup ensures robust logging and process reliability without manual intervention.
The container is configured to store all persistent data in the /data directory. This directory is then symlinked to the appropriate locations for Holochain to use.
The following diagram illustrates the volume mapping and symlinks:
graph TD
subgraph Host
direction LR
host_dir["./holo-data"]
end
subgraph Container
direction LR
subgraph "Volume Mount"
direction LR
data_vol["/data"]
end
subgraph "Persistent Storage"
direction LR
etc_holochain["/etc/holochain"]
var_holochain["/var/local/lib/holochain"]
end
subgraph "Symlinks"
direction LR
data_etc["/data/holochain/etc"]
data_var["/data/holochain/var"]
end
end
host_dir -- "-v" --> data_vol
data_etc -.-> etc_holochain
data_var -.-> var_holochain
- The
holo-datadirectory on the host is mounted to/datain the container. /data/holochain/etcis symlinked to/etc/holochain./data/holochain/varis symlinked to/var/local/lib/holochain.
This means that any data written to /etc/holochain or /var/local/lib/holochain inside the container will be persisted in the holo-data directory on your host machine.