Skip to main content

Shares & Custom Domains

Shares expose ports from a running VM to the internet. If you used instavm deploy, the CLI already created a share for you. Use the commands below when you want to manage one manually.

Create a share

instavm share create vm_abc123 3000 --public

Public vs private shares

  • Public shares are accessible by anyone with the URL.
  • Private shares require an access token or a later visibility change.
# Private share (default, no --public flag)
instavm share create vm_abc123 3000

Update or revoke a share

instavm share set-public share_def456
instavm share set-private share_def456
instavm share revoke share_def456

Custom domains

Point your own domain at a shared port for production-ready URLs.

Create a custom domain

curl -X POST https://api.instavm.io/v1/custom-domains \
-H "X-API-Key: instavm_sk_..." \
-H "Content-Type: application/json" \
-d '{"domain": "app.example.com", "share_id": "share_def456"}'

Verify DNS

Add a CNAME record pointing your domain to the provided target, then verify:

curl -X POST https://api.instavm.io/v1/custom-domains/{domain_id}/verify \
-H "X-API-Key: instavm_sk_..."

List and delete

curl https://api.instavm.io/v1/custom-domains \
-H "X-API-Key: instavm_sk_..."

curl -X DELETE https://api.instavm.io/v1/custom-domains/{domain_id} \
-H "X-API-Key: instavm_sk_..."

Use case: preview a web app

The easiest preview path is Deploy a Web App with instavm deploy. If you are working directly with the SDK, you can create the share yourself:

# The fastest path — deploys, creates VM, and shares in one step
instavm deploy --port 8080

Next steps