Skip to content
Dashboard

Services

Services describe processes that SnapVM should manage for a machine. They are the right place for anything that should survive browser disconnects and restart after the machine wakes.

Create a service when a process is part of the workspace, not just a one-off command.

Common examples:

  • A web server on port 8080
  • A local database or queue
  • A background worker
  • A file watcher
  • An AI agent process
  • A language server or project-specific daemon

A service definition usually includes:

FieldPurpose
NameStable identifier shown in the console
CommandExecutable to run
ArgumentsParameters passed to the command
Working directoryDirectory where the process starts
EnvironmentVariables needed by the process
HTTP portPort the gateway should expose, when applicable
DependenciesOther services that should start first

Services can be created, updated, started, stopped, restarted, and deleted. Runtime state can include PID, uptime, exit status, and restart count depending on the deployment.

When a machine hibernates, processes stop with the runtime. When the machine wakes, service definitions let SnapVM restart the expected processes in a predictable way.

  • Keep commands explicit so the service can start without shell history or interactive prompts.
  • Prefer project-local scripts such as npm run dev or bin/server over long one-off commands.
  • Store secrets in the deployment’s supported secret mechanism, not in documentation or committed service definitions.
  • Use health checks or logs to verify that the service started cleanly.
  • Keep ports stable so the gateway and teammates know where to reach the app.