Deploy Paperclip on ZCP
Ce contenu n’est pas encore disponible dans votre langue.
Paperclip is a self-hosted workspace for organizing AI agents and their work. This tutorial shows how to deploy the prepared Paperclip image on ZCP, keep its dashboard private, connect a provider, and verify that its data can be restored.
Before You Start
Section titled “Before You Start”You need:
- Access to the approved Paperclip image in your ZCP project
- A VM plan selected for your expected data retention, model usage, and operating needs
- An SSH key and permission to add a source-restricted firewall or Network ACL rule
- An approved AI provider subscription or API key if you want to run an agent
Acceptance testing used 4 vCPUs, 8 GB RAM, and a 116 GB root filesystem. This is a historical
filesystem measurement, not an allocated-disk value, a minimum, or a capacity recommendation. The
prepared image includes jq, which the restore health check uses.
Paperclip uses SSH for administration and browser access. Keep SSH restricted to your current public IP address. Do not expose port 3100 to the internet.
Deploy the VM
Section titled “Deploy the VM”- In the ZCP Console, create a VM from the approved Paperclip image.
- Choose your approved plan, network, and SSH key.
- For internet SSH access, enable a public IPv4 address during creation or select an existing public address after creation. Open the selected network or VPC’s Public IP Addresses tab and select an address for SSH forwarding. If no address is available, use Acquire New IP, choose a billing cycle, then select Buy IP. See Public Network IP addresses or VPC IP addresses.
- Configure SSH access for your network:
- On a Public Network, add a firewall rule that allows TCP on your chosen public SSH port
only from your current public IP address as
/32. Then add a port-forwarding rule that maps that public port to VM TCP port 22. Apply the source CIDR to the firewall rule, not the forwarding rule. - On a VPC Network, add a port-forwarding rule from your chosen public SSH port to VM TCP
port 22. Add an inbound Network ACL rule that allows TCP port 22 only from your current public
IP address as
/32.
- On a Public Network, add a firewall rule that allows TCP on your chosen public SSH port
only from your current public IP address as
- Wait until the VM shows as running.
Your current public IP address is the /32 source for the firewall or Network ACL rule. The
<vm-public-ip> placeholder below is the public IP selected for the forwarding rule. A source-NAT
address might not appear in the instance’s Public IP field, so use the address attached to the
forwarding rule.
Verify First Boot
Section titled “Verify First Boot”Connect to the VM:
ssh -i '<private-key-path>' -p '<public-ssh-port>' ubuntu@'<vm-public-ip>'Check the service and its local health endpoint:
cd /opt/paperclipsudo docker compose pscurl -fsS --max-time 10 http://127.0.0.1:3100/api/healthsudo test -f /opt/paperclip/.first-boot-done && echo "First boot completed"df -h /The paperclip container should be running. Its dashboard should listen only on 127.0.0.1:3100,
and the health response should contain "status":"ok".
If first boot has not completed, inspect its logs before changing any configuration:
sudo journalctl -u paperclip-first-boot.service -n 160 --no-pagercd /opt/paperclip && sudo docker compose logs --tail=120Open the Dashboard Privately
Section titled “Open the Dashboard Privately”Run this command from your workstation and keep it running:
ssh -i '<private-key-path>' -p '<public-ssh-port>' -o IdentitiesOnly=yes \ -o ExitOnForwardFailure=yes -N \ -L 127.0.0.1:3100:127.0.0.1:3100 ubuntu@'<vm-public-ip>'Open http://localhost:3100 in a private browser window. The dashboard stays private because the VM
accepts it only on its loopback interface. Paperclip uses localhost:3100 for browser redirects.
The tunnel closes when the SSH process stops. Recreate it after you restart the VM.
Create the First Administrator
Section titled “Create the First Administrator”- Select Sign in / Create account.
- Create the first Paperclip account and claim the instance.
- Create your organization. Complete provider and agent setup after the backup and restore checks.
- Close the browser window. Open a new private window at
http://localhost:3100/authand sign in with the account you created.
Use a Paperclip password that is distinct from your VM access and provider credentials. Confirm a deliberately incorrect password is rejected.
From the VM, you can confirm that unauthenticated organization access is denied:
curl -sS -o /dev/null -w 'Anonymous access: HTTP %{http_code}\n' \ http://127.0.0.1:3100/api/companiesThe expected result is HTTP 403.
Verify Restart Recovery
Section titled “Verify Restart Recovery”Restart the Paperclip container:
cd /opt/paperclipsudo docker compose restartsleep 20sudo docker compose pscurl -fsS --max-time 10 http://127.0.0.1:3100/api/healthRestart the VM from the ZCP Console. When it returns to running, reconnect the SSH tunnel, sign in, and confirm your organization and onboarding data remain available.
Create a Cold Backup
Section titled “Create a Cold Backup”This procedure briefly stops Paperclip to create a consistent archive. It stores sensitive runtime configuration and application data in a root-only directory. Keep the archive in an approved backup location. Run this validation before connecting a provider or running agent tasks. It does not cover backups of existing deployments that already contain provider credentials or agent state.
sudo bash -c 'set -euo pipefailumask 077
compose_file=/opt/paperclip/docker-compose.ymlproject_dir=/opt/paperclipbackup_dir="/var/backups/paperclip/$(date -u +%Y-%m-%d-%H%M%S)"original_stopped=falsemkdir -p "$backup_dir"chmod 700 "$backup_dir"
restart_original() { docker compose -f "$compose_file" --project-directory "$project_dir" start}
cleanup() { status=$? if [ "$original_stopped" = true ]; then restart_original || status=1 fi exit "$status"}
signal_exit() { exit 1}
trap cleanup EXITtrap signal_exit HUP INT TERM
cp "$compose_file" "$backup_dir/docker-compose.yml"cp /etc/paperclip/runtime.env "$backup_dir/runtime.env"image="$(docker compose -f "$compose_file" --project-directory "$project_dir" config --images)"
original_stopped=truedocker compose -f "$compose_file" --project-directory "$project_dir" stopdocker run --rm --pull=never --network none \ --entrypoint tar \ --mount type=volume,source=paperclip-data,target=/paperclip,readonly \ --mount "type=bind,source=$backup_dir,target=/backup" \ "$image" -czf /backup/paperclip-data.tar.gz -C /paperclip .
cd "$backup_dir"gzip -t paperclip-data.tar.gztar -tzf paperclip-data.tar.gz >/dev/nullsha256sum docker-compose.yml runtime.env paperclip-data.tar.gz > SHA256SUMSsha256sum -c SHA256SUMSrestart_originaloriginal_stopped=falseecho "Backup saved to: $backup_dir"'Verify the original service after the backup completes:
sleep 20curl -fsS --max-time 10 http://127.0.0.1:3100/api/healthProtect and Retain Your Backup
Section titled “Protect and Retain Your Backup”/var/backups is on the VM’s root disk. It does not protect you from VM or root-disk loss. Copy the
backup directory to an approved, access-controlled destination outside the VM. Encrypt the transfer
and stored copy according to your organization’s policy.
The archive and runtime.env can include application data, authentication material, and signing
secrets. Keep SHA256SUMS with the backup for verification. After copying the files, verify the
copied SHA256SUMS against the copied files. Do not put any of them in Git, support tickets, or
public storage.
Set a retention period, monitor the backup destination, and securely delete expired copies under your organization’s policy. Off-VM recovery, scheduled backup automation, and recovery time and recovery point objectives have not been tested. Treat this procedure as operational guidance, not a disaster-recovery runbook.
Restore into an Isolated Volume
Section titled “Restore into an Isolated Volume”Set backup_dir to the backup directory printed by the previous command. This restore procedure
uses a separate Docker volume and VM port 3101. It does not overwrite the running Paperclip data.
(set -euo pipefail
backup_dir="/var/backups/paperclip/<timestamp>"sudo bash -c 'cd "$1" && sha256sum -c SHA256SUMS && gzip -t paperclip-data.tar.gz && tar -tzf paperclip-data.tar.gz >/dev/null' _ "$backup_dir"
image="$(sudo docker compose -f "$backup_dir/docker-compose.yml" config --images)"restore_volume="paperclip-restore-check-$(date -u +%Y%m%d%H%M%S)"sudo docker volume create "$restore_volume"
sudo docker run --rm --pull=never --network none --entrypoint tar \ --mount "type=volume,source=$restore_volume,target=/restore" \ --mount "type=bind,source=$backup_dir/paperclip-data.tar.gz,target=/backup.tar.gz,readonly" \ "$image" -xzf /backup.tar.gz -C /restore
sudo docker run -d --pull=never --name paperclip-restore-check \ --env-file "$backup_dir/runtime.env" \ -e HOST=0.0.0.0 -e PORT=3100 -e PAPERCLIP_HOME=/paperclip \ -e PAPERCLIP_DEPLOYMENT_MODE=authenticated \ -e PAPERCLIP_DEPLOYMENT_EXPOSURE=private \ -e PAPERCLIP_PUBLIC_URL=http://localhost:3100 \ -p 127.0.0.1:3101:3100 \ --mount "type=volume,source=$restore_volume,target=/paperclip" \ "$image"
sleep 20curl -fsS --max-time 10 http://127.0.0.1:3101/api/health \ | jq -e '.status == "ok"' >/dev/nullecho "Isolated restore volume: $restore_volume")To verify restored data in the browser, press Ctrl+C in the workstation terminal running the
original SSH tunnel. Then create a temporary tunnel from workstation port 3100 to VM port 3101:
ssh -i '<private-key-path>' -p '<public-ssh-port>' -o IdentitiesOnly=yes \ -o ExitOnForwardFailure=yes -N \ -L 127.0.0.1:3100:127.0.0.1:3101 ubuntu@'<vm-public-ip>'Open a fresh private browser session at http://localhost:3100/auth, manually sign in, and verify
the expected organization and saved onboarding data. Do not let the restored copy run agent tasks.
If a prior restore test left a container named paperclip-restore-check, stop it and remove it
before running the restore block again. Removing the container does not remove its Docker volume or
the backup archive.
When finished, stop and remove the test container. The command below does not use -v, so it
retains the isolated restore volume. Press Ctrl+C in the workstation terminal running the restore
tunnel, then reconnect the workstation tunnel to the original VM port 3100.
sudo docker stop paperclip-restore-checksudo docker rm paperclip-restore-checkRetain or delete the backup directory and isolated restore volume according to your approved retention policy.
ssh -i '<private-key-path>' -p '<public-ssh-port>' -o IdentitiesOnly=yes \ -o ExitOnForwardFailure=yes -N \ -L 127.0.0.1:3100:127.0.0.1:3100 ubuntu@'<vm-public-ip>'Connect a Provider and Run a Test Task
Section titled “Connect a Provider and Run a Test Task”In Paperclip, create a connection for your approved provider. Keep API keys, browser authorization codes, passwords, and session tokens out of shell history, tickets, and source control.
For a subscription connection, Paperclip shows the command to run inside the container. Run the command generated for your connection. Do not run a provider login command directly on the VM host.
For example, the Claude Code connection uses its own configuration directory:
cd /opt/paperclipsudo docker compose exec --user node \ -e CLAUDE_CONFIG_DIR='<paperclip-config-dir>' \ paperclip sh -lc 'mkdir -p "$CLAUDE_CONFIG_DIR" && claude auth login'Replace <paperclip-config-dir> with the complete CLAUDE_CONFIG_DIR directory shown by Paperclip
for this connection. Do not append it to another path or reuse a directory from another connection.
Complete the browser sign-in flow, then return to Paperclip and finish agent setup.
Assign the agent this task:
Reply exactly: Paperclip QA successful.Wait for the run to finish. Confirm the agent overview lists the provider adapter you configured,
then inspect its saved response. The recorded Claude Code run succeeded and saved
Paperclip QA Successful. Its capitalization and punctuation differ from the requested
Paperclip QA successful. text, so it does not demonstrate exact-text compliance.
Troubleshooting
Section titled “Troubleshooting”If SSH fails, check the public SSH port in the forwarding rule, the firewall or Network ACL source
CIDR, the selected SSH key, and the private-key file permissions. If the tunnel fails, keep
ExitOnForwardFailure=yes, check whether local port 3100 is already in use, then retry.
Cloud-init can report warnings without making first boot fail. Check the first-boot logs and local
health endpoint before treating a cloud-init warning as an application failure. You can also run
cloud-init status --long to inspect the current state.
If the restore command says jq is unavailable, confirm you are using the approved Paperclip image
before changing the command.
Limitations
Section titled “Limitations”This tutorial does not establish high availability, performance capacity, a minimum VM size, off-VM recovery, backup automation, or recovery objectives. The disposable acceptance VM used for the authenticated agent test was removed after testing, so authenticated-agent persistence was not rechecked.
Next Steps
Section titled “Next Steps”- Tutorials overview for other ZCP deployment guides
- Marketplace overview for published ZCP images
- Paperclip documentation for product features and provider setup