Skip to content

Persistent Volumes

By default, data written inside a container is lost when the container is replaced during a redeployment. Persistent volumes solve this by mounting a named Docker volume into the container at a path you specify. Data written to that path survives redeployments, rollbacks, and container restarts.

When you add a volume to a service, Clank:

  1. Creates a named Docker volume on the server (e.g., clank-myproject-myservice-data).
  2. Mounts it into the container at the path you specify (e.g., /data or /var/lib/postgresql/data).
  3. On redeployment, the new container mounts the same volume. Your data is still there.

Volumes are tied to the server. If you move a service to a different server, the volume on the old server is not automatically migrated.

In the dashboard:

  1. Go to your service’s Settings tab.
  2. Under Persistent Volumes, click Add Volume.
  3. Enter the mount path — the directory inside the container where data should persist. This must match where your application writes its data.
  4. Save and redeploy.

The volume is created on first deploy and reused on subsequent deploys.

ApplicationMount path
PostgreSQL/var/lib/postgresql/data
MySQL/var/lib/mysql
MongoDB/data/db
Redis/data
WordPress/var/www/html
Generic app data/data or /app/data

Volumes are named automatically: clank-{project-slug}-{service-slug}-data. This ensures volumes are unique per service and won’t conflict with other services on the same server.

Volumes change how deployments work:

  • No blue-green: Services with volumes always use recreate mode. Running two containers against the same database volume simultaneously would cause data corruption.
  • Brief downtime: The old container stops before the new one starts. There is a short downtime window during the swap.
  • Data persists: The new container sees the exact same data the old one wrote.

When you delete a service, Clank asks whether to also delete its volumes. This is an opt-in step — volumes are preserved by default to prevent accidental data loss.

If you choose to delete volumes, the data is permanently removed from the server and cannot be recovered.

  • Server-local: Volumes exist on a single server. Moving a service to another server does not move its volumes.
  • No cross-service sharing: Each volume belongs to one service. Two services cannot share a volume.
  • No automatic backups: Clank does not automatically back up volume data. Use the backup feature or set up your own backup strategy for critical data.
  • Deployments — How volumes affect deployment strategy (recreate vs blue-green).
  • Backups — Back up service data.