Skip to main content
The cpln cp command copies files and directories between your local machine and workload containers, similar to kubectl cp or docker cp.

When to use this

Upload configuration files

Copy config files, scripts, or data to a running container

Download logs or data

Retrieve log files, generated data, or debug artifacts from containers

Debug running workloads

Transfer debugging tools or inspect container state

Migrate data

Move files between local development and deployed workloads

Prerequisites

Install the Control Plane CLI before proceeding. See Installation.
You need a running workload in at least one location. See the Create a Workload guide.
The tar binary must be installed in the container image.
If your container image doesn’t include tar, the cpln cp command will fail. Most standard images (Debian, Ubuntu, Alpine) include it by default.
You need exec permission on the workload. See Workload Permissions.

Basic usage

Options

Copy to a workload

Copy a local file to a container:
The file is placed in /app/config/config.json in the container.

Copy from a workload

Download a file from a container:

Target specific replicas

When a workload has multiple replicas across locations, specify the exact target:
Use cpln workload replica get <workload> to list available replicas and their locations.

Multi-container workloads

For workloads with multiple containers, specify the target container:
If --container is not specified, the command targets the first container defined in the workload spec.

Common workflows

Upload a configuration file

Download application logs

Transfer debug tools

Troubleshooting

The container image doesn’t include tar. Either:
  • Use an image with tar installed
  • Install it in your Dockerfile: RUN apt-get install -y tar
  • For Alpine: RUN apk add --no-cache tar
The destination path may require elevated permissions. Try copying to /tmp/ first, then move with exec:
The workload may not be running in the specified location:

Next steps

Execute Commands

Run commands inside containers

Connect to Workloads

Interactive shell access

Port Forwarding

Access workload ports locally

Command Reference

Full cp command reference