Installing the Cosigner

Regular mode on Linux with Docker. Nitro Enclave support is coming soon.

Install, verify, pair, connect
Click to open the full-size diagram

Prerequisites

  • Host: Linux amd64 or arm64 for production. macOS or WSL 2 for development.
  • Docker: Engine 20.10+ with Compose v2.
  • cosign: v3+. The installer adds it if missing.
  • From Fystack: a pairing token (cps_...). See Step 1.
  • Callback server: required for production. See Approval Callback.

Network: no inbound ports. Outbound HTTPS to Apex, the Fystack Gateway, ghcr.io, your callback and (unattended profile) AWS KMS.


Step 1: Get a pairing token

In the Fystack dashboard, open the Cosigner tab, click Register Cosigner, choose Server and click Continue.

Register Cosigner dialog with the Server option selected
Choose Server for an automated cosigner

Enter a name for the cosigner. The dialog shows the install commands and a pairing token (cps_...). Copy the token: it is single-use, expires in 60 minutes and is shown only once.

Keep the dialog open while you finish the steps below. It shows Waiting for your cosigner to connect and updates once the cosigner pairs.

Register Cosigner dialog showing the install commands, the pairing token and a waiting for connection status
Copy the pairing token and keep the dialog open

Step 2: Install cosigner-cli

curl -sSL https://cosigner.fystack.io/install.sh | sh

Checks the binary's SHA-256 and Sigstore signature, then installs to /usr/local/bin (or ~/.local/bin).

Option Env var Effect
--version vX.Y.Z COSIGNER_VERSION Install a specific release
--dir DIR COSIGNER_INSTALL_DIR Install location
--skip-docker-checkSkip Docker checks

Step 3: Create the instance directory

Create a new, empty directory for this cosigner wherever suits your host, and run the remaining commands from inside it. cosigner-cli keeps all of the instance's config, secrets and state there.

Step 4: Check the host

cosigner-cli doctor

Checks Docker, cosign and config. Reports unconfigured, configured but unpaired or paired.

Step 5: Pair and start

cosigner-cli up

up then:

  1. Asks for the Fystack endpoint. Press Enter to keep the default.
  2. Verifies the newest ghcr.io/fystack/cosigner release with cosign and pins its digest, before asking for any secret.
  3. Writes a default config.yaml (manual profile, callback off).
  4. Prompts for a storage password and the pairing token from Step 1.
  5. Pairs: generates an Ed25519 identity, registers it with Apex, saves state/pairing.yaml.
  6. Starts the container, unlocks it and connects to the Gateway.
cosigner-cli up output: image verified and pinned, storage unlocked, paired with Apex, cosigner running
Example output of cosigner-cli up

The default config uses the manual profile: the storage key is wrapped with your password, which you enter on every start, and there is no auto-restart. To start on boot with AWS KMS instead, see Unattended profile.

Step 6: Turn on callback approval

The generated config has require_callback: false, so any request Fystack sends is signed. Turn on approval before creating wallets:

cosigner-cli callback add https://YOUR-CALLBACK-HOST \
  --server-public-key server-public.pem

This edits config.yaml in place, generates the cosigner's callback key in secrets/, writes cosigner-public.pem and restarts the cosigner. Copy cosigner-public.pem to your callback server. See Approval Callback.

The config now looks like this:

config.yaml

storage:
  backend: sqlite
  sqlite:
    path: data/cosigner.db
  encryption:
    kek:
      type: password_envelope
      config:
        path: /run/secrets/storage-kek.enc
approval:
  require_callback: true
audit:
  type: file
  config:
    path: /var/lib/cosigner/audit.jsonl
callback:
  timeout: 30s
  retry_count: 1
  url: https://YOUR-CALLBACK-HOST/cosigner/approve
  private_key:
    type: file
    config:
      path: /run/secrets/cosigner-private.der.hex
  response_public_key_path: /run/secrets/server-public.pem

To tune other settings, such as timeout or retry_count, edit the file and run cosigner-cli restart.

  • Inside the container, /var/lib/cosigner is the instance's state/ directory and /run/secrets is its secrets/ directory (read-only).
  • Keep storage and audit as generated: cosigner-cli requires SQLite at data/cosigner.db and file audit logging.

Step 7: Verify

cosigner-cli status
cosigner-cli info
cosigner-cli logs -f

Once status shows ready, the cosigner is online and can join keygen.

Unattended profile

The default config only supports the manual profile. For unattended, the storage key is wrapped by your AWS KMS key and the cosigner starts on boot. Write the config yourself before Step 5, keeping it outside the instance directory (up copies it in):

config.yaml

storage:
  backend: sqlite
  sqlite:
    path: data/cosigner.db
  encryption:
    kek:
      type: kms
      config:
        provider: aws
        region: YOUR-AWS-REGION
        key_id: YOUR-KMS-KEY-ARN
        ciphertext_blob_path: /run/secrets/storage-kek.kms
approval:
  require_callback: false
audit:
  type: file
  config:
    path: /var/lib/cosigner/audit.jsonl

Encrypt a random 32-byte key with your KMS key and save the base64 ciphertext as secrets/storage-kek.kms in the instance directory. The container needs kms:Decrypt via an IAM role. Then run:

cosigner-cli up \
  --profile unattended \
  --config /secure/config.yaml

Continue with Step 6 to turn on callback approval.

Instance layout

Path Contents
cosigner-cli.yaml Apex endpoint, pinned image digest, profile
config.yaml Runtime config (read-only)
docker-compose.yaml Generated, hardened Compose file
secrets/ Wrapped storage key and callback keys
state/pairing.yaml Pairing record from Apex
state/cosigner.key Ed25519 identity key
state/data/cosigner.db Encrypted key shares and session state
state/audit.jsonl Signed audit log

Run on boot

Unattended profile only. Adapt the bundled systemd unit:

/etc/systemd/system/cosigner.service

[Unit]
Description=Fystack Cosigner (KMS unattended profile)
Requires=docker.service
After=docker.service network-online.target
Wants=network-online.target

[Service]
Type=oneshot
RemainAfterExit=yes
User=cosigner
Group=cosigner
SupplementaryGroups=docker
ExecStart=/usr/local/bin/cosigner-cli --home /var/lib/fystack-cosigner start
ExecStop=/usr/local/bin/cosigner-cli --home /var/lib/fystack-cosigner stop
TimeoutStartSec=360
TimeoutStopSec=60
UMask=0077

[Install]
WantedBy=multi-user.target

For the manual profile, pass the password through a file descriptor:

COSIGNER_PASSWORD_FD=3 cosigner-cli start 3< /run/secrets/cosigner-pw

This is less secure than typing the password by hand. See Automate restart.

Troubleshooting

Symptom Fix
Image signature verification failed Don't bypass. Check the image reference and contact security@fystack.io.
identity already registered Restore the original pairing data from backup instead of re-pairing.
Exits right after start Startup callback ping failed. Check the callback is reachable and trusts cosigner-public.pem.
AlreadyExists Another instance with this identity is connected. Stop it.
PermissionDenied Cosigner was revoked. It will not reconnect.
Not ready after first start Generating ECDSA pre-parameters. Wait up to 5 minutes.