Step 4: Access Your Application

Once deployed, your application is accessible through the dstack gateway.

Find Your Application URL

  1. In the dashboard, click on your deployment
  2. Look for the “Endpoints” section
  3. You’ll see URLs like:
    • Internal: http://cvm-abc123.local:8080
    • External: https://my-first-app.app.example.com

Test Your Application

# Test the application
curl https://my-first-app.app.example.com

# Expected response:
{
  "message": "Hello from dstack! 🔒",
  "secure": "Running in a Trusted Execution Environment",
  "hostname": "cvm-abc123",
  "environment": "production"
}

Additional Access Methods

Gateway URL Patterns

Beyond basic URLs, the gateway supports multiple patterns:
  • <app-id>.<base_domain> → port 80
  • <app-id>s.<base_domain> → port 443 (TLS passthrough)
  • <app-id>-<port>.<base_domain> → custom port
  • <app-id>-<port>s.<base_domain> → custom port with TLS passthrough

Programmatic Access via SDKs

Interact with dstack services programmatically: JavaScript/TypeScript:
import { DstackClient } from '@dstack/sdk'
const client = new DstackClient()
const key = await client.getKey('/path', 'purpose')
Python:
from dstack_sdk import DstackClient
client = DstackClient()
key = client.get_key('/path', 'purpose')
Go:
client := dstack.NewClient()
key, err := client.GetKey("/path", "purpose")

Direct CVM Access

SSH into CVM (development images only):
ssh root@<wireguard-ip>  # Get IP from gateway dashboard
Unix Socket Communication:
# Mount socket in docker-compose.yaml
volumes:
  - /var/run/dstack.sock:/var/run/dstack.sock

Management Dashboards

  • VMM Dashboard: http://localhost:9080 - deployment management
  • Gateway Dashboard: Monitor CVM connections and WireGuard status
  • Container Logs: HTTP endpoints with filtering options

Log Access

# Via VMM CLI
python3 vmm-cli.py logs <vm_id> --follow

# Via HTTP API
curl http://localhost:8080/logs?id=<vm_id>&follow=true