A volume is where your data lives, so it stays when a container is removed. The Volumes tab shows every volume on this server, and how to keep that data safe.
Find what you need
| I want to | Instead of typing | Go to |
|---|---|---|
| See my volumes and their size | docker volume ls, docker system df -v | Read the list |
| See who uses a volume | docker volume inspect | See the details |
| Back up a volume | A tar command and a cron line | Back up a volume |
| Get my data back | A tar command in a helper container | Restore a volume |
| Move a volume to another server | tar, scp, then tar again | Move a volume |
| Look at the files | sudo ls /var/lib/docker/volumes/... | Open its files |
| Make a new volume | docker volume create | Create a volume |
| Delete a volume | docker volume rm | Delete a volume |
| Free up disk | docker volume prune | Remove unused |
Read the volume list
Each row shows the name, driver, size, the containers that use it, and where it is on the server. Search volumes… finds a volume by its name, driver, or stack. Use In use and Unused to filter the list.
Two marks can show next to a name:
| Mark | What it means |
|---|---|
| anonymous | Docker made it with a random name, because the container did not name one. It is harder to tell what is inside, and it cannot be backed up until you give it a name |
| stack | A Compose stack made it. If you delete it, the stack makes a new empty one at its next deploy |
Sizes can take a moment to show, because Docker has to measure each volume.
See the details of a volume
Click a row to open its details: the Summary, Used by with the path in each container, Labels, and Options. Used by is the place to check before you delete a volume. A stopped container counts as using it too.
Back up a volume
Open the container
In the Containers tab, click a container that uses the volume, then open its Volumes tab.
Click Set up
Each mount has a backup column. Click Set up to open the backup panel.
Choose where the backups go
| Choice | Where they go | Use it when |
|---|---|---|
| S3 destination | Your S3 bucket | Almost always. Your data is safe if the server dies |
| Volume backup | This same server | You want quick local copies. If you lose this server, you also lose these backups |
For S3, pick a saved destination, or click + Add destination and click Test connection. The fields are the same as in the Backup tab, and destinations are shared between the two.
Choose when and how many
- Scheduler: from every minute to every year, or custom with a cron expression. Once a day is enough for most data. Times use the time zone of the server, and the panel shows the next run.
- Keep last backups: how many copies to keep, from 1 to 1000. Older ones go only after a new backup succeeds.
- Stop container: stops the containers that use the volume during the backup, then starts them again.
- Backup prefix (optional): added to the start of each file name, such as
daily-.
Create and test it
Click Create, then click Start backup to make the first one now. Do not wait for the schedule to find out if it works.
CtrlOps may ask to install rclone or cron on the server first. Backups run on the server, so they keep running while CtrlOps is closed.
Once a volume has a backup, its cell shows the schedule and a colored dot. Click it to see Last run, Restore points, and Runs. To get a message when a backup fails, turn on the Backup failed or late alert in the Alerts tab.
Back up the volumes of a new stack
When you create a container or deploy a Compose stack, the Container stack table has a backup column. Click Set up to open Volumes to back up, then tick Enable backup for this volume. Bind folders are set up from the Volumes tab of the container instead.
Restore a volume
Open the backup panel
Open the container, go to its Volumes tab, and click the backup cell of the volume. If the container is gone, see Restore when the container is gone.
Pick a restore point
Restore points lists every backup with its time and size. Click Restore… on the one you want. You can also Download it to your computer.
Choose where it goes
| Option | What happens | Use it when |
|---|---|---|
| Restore to the volume | The current data is replaced. Containers stop during the restore and start again after it | You want to go back to that backup |
| Restore to a new volume | The backup goes into a new volume. Nothing else changes | You want to look at old data first, or copy one file back |
Confirm
Type the volume name and click Restore. For a restore over the current volume, each step shows as it runs: get the backup, check it, stop the containers, copy the current data, empty the volume, restore the backup, and start the containers.
A new volume is not attached to anything. To use it, add it to a container or name it in a compose file.
Restore when the container is gone
Click Restore from a destination… at the top of the Volumes tab. Pick the Destination, the Server, the Volume or folder, and the Restore point. If the volume no longer exists, CtrlOps makes it.
This works for backups in S3 destinations saved on this device.
Move a volume to another server
- On the first server, back up the volume to an S3 destination, and click Start backup.
- Connect to the second server and open its Volumes tab.
- Click Restore from a destination…, pick the first server, the volume, and the backup.
- Start your container on the new server with that volume.
Open the files in a volume
Click the folder icon (Open in File Manager) on the row to go to the folder of the volume in the File Manager. This works for volumes that use the local driver.
Create a volume
You rarely need this. When you create a container and type a new name under Volume mounts, such as app-data:/data, Docker makes the volume for you.
To make one first, click Create volume, type a Name, and leave the Driver on local unless you use a volume plugin. Driver options and Labels are optional. Do not put secrets in Driver options, because anyone who can run Docker can read them.
Delete a volume
Click the bin icon (Delete) on the row and type the name of the volume to confirm.
If a container uses the volume, Delete is off and names the container. Delete or change that container first.
Remove unused volumes
Click Remove unused to see the volumes no container uses. Each shows its size, or size unknown if Docker has not measured it. Anonymous volumes are ticked for you, and named volumes are not, because a name usually means someone wanted to keep that data.
Tick what you want gone, and type delete and the number you ticked, such as delete 2, to confirm. Before you tick a named volume, ask yourself if its container was just deleted and you plan to bring it back.
Tips
- Name your volumes.
billing-db-datatells you what is inside, and only named volumes can be backed up. - Back up to S3, not to the same server. A backup on the same server is gone when the server is gone.
- Test a restore once, to a new volume. A backup you have never restored is a backup you only hope works.
Troubleshooting
Most failures show Show details with the Likely cause, Retry where it helps, and Copy report. Send that report with any support question.
Give the volume a name first. A recreate gives an anonymous volume a new name.
An anonymous volume cannot be backed up, because its name changes when the container is recreated. Change the mount to a named volume, then recreate the container.
tmpfs data is in memory only. CtrlOps cannot make a backup of it.
A tmpfs mount keeps its files in memory, and they are gone when the container stops. Use a volume for data you want to keep.
A backup stopped 1 container and did not start it.
A backup with Stop container ended before it could start the container again, for example when the server restarted. Click Start it.
The schedule of this backup is not in the crontab.
Someone or something removed the cron line. Click Repair to put it back. If the message is The crontab has a backup schedule, but the backup is not on the server., click Remove.
Another device made this backup.
The S3 keys are saved on the computer that made it. To change the backup here, add the same destination with its keys on this computer.
There is not enough free disk space.
The message says how much CtrlOps needs. A restore needs room for the backup, and for the copy of the current data. Use Prune System to free some, then try again.
The restore failed. CtrlOps put the current data back.
Your data is as it was before the restore. Open Show details to read why it failed. If the message says CtrlOps could not put the data back, it names the folder that holds the copy.
You need sudo to open this folder.
The folder of a volume belongs to root. Connect with a login that has sudo rights, and type the password when CtrlOps asks. Volumes on other drivers cannot open in the File Manager.
Docker did not send the volume sizes in 60 seconds.
Measuring sizes is slow on a server with many volumes or files. Click Refresh to read them again. The rest of the list still works.
Docker does not have this volume driver.
Install the volume plugin on the server, or choose the local driver.
Frequently Asked Questions
Does deleting a container delete its volume?
A named volume stays on the server when you delete its container. An anonymous volume goes only if you tick Also remove anonymous volumes. A volume is removed only when you delete it yourself or remove it as unused.
Where do I set up a volume backup?
Not in the Volumes tab. Open a container that uses the volume, go to its Volumes tab, and click Set up in the backup column. You can also set up backups in the Container stack table when you create a container or deploy a Compose stack.
Does CtrlOps have to be open for a backup to run?
No. A scheduled backup runs on the server through cron, so it runs while CtrlOps and your computer are off.
Is it safe to back up a running database?
A copy of a running database can be broken, so turn on Stop container. CtrlOps turns it on by default for a database volume. The container stops during the backup, and CtrlOps starts it again afterwards.
How do I move a volume to another server?
Back it up to S3 on the first server. Connect to the second server, open the Volumes tab, click Restore from a destination…, and pick the backup. CtrlOps makes the volume if it is not there.
How are volume backups different from the Backup tab?
Volume backups are for Docker volumes and bind folders of a container, and they can stop the container during the backup. The Backup tab is for any folder on the server. Both use the same destinations, and volume backups also show in the Backup tab with a Docker tag.
