Skip to main content
Remove one or more Docker volumes from machines in the cluster.

Usage

uc volume rm VOLUME_NAME [VOLUME_NAME...] [flags]
Aliases: uc volume remove, uc volume delete

Arguments

VOLUME_NAME
string[]
required
Names of volumes to remove. Can specify multiple volumes.

Flags

-f, --force
Force the removal of one or more volumes.
-m, --machine
string[]
Name or ID of the machine to remove volume(s) from. Can be specified multiple times or as a comma-separated list. If not specified, the found volume(s) will be removed from all machines.
-y, --yes
Do not prompt for confirmation before removing the volume(s).

Examples

Remove a volume (with confirmation)

uc volume rm postgres-data
You’ll see:
The following volumes will be removed:
 • 'postgres-data' on machine 'vps1'

Do you want to continue? (y/N)

Remove a volume without confirmation

uc volume rm postgres-data -y

Remove multiple volumes

uc volume rm postgres-data redis-data app-uploads

Remove a volume from a specific machine

If a volume with the same name exists on multiple machines:
uc volume rm mydata -m vps1

Force remove a volume

Remove even if in use (may cause errors):
uc volume rm mydata -f

Confirmation

By default, you’ll be asked to confirm before removing volumes:
The following volumes will be removed:
 • 'postgres-data' on machine 'vps1'
 • 'redis-data' on machine 'vps2'

Do you want to continue? (y/N) y

Volume 'postgres-data' removed from machine 'vps1'.
Volume 'redis-data' removed from machine 'vps2'.
Skip confirmation with -y:
uc volume rm postgres-data redis-data -y

Important Notes

Data Loss Warning

Removing a volume permanently deletes all data stored in it. This action cannot be undone.
# All data in postgres-data will be lost!
uc volume rm postgres-data
Make sure you have backups before removing volumes containing important data.

Volumes in Use

You cannot remove a volume that’s currently in use by a container:
Error: failed to remove volume 'postgres-data' on machine 'vps1': volume is in use
Stop or remove services using the volume first:
uc service rm database
uc volume rm postgres-data
Or use --force to override (not recommended):
uc volume rm postgres-data -f

Multiple Machines

If a volume name exists on multiple machines, all instances are removed unless you specify --machine:
# Removes 'mydata' from all machines
uc volume rm mydata

# Removes 'mydata' only from vps1
uc volume rm mydata -m vps1

Output

Volume 'postgres-data' removed from machine 'vps1'.
If removing from multiple machines:
Volume 'mydata' removed from machine 'vps1'.
Volume 'mydata' removed from machine 'vps2'.

Use Cases

Clean Up After Service Removal

After removing a service, clean up its volumes:
uc service rm database
uc volume rm postgres-data

Free Up Disk Space

Remove unused volumes to free disk space:
uc volume ls
uc volume rm old-data temp-files

Start Fresh

Remove and recreate a volume to reset data:
uc volume rm app-data -y
uc volume create app-data -m vps1

Build docs developers (and LLMs) love