Before You Start
Make sure you have Docker Desktop or OrbStack started before you begin.Also, make sure you have gone through the Sign-up for Cloud Account section before continuing.
- Next.js Template
Phala Cloud Next.js Starter
This is a template for developing a Next.js-based app with boilerplate code targeting deployment on Phala Cloud and dstack. It includes the SDK by default to make integration with TEE features easier. This repo also includes a default Dockerfile and docker-compose.yml for deployment.Requirements
Development
First, you need to clone this repo:/api/tdx_quote: Thereportdataistestand generates the quote for attestation report viagetQuoteAPI./api/tdx_quote_raw: ThereportdataisHello DStack!and generates the quote for attestation report. The difference from/api/dx_quoteis that you can see the raw textHello DStack!in Attestation Explorer./api/eth_account/address: Using thegetKeyAPI to generate a deterministic wallet for Ethereum, a.k.a. a wallet held by the TEE instance./api/solana_account/address: Using thegetKeyAPI to generate a deterministic wallet for Solana, a.k.a. a wallet held by the TEE instance.
/api/info: Returns the TCB Info of the hosted CVM.
Build and Publish to Docker Registry
You need to build the image and push it to DockerHub for deployment. The following instructions are for publishing to a public registry via DockerHub:For this to be logged into Docker to push to registry. Run docker login to login in the CLI.
Build and Publish with Docker CLI
Deploy to Phala Cloud
You can copy and paste thedocker-compose.yml file from this repo to see the example up and running.
Deploy in Phala UI
Go to your Phala Cloud dashboard and click Deploy. You will have an option for deploying via docker compose file. Click on this option to deploy.
<docker-username>with your own:

Docker Compose Example
Deploy via Phala Cloud CLI
For those using the CLI, you can deploy from the terminal with:Make sure to change the
image field to match your published docker image (ex: 0xii/my-app:latest)Interact with Your Next.js App in Phala Cloud
Your application should be deployed now to your Phala Cloud dashboard. Go to the Network tab to be able to open your application.

Python Template
Phala Cloud Python Starter
This is a template for developing a FastAPI-based app with boilerplate code targeting deployment on Phala Cloud and dstack. It includes the SDK by default to make integration with TEE features easier. This repo also includes a default Dockerfile and docker-compose.yml for deployment.Development
In this tutorial, we’ll start with venv and pip. First, you need to clone this repo:test.Build and Publish with Docker CLI
Deploy to Phala Cloud
You can copy and paste thedocker-compose.yml file from this repo to see the example up and running.Deploy in Phala UI
Go to your Phala Cloud dashboard and click Deploy. You will have an option for deploying via docker compose file. Click on this option to deploy.
<docker-username>with your own:


/tdx_quote

/derive_key

