These docs track the development branch (main). Latest release: v0.23.0.
Skip to content

Deployment guide โ€‹

Running CargoShip in production โ€” CI/CD, EC2, cron, or a scheduled batch host. This covers the IAM policy, system sizing, credential setup, workload-based tuning, and a go-live checklist. For autonomous archival on NAS hardware, see ghost-ship.

IAM permissions โ€‹

Grant the minimum S3 actions plus the multipart actions CargoShip relies on:

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject", "s3:GetObject", "s3:DeleteObject",
        "s3:ListBucket", "s3:GetBucketLocation",
        "s3:AbortMultipartUpload", "s3:ListMultipartUploadParts",
        "s3:ListBucketMultipartUploads"
      ],
      "Resource": [
        "arn:aws:s3:::your-bucket-name",
        "arn:aws:s3:::your-bucket-name/*"
      ]
    }
  ]
}

Add kms:GenerateDataKey, kms:Decrypt, and kms:DescribeKey for encryption (see Security model), cloudwatch:PutMetricData for metrics, and the S3 lifecycle actions if you manage policies with cargoship lifecycle.

System sizing โ€‹

TierCPURAMNetwork
Minimum2 cores4 GB10 Mbps
Recommended8+ cores16 GB1 Gbps
High performance16+ cores32 GB+10 Gbps

CargoShip is statically linked with minimal dependencies. Memory scales with chunk size ร— workers, so size RAM to your chosen concurrency. Allow HTTPS (443) egress to S3 endpoints.

Credentials โ€‹

CargoShip uses the standard AWS credential chain โ€” no CargoShip-specific setup.

bash
# CI/CD: environment variables
export AWS_REGION=us-west-2
export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...

# Local: named profile
export AWS_PROFILE=production AWS_REGION=us-west-2

# EC2: use an instance profile โ€” nothing to configure

For persistent defaults, generate a config file with cargoship setup or cargoship config --generate and place it at ~/.cargoship.yaml. See Config files & precedence.

Workload-based tuning โ€‹

Leave shard count on auto unless you're benchmarking. The main levers are compression level and network-matched concurrency.

  • Many small files โ€” group aggressively, high compression: --compression-level 9.
  • Mixed dataset โ€” omit --compression-level entirely. Content-aware selection picks per chunk, which a single pinned level cannot; tag --project for cost tracking.
  • Few large / already-compressed files โ€” pin a fast level: --compression-level 1.

Match parallelism to your uplink: residential broadband wants a small shard count, a datacenter link can drive many. See Performance tuning.

Storage class by access pattern โ€‹

ClassBest for
STANDARDActive data, frequent access
STANDARD_IAInfrequent access (monthly)
GLACIER_IR / GLACIERLong-term archive, rare access
DEEP_ARCHIVECompliance / cold archive (slow, cheap)

Assign per chunk by file age with tier-aware storage.

Observability โ€‹

Enable Prometheus metrics and OpenTelemetry tracing per run:

bash
cargoship upload ./data s3://my-bucket/archives/ \
  --prometheus-addr :9090 \
  --tracing --tracing-exporter otlp --tracing-endpoint http://localhost:4318

See Observability & tracing for the exporters and metric names.

Go-live checklist โ€‹

  • [ ] IAM policy applied and verified (aws sts get-caller-identity).
  • [ ] Bucket exists in the region CargoShip is configured for.
  • [ ] cargoship config --validate-detailed passes.
  • [ ] A test upload round-trips (upload โ†’ verify โ†’ restore).
  • [ ] Budget and alerts configured if spend needs bounding (Budgets).
  • [ ] Encryption enabled if data is sensitive (--kms-key-id --encrypt-manifest).
  • [ ] Monitoring wired up (Prometheus / CloudWatch) for scheduled runs.

See also โ€‹