Portabase Logo

Docker Volume

Configuration for Docker Volume backups.

The docker-volume type lets the agent back up a Docker named volume directly, without going through a database driver. It is useful for engines with no dedicated dump tool, or for protecting any container's data volume as-is.

Backup and restore are performed on the fly, hot, without stopping the target container.

This provider requires the agent to have access to the Docker socket. You must mount /var/run/docker.sock:/var/run/docker.sock on the agent container, otherwise it cannot inspect or archive the volume.

Configuration

When running portabase db add, select docker-volume as the database type.

Specific parameters asked:

  • Volume Name: The exact name of the Docker volume to back up (e.g., databases_sqlite-data).
  • Container Name: (Optional, but recommended) The name of the container currently using the volume. Provide it so the agent can automatically restart that container after a restore.

In your databases.json (or .toml) file, configure the following block.

databases.json
{
  "name": "Test database 14 - Docker Volume",
  "type": "docker-volume",
  "volume_name": "<volume_name>",
  "generated_id": "...",
  "container_name": "<container_name>"
}
Generate UUID for your configuration
Generating...

Specific Parameters:

  • volume_name: (Required) The name of the Docker volume to back up.
  • container_name: (Optional, but recommended) The name of the container the volume is attached to. Without it the backup/restore still works, but the agent cannot restart the container automatically after a restore.

Docker Compose Example

The agent needs access to the Docker socket to inspect and archive volumes. Mount it alongside your regular agent configuration.

docker-compose.yml
services:
  agent:
    image: portabase/agent:latest
    volumes:
      - ./databases.json:/config/config.json
      # Required: gives the agent access to the Docker daemon
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      TZ: "Europe/Paris"
      EDGE_KEY: "..."
    networks:
      - portabase

networks:
  portabase:
    name: portabase_network
    external: true

Without the Docker socket mounted, the agent cannot resolve or archive the volume and the backup job will fail.

Last updated on

On this page