One command, and the copy is up in milliseconds.
Fork a machine
myapp-fork, and that name has to be free. Forking twice without naming the second one fails with name 'myapp-fork' is already taken.
With --json:
Running processes come with it
This is what separates a fork from a fresh machine. A server listening on the source machine is already listening on the fork, at the fork’s own URL, without anything starting up. The processes are the same processes on a different machine. Fork a machine running a web server and you will find it under the same PID, with the same start time, and the machine’s uptime carries on from the source machine rather than resetting to zero. So a fork skips whatever the source machine already did. Dependencies are already installed, a database is warm, and a dev server has finished compiling. There is nothing to rerun. You can fork a machine in any state, and what carries over follows from what the source machine has to give. A running source machine pauses for a fraction of a second to hand its live memory to the copy, then carries on. A hibernated source machine stays hibernated while the copy wakes from its memory image. A stopped source machine stays stopped and the copy boots fresh from the disk, since a stopped machine has only its disk left to copy. The fork itself always comes up running.After the fork
The two machines are independent from the moment of the fork. Writes on one do not reach the other. The fork gets its own 100 GB disk, copy-on-write against the source machine, so it uses close to no extra storage until it starts to differ. A fork keeps the source machine’s size. If the source machine has an egress allowlist, the fork starts with the same one.Automations start paused
Running processes come along, but automations are the exception: the fork inherits them paused. The source machine is still running them, and both machines firing the same schedule or handling the same event would do everything twice.--json carries the count as paused_automations. On the fork, run jobs lists them, and run restart <ID> starts one there. A machine created from a snapshot works the same way. See Forks and snapshots.
What to use it for
- Try something risky. Fork, break the fork, delete it. The source machine is untouched.
- Run several attempts at once. Fork three times from the same state and compare the results.
- Reproduce a bug. Fork the machine that is misbehaving and dig around in the copy.
- Hand someone a copy. Give a reviewer or an agent its own machine that already runs your app.