Docs / Migration Guides / How to Migrate Docker Containers Between Servers

How to Migrate Docker Containers Between Servers

By Admin · Mar 1, 2026 · Updated Apr 25, 2026 · 23 views · 2 min read

Overview

Moving Docker containers and their data to a new Breeze requires transferring images, volumes, and compose configurations. This guide covers the key methods for a smooth migration.

Step 1: List Current Containers and Images

docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.Status}}"
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"

Step 2: Save Docker Images

Export images as tar archives:

# Save a single image
docker save myapp:latest | gzip > myapp-image.tar.gz

# Save all images at once
docker save $(docker images --format "{{.Repository}}:{{.Tag}}") | gzip > all-images.tar.gz

Step 3: Back Up Volumes

# List volumes
docker volume ls

# Back up a volume
docker run --rm -v myapp_data:/data -v $(pwd):/backup alpine \
  tar czf /backup/myapp_data.tar.gz -C /data .

Step 4: Transfer to the New Breeze

rsync -avzP myapp-image.tar.gz myapp_data.tar.gz docker-compose.yml \
  root@new-breeze-ip:/opt/myapp/

Step 5: Restore on the New Server

# Load images
docker load < /opt/myapp/myapp-image.tar.gz

# Create and restore volume
docker volume create myapp_data
docker run --rm -v myapp_data:/data -v /opt/myapp:/backup alpine \
  sh -c "cd /data && tar xzf /backup/myapp_data.tar.gz"

# Start containers
cd /opt/myapp
docker compose up -d

Alternative: Docker Registry

For images in a registry, simply pull on the new server:

docker compose pull
docker compose up -d

Verification

  • Check all containers are running: docker ps
  • Review logs for errors: docker compose logs -f
  • Test application endpoints
  • Verify persistent data is intact

Was this article helpful?