Welcome to Morph Cloud
Morph Cloud's Infinibranch technology lets you snapshot, branch, and restore entire computational environments in under 250ms. With this technology, you can now parallelize and time travel between VM states, unlocking entirely new patterns for developing, testing, and debugging. The age of linear computing is behind us.
Get early access here!
How are we different?
Feature | Traditional VM Infrastructure | Infinibranch |
---|---|---|
Startup Times | 2-3 minutes for typical VMs | <250ms |
Copying | Full clone required, consuming equal resources | Near-zero overhead branching |
Branching | Not natively supported | Native support for unlimited parallel branches |
State Management | Manual snapshots and restores | Instant snapshots and restores at any point |
Remote Desktop | No built-in support | Built-in browser-based access |
Quick Start (5 minutes)
Prerequisites
Set up your Morph-enabled environment:
# Python developers
curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv package manager
source ~/.local/bin/env
uv venv && source .venv/bin/activate # Create virtual environment
uv pip install morphcloud # Install SDK
# TypeScript developers
npm install morphcloud
# Set your API key (get it from cloud.morph.so)
export MORPH_API_KEY='your-api-key-here'
Your First Morph Environment
Create a VM that boots in milliseconds and branches efficiently. Choose your preferred language below and save as tutorial.[sh|py|ts]
:
- Python
- CLI (bash)
- TypeScript
# simple_tutorial.py
from morphcloud.api import MorphCloudClient
import sys
def main():
# Set number of instances from args (default: 2)
num_instances = 2
if len(sys.argv) > 1 and sys.argv[1].isdigit():
num_instances = min(int(sys.argv[1]), 5)
client = MorphCloudClient()
print("Creating initial snapshot...")
snapshot = client.snapshots.create(
image_id="morphvm-minimal",
vcpus=1,
memory=128,
disk_size=700
)
print(f"✓ Created snapshot: {snapshot.id}")
print("Starting base instance...")
base_instance = client.instances.start(snapshot.id)
print(f"✓ Started instance: {base_instance.id}")
# Set up HTML content for base instance
print("Setting up web server...")
with base_instance.ssh() as ssh:
# Install Python and tmux
ssh.run("curl -LsSf https://astral.sh/uv/install.sh | sh").raise_on_error()
ssh.run("source ~/.local/bin/env && uv python install").raise_on_error()
ssh.run("apt-get update && apt-get install -y tmux").raise_on_error()
# Create simple HTML file
ssh.run("echo '<html><body style=\"font-family:sans-serif;max-width:800px;margin:40px auto;\">" +
f"<h1>Instance 1 of {num_instances}</h1>" +
"<p>This instance was created with Morph Cloud</p>" +
"</body></html>' > /root/index.html")
# Start simple HTTP server in tmux
ssh.run("tmux new-session -d -s webserver 'uv run python -m http.server 8080 --bind 0.0.0.0 --directory /root'")
print("✓ Server started in tmux session 'webserver'")
base_instance.expose_http_service("web", 8080)
base_url = f"https://web-{base_instance.id.replace('_', '-')}.http.cloud.morph.so"
print(f"✓ Base instance running at: {base_url}")
# Create a snapshot with web server already running
print("\nCreating snapshot of configured instance...")
configured_snapshot = base_instance.snapshot()
print(f"✓ Created snapshot: {configured_snapshot.id}")
# Create additional instances from the snapshot
instances = [base_instance]
for i in range(2, num_instances + 1):
print(f"\nStarting instance {i}...")
instance = client.instances.start(configured_snapshot.id)
print(f"✓ Started instance: {instance.id}")
# Only update the HTML to show different instance number
with instance.ssh() as ssh:
ssh.run("echo '<html><body style=\"font-family:sans-serif;max-width:800px;margin:40px auto;\">" +
f"<h1>Instance {i} of {num_instances}</h1>" +
"<p>This instance was created with Morph Cloud</p>" +
"</body></html>' > /root/index.html")
# The HTTP service is already exposed from the snapshot
url = f"https://web-{instance.id.replace('_', '-')}.http.cloud.morph.so"
instances.append(instance)
print(f"✓ Instance {i} running at: {url}")
# Print summary of all instances
print("\nAll instances are now running! Visit each URL to see they're all unique:")
for i, instance in enumerate(instances, 1):
url = f"https://web-{instance.id.replace('_', '-')}.http.cloud.morph.so"
print(f" Instance {i}: {url}")
print("\nThe instances will remain running until you stop them with:")
for instance in instances:
print(f" morphcloud instance stop {instance.id}")
if __name__ == "__main__":
main()
Then, run the code:
python tutorial.py
#!/bin/bash
# simple_tutorial.sh
# Get number of instances (default: 2)
NUM_INSTANCES=${1:-2}
if [ $NUM_INSTANCES -gt 5 ]; then
NUM_INSTANCES=5
fi
echo "Creating initial snapshot..."
SNAPSHOT=$(morphcloud snapshot create --image-id=morphvm-minimal --vcpus=1 --memory=128 --disk-size=700)
echo "✓ Created snapshot: $SNAPSHOT"
echo "Starting base instance..."
BASE_INSTANCE=$(morphcloud instance start $SNAPSHOT)
echo "✓ Started instance: $BASE_INSTANCE"
echo "Setting up web server..."
morphcloud instance exec $BASE_INSTANCE "curl -LsSf https://astral.sh/uv/install.sh | sh"
morphcloud instance exec $BASE_INSTANCE "source ~/.local/bin/env && uv python install"
morphcloud instance exec $BASE_INSTANCE "apt-get update && apt-get install -y tmux"
# Create HTML for base instance
morphcloud instance exec $BASE_INSTANCE "echo '<html><body style=\"font-family:sans-serif;max-width:800px;margin:40px auto;\">
<h1>Instance 1 of $NUM_INSTANCES</h1>
<p>This instance was created with Morph Cloud</p>
</body></html>' > /root/index.html"
# Start HTTP server using tmux
morphcloud instance ssh $BASE_INSTANCE "tmux new-session -d -s webserver 'uv run python -m http.server 8080 --bind 0.0.0.0 --directory /root'"
echo "✓ Server started in tmux session 'webserver'"
morphcloud instance expose-http $BASE_INSTANCE web 8080
BASE_URL="https://web-${BASE_INSTANCE//_/-}.http.cloud.morph.so"
echo "✓ Base instance running at: $BASE_URL"
echo -e "\nCreating snapshot of configured instance..."
CONFIGURED_SNAPSHOT=$(morphcloud instance snapshot $BASE_INSTANCE)
echo "✓ Created snapshot: $CONFIGURED_SNAPSHOT"
# Create additional instances
INSTANCES=($BASE_INSTANCE)
for (( i=2; i<=$NUM_INSTANCES; i++ )); do
echo -e "\nStarting instance $i..."
INSTANCE=$(morphcloud instance start $CONFIGURED_SNAPSHOT)
echo "✓ Started instance: $INSTANCE"
# Only update HTML to show different instance number
morphcloud instance exec $INSTANCE "echo '<html><body style=\"font-family:sans-serif;max-width:800px;margin:40px auto;\">
<h1>Instance $i of $NUM_INSTANCES</h1>
<p>This instance was created with Morph Cloud</p>
</body></html>' > /root/index.html"
# The HTTP service is already exposed from the snapshot
URL="https://web-${INSTANCE//_/-}.http.cloud.morph.so"
INSTANCES+=($INSTANCE)
echo "✓ Instance $i running at: $URL"
done
# Print summary
echo -e "\nAll instances are now running! Visit each URL to see they're all unique:"
for (( i=0; i<${#INSTANCES[@]}; i++ )); do
INSTANCE=${INSTANCES[$i]}
NUM=$((i+1))
URL="https://web-${INSTANCE//_/-}.http.cloud.morph.so"
echo " Instance $NUM: $URL"
done
echo -e "\nThe instances will remain running until you stop them with:"
for INSTANCE in "${INSTANCES[@]}"; do
echo " morphcloud instance stop $INSTANCE"
done
Then, run the code:
bash tutorial.sh
// simple_tutorial.ts
import { MorphCloudClient } from 'morphcloud';
async function main() {
// Get number of instances from args
const numInstances = process.argv.length > 2 ?
Math.min(parseInt(process.argv[2]), 5) : 2;
// Initialize the client with API key from environment variable
const client = new MorphCloudClient({
apiKey: process.env.MORPH_API_KEY
});
console.log("Creating initial snapshot...");
const snapshot = await client.snapshots.create({
imageId: "morphvm-minimal",
vcpus: 1,
memory: 128,
diskSize: 700
});
console.log(`✓ Created snapshot: ${snapshot.id}`);
console.log("Starting base instance...");
const baseInstance = await client.instances.start({
snapshotId: snapshot.id
});
console.log(`✓ Started instance: ${baseInstance.id}`);
// Wait for instance to be ready
await baseInstance.waitUntilReady(10);
console.log("Setting up web server...");
const ssh = await baseInstance.ssh();
await ssh.execCommand("curl -LsSf https://astral.sh/uv/install.sh | sh");
await ssh.execCommand("source ~/.local/bin/env && uv python install");
await ssh.execCommand("apt-get update && apt-get install -y tmux");
// Create HTML for base instance
await ssh.execCommand(`echo '<html><body style="font-family:sans-serif;max-width:800px;margin:40px auto;">
<h1>Instance 1 of ${numInstances}</h1>
<p>This instance was created with Morph Cloud</p>
</body></html>' > /root/index.html`);
// Start HTTP server using tmux with uv run python
await ssh.execCommand("tmux new-session -d -s webserver 'uv run python -m http.server 8080 --bind 0.0.0.0 --directory /root'");
console.log("✓ Server started in tmux session 'webserver'");
await ssh.dispose();
await baseInstance.exposeHttpService("web", 8080);
const baseUrl = `https://web-${baseInstance.id.replace(/_/g, '-')}.http.cloud.morph.so`;
console.log(`✓ Base instance running at: ${baseUrl}`);
console.log("\nCreating snapshot of configured instance...");
const configuredSnapshot = await baseInstance.snapshot();
console.log(`✓ Created snapshot: ${configuredSnapshot.id}`);
// Create additional instances
const instances = [baseInstance];
for (let i = 2; i <= numInstances; i++) {
console.log(`\nStarting instance ${i}...`);
const instance = await client.instances.start({
snapshotId: configuredSnapshot.id
});
console.log(`✓ Started instance: ${instance.id}`);
// Wait for instance to be ready
await instance.waitUntilReady(10);
// Only update HTML to show different instance number
const instanceSsh = await instance.ssh();
await instanceSsh.execCommand(`echo '<html><body style="font-family:sans-serif;max-width:800px;margin:40px auto;">
<h1>Instance ${i} of ${numInstances}</h1>
<p>This instance was created with Morph Cloud</p>
</body></html>' > /root/index.html`);
instanceSsh.dispose();
// The HTTP service is already exposed from the snapshot
const url = `https://web-${instance.id.replace(/_/g, '-')}.http.cloud.morph.so`;
instances.push(instance);
console.log(`✓ Instance ${i} running at: ${url}`);
}
// Print summary
console.log("\nAll instances are now running! Visit each URL to see they're all unique:");
instances.forEach((instance, i) => {
const url = `https://web-${instance.id.replace(/_/g, '-')}.http.cloud.morph.so`;
console.log(` Instance ${i+1}: ${url}`);
});
console.log("\nThe instances will remain running until you stop them with:");
instances.forEach(instance => {
console.log(` morphcloud instance stop ${instance.id}`);
});
}
main().catch(error => {
console.error('Error:', error);
process.exit(1);
});
Then, run the code:
ts-node tutorial.ts
Understanding What Happened
In this simple tutorial, you've experienced the core capabilities of Morph Cloud:
- Created a base VM with minimal configuration
- Installed Python and set up a web server
- Created a snapshot that preserves the entire running state
- Created multiple instances from this snapshot, each starting in under 250ms
- Customized each instance with its own unique content
- Exposed HTTP endpoints so you can see each instance running independently
The key innovation here is the Infinibranch snapshot - every byte of memory, every running process, and every system state is preserved perfectly. When you create new instances from this snapshot, they boot almost instantly and have full isolation from each other. This ability to create thousands of perfectly isolated copies instantly enables entirely new development patterns - whether you're running AI agents in parallel, managing deployment environments, or debugging complex system states.
Next Steps
See what Morph Cloud can do:
- Never Lose a CI Bug Again - Transform CI debugging with instant state capture
- 50x Faster AI Agent Evaluations - Accelerate AI agent development
- The Next Evolution in Computing - Our vision for cloud infrastructure
Real-World Applications
- CI/CD Debugging: Access the exact state of any failure instantly
- Agent Development: Enable agents to explore thousands of parallel paths with minimal overhead
- Development Environments: Create staging environments that mirror production perfectly
- Testing at Scale: Generate and validate thousands of test cases efficiently
Start Building
Check out our API documentation
Explore our SDKs (Python • TypeScript) and repositories
Read our blog
Follow us on Twitter/X to stay up to date with our latest releases