How Service Specs Work
When you attach a service spec to a workspace, Rigbox generates a systemd service unit file inside the VM:- Unit name:
rigbox-svc-{name}.service - Runs as: the
developeruser - Working directory:
/home/developer - Environment: variables you define in
env_vars, plus any workspace-level environment
auto_enable is set to true, the service starts automatically when the workspace boots - after setup scripts have finished.
Create a Service Spec
Define a service spec in a YAML file with the command to run, environment variables, and restart behavior, then create it with the CLI.Service Spec Fields
Restart Policies
Attach to a Workspace
Pass--service-spec-id (repeatable) when spawning a workspace.
auto_enable: true start automatically after boot and setup scripts complete.
Manage Services Inside the Workspace
Once inside the workspace VM, you can manage services using standardsystemctl commands:
Services run under the
developer user’s systemd instance, so use systemctl --user (not sudo systemctl).List Your Service Specs
Update a Service Spec
Delete a Service Spec
Combining with Setup Scripts
A common pattern is to use a setup script to install dependencies and a service spec to run the application. The setup script runs first, so your service spec can assume everything is installed. Step 1 - Create a setup script that installs dependencies:- Setup scripts run (install dependencies, build the app)
- Service specs with
auto_enable: truestart (launch the server)
Combining with Apps
To expose a service spec’s port to the internet, create an app that maps to the service’s port.<APP_NAME>.rigbox.dev that routes to port 3000 inside the workspace where your service spec is running.
Example: Full-Stack Application
Here is a complete example that sets up a React frontend and Node.js backend as two separate services. Setup script - install everything:Next Steps
- Setup Scripts - automate dependency installation before services start
- Snapshots - snapshot a workspace with running services for quick restore
- Managed AI Proxy - add AI capabilities to your background services