Prerequisites
- Node.js 18+ or Bun installed
- A Phala Cloud account
Install the CLI
Install the Phala Cloud CLI globally:npx phala / bunx phala to run commands without installing.
Authenticate
The CLI supports device flow authentication—run the login command and follow the browser prompt:Deploy a Jupyter Notebook
Create adocker-compose.yml file:
dstack.sock volume mount enables your code to communicate with the TEE environment.
Deploy with a name and access token:
Access Your Notebook
Check deployment status:running, get the public URL:
my-secret-token in this example) and click Log in.
View container logs if needed:
Test TEE Functions
Once logged in, click Python 3 (ipykernel) under “Notebook” to create a new notebook. In the first cell, install the dstack SDK:Clean Up
When you’re done experimenting, delete the CVM to stop billing:phala cvms stop to pause without deleting, phala cvms start to resume, and phala cvms attestation to view the TEE attestation report.
Link Your Project for Faster Deploys
After deploying, link your local directory to the CVM so subsequent commands don’t need the CVM name:phala.toml file in your project directory:
phala.toml to version control. Once linked, commands use the CVM from phala.toml automatically:
- First deploy:
phala deploy -n my-app -c docker-compose.yml - Link:
phala link my-app - Commit
phala.tomlto your repo - Subsequent deploys: just
phala deploy
Next Steps
- Deploy a custom application with your own Docker Compose file
- Set up CI/CD for automated deployments
- Learn about TEE attestation and verification

