Skip to main content
To run a process 24/7, do two things:
  1. Turn off auto-stop: boat extend <id> --no-auto-stop.
  2. Run the process as an enabled systemd service, as shown below. It then comes back after any stop, resume or fork.

What comes back after a resume or fork

boat stop makes a snapshot of the file system. boat resume restores that file system. boat fork makes a new sandbox from the latest snapshot. A resume takes a few seconds, for any amount of data in the sandbox. For what a snapshot saves, restore behavior, retention, and how to look at or download a snapshot, see Snapshots. A stop and resume is the same as a server reboot:

Run an always-on service

To make a process come back after stop, resume and fork with no action from you, run it as an enabled systemd service. The unit file is under /etc, which is in the snapshot. Thus a resumed or forked sandbox starts the service by itself.
  • Restart=always also starts the process again if it crashes.
  • To check the service, run systemctl status my-app.
  • To read its logs, run journalctl -u my-app.
Run these commands inside the sandbox. Use boat ssh, the command endpoint, or the command method of the SDKs. If the service serves HTTP, expose it with host <port>. After a resume, host on the same port gives the same URL and token. Thus links that you gave out continue to work. See Public URLs.

Resume or fork

To continue earlier work, resume the sandbox. To branch earlier work, fork it. Both use the latest snapshot.

Repeatable setup

If you do not use a systemd service, start your work again after each resume or fork. Make the setup and start commands idempotent.
  • Run a short setup command normally. It must end within its timeout: 30 seconds by default, 600 at most.
  • Run a dev server or any process that does not end as a detached command. A normal command is killed at its timeout.
For command timeouts and retries, see Background commands.