apt package · install, register, and run · tested on Ubuntu 24.04
Before you start, you'll need two things from your Distributive account:
The machine also needs outbound HTTPS to the internet.
Fill in your values and the command below updates. Nothing you type leaves this page.
Or copy the command as-is and replace the two placeholder values before running it.
EARNINGS=0xYOUR_EARNINGS_ACCOUNT
REGKEY=0xYOUR_REGISTRATION_KEY
sudo mkdir -p /etc/systemd/system/dcp-worker.service.d && \
printf '[Service]\nExecStart=\nExecStart="/opt/dcp/bin/dcp-worker.sh" --output=console --no-global --earnings-account=%s\n' "$EARNINGS" \
| sudo tee /etc/systemd/system/dcp-worker.service.d/no-global.conf >/dev/null && \
wget -qO- https://apt.distributive.network/apt-setup.sh | bash && \
sudo apt-get install -y dcp-worker && \
sudo -u dcp /opt/dcp/bin/dcp-worker.sh --register="$REGKEY" && \
echo "Waiting 65 s for registration to take effect..." && \
sleep 65 && \
sudo systemctl restart dcp-worker
What it does:
--no-global so it only runs jobs from your own compute groups, and
--earnings-account so earnings go to your account. The override survives
package upgrades.dcp-worker package. This creates an unprivileged dcp user,
installs under /opt/dcp, and starts the worker service.dcp user
the service runs as.
You only do this once per machine. The worker's identity is saved in
/opt/dcp/.dcp and reloaded on every start, including after a reboot.
sudo systemctl status dcp-worker --no-pager
It should show Active: active (running). To watch the logs:
sudo journalctl -f -u dcp-worker
A healthy startup ends with:
* Starting Distributive Worker <worker-id>
. Identity is 0x...
! Leaving the global compute group
* Ready.
When a job from one of your compute groups is available you'll see
Slice Started lines. Press Ctrl+C to stop watching (the worker
keeps running). To list the compute groups the worker will use:
sudo -u dcp HOME=/opt/dcp /opt/dcp/bin/dcp-worker.sh --show=compute-groups --no-global
Stop:
sudo systemctl stop dcp-worker
Start again:
sudo systemctl start dcp-worker
No need to register again; the saved identity is reloaded every time. To change the
earnings account or other options later, edit
/etc/systemd/system/dcp-worker.service.d/no-global.conf, then run
sudo systemctl daemon-reload && sudo systemctl restart dcp-worker.
Remove the worker, keeping its identity:
sudo apt-get purge -y dcp-worker && \
sudo rm -rf /etc/systemd/system/dcp-worker.service.d && \
sudo systemctl daemon-reload && \
(sudo systemctl reset-failed dcp-worker 2>/dev/null || true)
This stops the worker and removes the package and its options. The identity stays in
/opt/dcp/.dcp, so reinstalling later brings back the same worker.
To remove everything, run this after the command above. It deletes
the worker's identity, the dcp user, and Distributive's apt repository.
Back up /opt/dcp/.dcp first if you might want the same worker ID later.
sudo rm -rf /opt/dcp && \
sudo userdel dcp && \
sudo rm -f /etc/apt/sources.list.d/distributive.list /etc/apt/keyrings/distributive-pubkey.asc && \
sudo apt-get update
Running and Ready, but never gets work: check that a job
is actually running in one of your compute groups, then restart the worker with
sudo systemctl restart dcp-worker. A worker started too soon after
registering can miss its compute groups until it restarts.
Service shows failed: see the error with
sudo journalctl -u dcp-worker --no-pager | tail -50. A log line saying
invalid earnings account means the address in the override is wrong.
Registration fails: check the key was copied completely, and that it hasn't already been used up or expired in your account.