Server Mode
The server coordinates the platform: it stores desired state, exposes the API, serves the web client, and answers agents. It is published as a container image:
docker pull ghcr.io/trailer-dev/server:latestThe ghcr.io/trailer-dev registry path is set at release time. Your deploymentâs registry and organization may differ. Adjust the image reference to match where your images are published.
Responsibilities
Section titled âResponsibilitiesâ- Authentication and authorization.
- Storing hosts, images, and workspaces in the database.
- Serving the REST API and the React web client.
- Accepting agent registrations and heartbeats, and answering reconciliation polls.
- Workspace access control, including forward-auth for workspace URLs.
Configuration
Section titled âConfigurationâThe server reads configuration from a YAML file (default ~/.config/trailer.dev/config.yml), overridable by CLI flags. There is no environment-variable binding for these flags. The most relevant flags for the server are:
| Flag | Default | Purpose |
|---|---|---|
--server-url, -S | http://localhost:8090 | Bind address. The host and port are parsed from this URL. |
--data-directory, -d | trailer_data | Directory for the server database. |
--config-file, -C | ~/.config/trailer.dev/config.yml | Configuration file location. |
In the published server image the entrypoint defaults to -S http://0.0.0.0:8090, which binds on all interfaces.
Minimal config.yml:
server_url: http://0.0.0.0:8090data_directory: trailer_dataA separate set of server-only settings (admin bootstrap, SMTP, backups, file storage) is read from TRAILER_* environment variables. See Environment variables for the full list, including which apply once on first start versus on every start.
Running the server
Section titled âRunning the serverâdocker run -d \ -p 8090:8090 \ ghcr.io/trailer-dev/server:latestAgent communication
Section titled âAgent communicationâAgents connect to the server over HTTP and a realtime connection. When an agent connects it registers and receives its per-host settings. It then periodically reports liveness and metrics (host, GPU, and workspace), polls for the hostâs desired state, and serves interactive sessions (logs, exec, attach, proxy) over the realtime connection.
The web client and any integrations talk to the server through its REST API.
Database
Section titled âDatabaseâThe server handles storage, auth, API routing, and migrations. The database lives under the configured data directory (trailer_data by default).
Web interface
Section titled âWeb interfaceâThe server serves the React and TypeScript web client. It provides the dashboard, host and workspace management, image building, user management, and real-time updates.
Deployment notes
Section titled âDeployment notesâ- Expose the configured port and place TLS termination in front of the server for production.
- Persist the data directory across restarts.
- Configure the
TRAILER_APP_*settings for the initial superuser and any SMTP, backup, or upload integrations.