File Transfer with SCP
Transfer files between your local machine and Brev GPU instances using SCP or the built-in brev copy command.
Prerequisites
- Brev CLI installed and logged in
- A running Brev instance
- SSH config updated (
brev refresh)
Using brev copy
The brev copy command wraps SCP with automatic instance resolution.
brev copy Flags
Direct SCP Usage
You can also use SCP directly with the Brev-managed SSH key.
Basic Syntax
Using Managed SSH Config
After running brev refresh, your SSH config is automatically configured. You can use instance names directly:
Run brev refresh after creating or restarting instances to ensure your SSH config is up to date.
Container vs Host Paths
Brev instances run a container on top of a host machine. Understanding the path mappings is important for file transfers.
Default Setup
By default, brev copy targets the container. Files placed in /home/ubuntu/workspace/ inside the container are persisted through restarts.
Copying to Host
Use the --host flag to copy directly to the host machine:
When to use host vs container:
- Host: Large datasets, files that need to persist outside the container
- Container: Code and development files you’re actively working on
Custom Container Paths
If you’re using a custom container image, the workspace may be mounted at a different path:
Check your container’s configuration for the exact mount point.
Common Patterns
Syncing Project Files
Upload your entire project:
Downloading Training Results
Retrieve model checkpoints and logs:
Transferring Large Datasets
For large files, copy to the host for better performance:
Then extract inside the instance:
Troubleshooting
Permission denied
Ensure you’ve run brev refresh and the instance is running:
Connection refused
The instance may still be starting. Wait for status to show “Running”:
Slow transfers
For large files, consider:
- Compressing before transfer (
tar -czf) - Using
rsyncfor incremental syncs - Transferring to host instead of container