Architecture
Discover the technical architecture of tug.sh and the role of its components.
tug.sh is split into a control plane (Dashboard + API) and a data plane (Agent running on each VPS). The design keeps the server runtime lightweight while preserving real-time operations.
1. Dashboard
The dashboard (app.tug.sh) is the operator interface. It lets you:
- connect and monitor servers,
- manage projects, containers, and networks,
- stream logs and trigger deployments,
- configure routing, backups, and notification settings.
The dashboard talks only to api.tug.sh (REST + real-time WebSocket stream).
2. API Server (Go)
The API is the central orchestrator. It:
- handles authentication, authorization, and account settings,
- stores state in PostgreSQL and merges runtime snapshots from Agents,
- exposes REST endpoints used by the dashboard,
- maintains command/result channels over Agent WebSockets.
3. Agent (Go)
The Agent is a small daemon running on each VPS. It:
- initiates and keeps a persistent outbound
wss://api.tug.shconnection, - executes Docker and filesystem operations requested by the API,
- periodically sends host/container snapshots and command results.