Using Custom Domains with Sandboxes
Last updated: March 24, 2026
Currently, custom domains can be used with sandboxes. Registering a domain automatically enables wildcard subdomains.
- If you register mycompany.com, you can use any *.mycompany.com subdomain to create custom URLs.
- If you register preview.mycompany.com, you can use any *.preview.mycompany.com subdomain to create custom URLs.
- And so on.
Using Preview URLs
If you need to access your sandbox URL programmatically at a custom domain, you can use the preview feature with our SDK:
import { SandboxInstance } from "@blaxel/core";
const sandbox = await SandboxInstance.get("my-sandbox");
const preview = await sandbox.previews.create({
metadata: { name: "preview-custom-domain" },
spec: {
port: 443,
public: false,
customDomain: 'your.custom.domain.dev'
}
})This approach allows you to:
Give a specific name to your preview
Retrieve the preview later using the SDK
Access the custom domain URL from the preview specification
Notes
Custom domains require Tier 3 or higher access.
Each custom domain is uniquely assigned to a region and cannot be used across regions.
After registering a domain, you must configure DNS records and verify the domain in the Blaxel Console before it can be used.
Custom domains currently only work for sandbox previews.