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://gray-ocean-lab.instavm.site (private)

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

public_url: https://apple-river-signal.instavm.site

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

cname_target: edge.instavm.site

$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)
16public_share = client.shares.create(vm_id=vm["vm_id"], port=3000, is_public=True)
17print(public_share.get("public_url") or public_share.get("share_url")) # https://apple-river-signal.instavm.site
18
19# Attach a custom domain
20domain = client.custom_domains.create(
21 domain="app.example.com",
22 share_id=share["share_id"],
23 dns_provider="cloudflare",
24 dns_credentials={"api_token": "cf_..."},
25)
26client.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 to improve your experience. See our cookie policy.