Guide

Copy Files from a Docker Container

Files inside a Docker container aren't on your VPS host, and they're not on your Mac. Getting them there takes three steps: add your SSH key, copy out of the container, SCP to your machine.

4 min readFebruary 2026
01

The problem

OpenClaw runs inside a Docker container. Any files it generates (setup docs, workspace files, config exports) exist only inside that container's filesystem. They are not available on the VPS host, and definitely not on your Mac.

The instinct is to SSH in and SCP the file directly. That fails for two reasons: the file isn't on the host, and if you haven't set up SSH key auth, you'll hit password rejection before you even get there.

01
SCP fails: wrong path
The file path you want only exists inside the container, not on the host OS.
02
SSH fails: no password
Hostinger VPS deployments often have no root password set by default.
03
Docker not on your Mac
Running docker commands locally won't reach the remote container.
The fix is three steps, done in the right order: SSH key → copy out of container → SCP to Mac.
02

Add your SSH key (one-time)

Before you can SCP anything, your Mac needs passwordless access to the VPS. The cleanest way is adding your public SSH key to Hostinger. You only do this once.

Get your public key

On your Mac, run:

cat ~/.ssh/id_ed25519.pub

If you get "No such file or directory", you don't have a key yet. Generate one:

ssh-keygen -t ed25519 -C "your@email.com"

Then run the cat command again. The output looks like this:

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID1O34Ny2u... your@email.com

Copy the entire line. Then in the Hostinger control panel:

01Go to VPS → your server → Settings → SSH keys
02Click + Add SSH key
03Paste your public key
04Give it a name (e.g. MacBook) and save
From this point on, ssh root@your-vps-ip and scp work instantly from your Mac. No password prompt, ever.
03

Copy the file out of the container

SSH into your VPS, navigate to the Docker Compose project directory, and use docker compose cp to copy the file to the host filesystem.

# SSH into the VPS
ssh root@your-vps-ip

# Navigate to the Compose project (docker compose cp runs from here)
cd /docker/openclaw-qrjy

# Copy the file from the container into the current directory
docker compose cp openclaw:/data/.openclaw/workspace/TELEGRAM_SETUP.md ./TELEGRAM_SETUP.md

The format is docker compose cp <service>:<path-in-container> <destination>. Using ./ as the destination places the file in the current directory. In this case /docker/openclaw-qrjy/TELEGRAM_SETUP.md, which is where SCP will find it.

If you're not sure what the service is called, run docker compose ps to see it. For a standard Hostinger OpenClaw deploy it's openclaw.
04

SCP the file to your Mac

Open a new terminal tab on your Mac (don't close the SSH session yet). Run SCP pointing at the host path you just created:

scp root@your-vps-ip:/docker/openclaw-qrjy/TELEGRAM_SETUP.md ~/Desktop/TELEGRAM_SETUP.md

Change the destination to wherever you want the file. For example, to download into your current project folder:

scp root@your-vps-ip:/docker/openclaw-qrjy/TELEGRAM_SETUP.md ./TELEGRAM_SETUP.md
Because your SSH key is registered, this completes instantly with no password prompt.
05

Full workflow, end to end

Once your SSH key is set up, the entire process from fresh terminal to file on your Mac is four commands.

Terminal · VPS session
ssh root@your-vps-ip
cd /docker/openclaw-qrjy
docker compose cp openclaw:/data/.openclaw/workspace/TELEGRAM_SETUP.md ./TELEGRAM_SETUP.md
Terminal · Mac (new tab)
scp root@your-vps-ip:/docker/openclaw-qrjy/TELEGRAM_SETUP.md ~/Desktop/TELEGRAM_SETUP.md

The same pattern works for any file inside any Docker container. swap the service name and path as needed.

That's the pattern

Add your SSH key once. After that: docker compose cp to get the file onto the host, then scp to pull it to your Mac. Works for any file in any container.