Needs dstack OS 0.6.3 or newer. dstack OS 0.5.x does not support it. See Requirements for the CLI and SDK versions.
How it works
The setting is one field in your app compose:true, the CVM sets its data disk up again as a new, empty encrypted disk at the start of every boot. Docker starts only after that.
It is the same data disk, with the size you chose. No extra disk is added.
What is wiped
Everything on the data disk:- Container images
- Containers and the files they wrote
- Docker volumes, including named volumes
- Any other file your app saved, such as model weights, caches and databases
What stays
These are not stored on the data disk, so they stay the same:- Your compose and the rest of the CVM’s settings
- Your encrypted environment variables. The CVM gets them again on every boot.
- Your app ID and the keys your app gets from the KMS. The CVM asks for them on every boot and gets the same ones.
When the wipe happens
On every boot. A boot happens when:- you restart the CVM
- you stop the CVM and start it again
- you update the CVM, because an update restarts it
- you change any other setting that restarts the CVM
- the CVM restarts on its own, for example after a crash or after maintenance on the node
Requirements
dstack OS 0.5.x does not support the setting. Neither do 0.6.0, 0.6.1 and 0.6.2. If you send it for a CVM on one of these, the request is rejected with
ERR-03-018.
One thing depends on the API version when you read the setting back. From API version 2026-11-11, GET /cvms/{cvm_id} leaves out compose_file unless you add include_compose=true to the request. See API versioning.
Turn it on for a new CVM
A new CVM has no data yet, so you do not need to confirm anything.Dashboard
- Open Deploy in your workspace.
- Go to step 2, Compute.
- Scroll down to the Ephemeral data disk card and turn on Wipe the data disk on every boot.

The Ephemeral data disk card in the Compute step
app-compose.json shown there has ephemeral_data_disk set to true under requirements.
CLI
Add--ephemeral-data-disk to phala deploy:
API and SDKs
Set the field incompose_file.requirements on the create request (POST /cvms):
true without quotes. The text "true" is rejected with a 422 validation error.
The SDKs send the same field. Put it in the requirements of the compose file you pass when you create the CVM. With Terraform, set it in the requirements block of phala_app.
Turn it on for an existing CVM
Turning it on wipes everything on the data disk, and you cannot get it back. Copy out anything you need first.Dashboard
- Open the app.
- Go to App Settings.
- In the Ephemeral data disk card, turn on the switch on the right.
- Select Turn on in the dialog.

The Ephemeral data disk card in App Settings, turned on
CLI, API and SDKs
The request must confirm the wipe withconfirm_data_wipe. The API request is PATCH /cvms/{cvm_id}.
Errors
Wipe the disk only once
You can use the setting for a single wipe. This gives a running CVM a clean disk without creating a new CVM.- Turn it on. The CVM restarts and wipes the disk.
- Wait until the CVM is running again.
- Turn it off. The CVM restarts again. From then on the disk keeps what you write to it.
Turn it off
You do not need to confirm a wipe when you turn it off.Dashboard
- Open the app.
- Go to App Settings.
- In the Ephemeral data disk card, turn off the switch on the right.
- Select Turn off in the dialog.
CLI, API and SDKs
Send the field asnull with the same PATCH /cvms/{cvm_id} request.
Which compose hash do I get after turning it off?
It depends on what you send. The compose hash covers the wholerequirements object.
The CLI flag
--no-ephemeral-data-disk sends false.
What the wipe protects
Your app cannot read data from an earlier boot. The wipe happens before any of your code runs, so the app starts with nothing an earlier boot left behind. Putting an old disk back does not help either. Suppose the host saved a copy of the disk during an earlier boot and later put it back in place of the current disk. The CVM does not open that copy. It wipes it like any other disk. The data disk is encrypted, as on every CVM. The key comes from the KMS and is given only to your CVM. The host does not have it. The wipe has two limits:- It does not overwrite every block of the disk. It sets the disk up again as a new, empty encrypted disk.
- It does not change the disk key your CVM gets from the KMS. The same CVM gets the same key on every boot.
Compose hash and verification
The setting is part of yourapp-compose.json, so turning it on or off gives the CVM a new compose hash. Your app ID and your app’s keys do not change.
This lets other people check it. The compose hash is in the CVM’s attestation, so anyone who verifies your app can read the setting in the compose and know that every boot starts with an empty disk.
With Onchain KMS, add the new compose hash to your app contract first, as for any other update. See What changes for a CVM on Onchain KMS?
Older OS images: Clear container storage
A CVM on dstack OS 0.6.x older than 0.6.3 cannot use an ephemeral data disk. Clear container storage is the fallback for it. If your OS image is dstack OS 0.6.3 or newer, use an ephemeral data disk and skip this section. dstack OS 0.5.x supports neither. Clear container storage does less. On every boot, before Docker starts, it deletes what Docker keeps on the data disk: your images, your containers and your Docker volumes. Files your app saved outside Docker volumes stay, and the disk itself is not set up again. In the API and the CLI it is thedocker_cleanup init script.
You do not need both. An ephemeral data disk already wipes everything Clear container storage wipes.
How do I turn it on or off?
In the dashboard, open the app and go to App Settings. The Clear container storage switch sits under the Ephemeral data disk switch. It appears only if the app already has the option on, or runs dstack OS 0.6.0, 0.6.1 or 0.6.2.- You can always turn it off.
- You can turn it on only on a dstack OS older than 0.6.3. On 0.6.3 or newer, use an ephemeral data disk.
FAQ
Why is my data gone after a restart?
Because the restart was a boot, and every boot wipes the data disk. This is what the setting is for. To check whether a CVM has it, open the app’s App Settings in the dashboard and look at the Ephemeral data disk switch. Or look for"ephemeral_data_disk": true under requirements in its compose.

