Before you begin
Use the v0.13 CLI and authenticate. Run workspace-management and recipe commands from your local terminal. Commands identified as running inside a workspace require its console terminal or SSH session. Replace example resource IDs with the values returned for your account. Create, update, and delete service specs from your local terminal. Inside a workspace,rig service-spec ls works, but the commands that change a spec refuse: an account spec also applies to your other workspaces, so a workspace can’t change one.
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:
Service specs create system units under
/etc/systemd/system with User=developer. Use sudo systemctl to manage the unit; the service process runs as the developer user.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:Verify and troubleshoot
Use the returned definition ID when attaching it to a workspace. After startup, inspectrig workspace logs --workspace WORKSPACE_ID; for service specs, check the installed unit with the commands above. A running VM does not prove a setup script or application completed successfully.
For failures, start with runtime logs, health checks, or resource exhaustion.
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