Usage
Arguments
Name of the volume to create. Must follow Docker naming conventions (only
a-z, A-Z, 0-9, -, _, .).Flags
Volume driver to use. Default is
local.Driver specific options in the form of
key=value pairs. Can be specified multiple times.Labels to assign to the volume in the form of
key=value pairs. Can be specified multiple times.Name or ID of the machine to create the volume on. If not specified and there are multiple machines, you’ll be prompted to select one.
Examples
Create a simple volume
If you have one machine, this creates the volume on that machine:Create a volume on a specific machine
Create a volume with labels
Create a volume with driver options
For advanced storage configurations:Output
Volume Drivers
Local Driver (default)
Stores data in a directory on the machine’s filesystem:Other Drivers
You can use other Docker volume drivers if they’re installed on the machine:Machine Selection
Volumes are created on a specific machine and can only be used by containers on that machine. When you mount a volume in a service:postgres-data volume exists.
Use Cases
Database Storage
Create a volume for database data:Application Data
Create a volume for uploaded files:Shared Configuration
Create a volume for configuration files:Important Notes
Machine-Specific
Volumes are tied to a specific machine. If that machine goes down, services using the volume cannot run on other machines. For high availability, consider:- Using replicated databases across multiple machines
- Network-attached storage (NFS, cloud storage)
- Backing up volumes regularly
Naming Constraints
Volume names must follow Docker naming rules:Related Commands
uc volume ls- List volumesuc volume rm- Remove volumesuc run- Run a service with volumes
