Devboxes for prototyping
Devboxes are ideal for prototyping because you can:
- run any stack (it’s a full VM),
- expose a live preview URL for a web app or API,
- optionally keep a devbox “always on” (persistent-VPS style) by disabling auto-sleep / TTL policies.
Expose a preview URL (CLI)
This example starts a tiny web server on port 3000 and exposes it publicly.
export MORPH_API_KEY="..."
morphcloud devbox template list
TEMPLATE_ID="<template-id>"
DEVBOX_ID=$(
morphcloud devbox start "$TEMPLATE_ID" --name "prototype" --json | jq -r '.id'
)
# Start a web server in the background
morphcloud devbox ssh "$DEVBOX_ID" bash -lc "nohup python3 -m http.server 3000 >/tmp/http.log 2>&1 &"
# Expose port 3000 as a public HTTP service URL
morphcloud devbox expose-http "$DEVBOX_ID" --name app --port 3000
Expose a preview URL (dashboard)
- Open your devbox: https://cloud.morph.so/web/devboxes
- Start your app inside the devbox (e.g.
npm run dev) - Use Live Preview / HTTP exposure to publish a shareable URL for your app/API.
Persistent VPS mode (auto-sleep off)
Devboxes can auto-pause when idle (serverless-style) while preserving memory state for instant resume.
If you want a devbox to behave like a persistent VPS (always running), disable auto-sleep / TTL policies for the devbox in the dashboard (or configure policies via API, if applicable). Keep in mind that an always-on devbox will continue consuming compute resources.