Expose VM ports as public URLs or custom domains

shares.create(port=3000) gives you a URL. shares.update(is_public=True) makes it public. custom_domains.create() attaches your domain with automatic DNS verification.

1 API call

Port to URL

Public / private

Toggle

Auto DNS

Custom domains

shares & deploy

$client.shares.create(vm_id='vm_4a21', port=3000, is_public=False)

share_url: https://shr-991a.instavm.run (private)

$client.shares.update(share_id='shr_991a', is_public=True)

share is now public

$client.custom_domains.create(domain='app.example.com', ...)

cname_target: shr-991a.cdn.instavm.run

$client.custom_domains.verify(domain_id=...)

#dns verified | tls provisioned

$

Capabilities

shares.create(port, is_public)

Expose any listening port on the VM. Returns a share_id and URL. Private shares require an access_token header.

shares.update(is_public=True)

Flip a share from private to public with one call. Revoke access with revoke=True. No infrastructure changes needed.

custom_domains.create()

Attach a domain to a share. Supports Cloudflare and Route 53 for auto-DNS. Verify with custom_domains.verify() and check health().

OCI-backed deploy path

Combine with snapshots.create() to build from a Docker image, boot a VM, start your app, and share it — all through the SDK.

SDK reference

shares-deploy.py
pythonShare + domain
1from instavm import InstaVM
2
3client = InstaVM(api_key="sk_instavm_...")
4
5# Boot from snapshot with your app
6vm = client.vms.create(wait=True, snapshot_id="snap_abc123")
7
8# Expose port 3000 as a private URL
9share = client.shares.create(
10 vm_id=vm["vm_id"], port=3000, is_public=False
11)
12print(share["share_url"]) # Private, needs access_token
13
14# Make it public
15client.shares.update(share_id=share["share_id"], is_public=True)
16
17# Attach a custom domain
18domain = client.custom_domains.create(
19 domain="app.example.com",
20 share_id=share["share_id"],
21 dns_provider="cloudflare",
22 dns_credentials={"api_token": "cf_..."},
23)
24client.custom_domains.verify(domain_id=domain["domain_id"])

How it works

Port, share, domain — three API calls

01

Start your app in a VM

Boot from a snapshot or run setup commands. Start your server on any port. The VM has full Linux — npm start, python app.py, whatever.

02

Create a share

shares.create(vm_id=..., port=3000, is_public=False) returns a URL and access_token. Share privately for review first.

03

Go public or attach a domain

shares.update(is_public=True) opens it up. custom_domains.create(domain='app.example.com', share_id=...) routes your domain.

Get started with InstaVM

Free tier available. No credit card required. VMs provision in under 200ms.

We use cookies
We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking Accept, you agree to our use of cookies.

Learn more