Admin Guide¶
This guide covers setting up and managing devbox infrastructure — server pools, user isolation, resource limits, and monitoring.
Prerequisites¶
- One or more Linux servers (Ubuntu 22.04+ recommended)
- Root or sudo access on each server
- Tailscale account with the servers on your tailnet
Server Setup¶
1. Install Docker¶
On each server:
2. Install Tailscale¶
Verify the server appears in your Tailscale admin console.
3. Configure SSH¶
Ensure users can SSH into the server via Tailscale IP:
Users will configure their local ~/.ssh/config to connect:
4. Add users to the docker group¶
Each user who will create workspaces needs docker access:
5. Verify with devbox doctor¶
From a client machine:
This checks: SSH connectivity, Docker availability, Tailscale status, git, and disk space.
Server Pool Management¶
devbox supports multiple servers for distributing workspaces.
Add servers¶
devbox server add dev1 100.64.0.1
devbox server add dev2 100.64.0.2
devbox server add gpu-box 100.64.0.10
List servers¶
Shows each server with its health status, number of running workspaces, and resource usage.
Remove servers¶
Warning
Removing a server does not destroy workspaces running on it. Migrate or destroy workspaces first.
Automatic server selection¶
When users run devbox up without specifying a server, devbox uses a least-loaded selection algorithm:
- Queries all servers in the pool
- Checks resource availability (CPU, memory, disk)
- Selects the server with the most headroom
Users can override with devbox up --server dev2.
User Isolation¶
devbox automatically isolates workspaces per user.
How identity works¶
- devbox resolves the user's identity from their Tailscale login (e.g.,
alice@example.com→alice) - Fallback: the
DEVBOX_USERenvironment variable - Workspace names are scoped:
{user}-{project}-{branch}
This means two users can run devbox up in the same project without conflicts — each gets their own workspace.
Resource limits¶
Configure per-workspace resource limits to prevent any single workspace from consuming all server resources:
These map directly to Docker's --cpus and --memory flags.
Monitoring¶
Per-workspace metrics¶
Shows:
- CPU — usage percentage and allocated cores
- Memory — used vs. allocated
- Disk — volume size
- Network I/O — bytes in/out
All workspaces¶
Interactive dashboard¶
The TUI dashboard shows all workspaces across all servers with live status, logs, and resource indicators.
CI/CD Preview Workspaces¶
devbox integrates with GitHub Actions to create temporary workspaces for pull requests.
Setup¶
-
Add the preview workflow to your repository:
# .github/workflows/preview.yml name: PR Preview on: pull_request: types: [opened, synchronize, reopened, closed] permissions: pull-requests: write statuses: write jobs: preview-up: if: github.event.action != 'closed' runs-on: ubuntu-latest steps: - uses: junixlabs/devbox-preview@v1 with: action: up server: ${{ secrets.DEVBOX_SERVER }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} preview-down: if: github.event.action == 'closed' runs-on: ubuntu-latest steps: - uses: junixlabs/devbox-preview@v1 with: action: down server: ${{ secrets.DEVBOX_SERVER }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -
Set
DEVBOX_SERVERas a repository secret with the server hostname or Tailscale IP.
How it works¶
- On PR open/update:
devbox ci preview-upcreates a workspace for the PR - On PR close/merge:
devbox ci preview-downdestroys it - A commit status check links to the preview workspace
Backup and Recovery¶
Snapshots¶
Regularly snapshot important workspaces:
Snapshots are stored as compressed tar archives of Docker volumes.
Restore¶
Security Considerations¶
- Tailscale ACLs: Use Tailscale ACLs to control which users can reach which servers
- Docker group: Only add trusted users to the docker group — docker access is effectively root access
- SSH keys: Use SSH key authentication, disable password auth
- Resource limits: Always set resource limits to prevent resource exhaustion
Next Steps¶
- Configuration Reference — all
devbox.yamlfields - Plugin API — extend devbox with custom providers
- Troubleshooting — common issues and fixes