v3.1.0 d676137

serve.md RawHistoryFolder

Server Commands

Commands for running and managing the Gordon server process.

gordon serve

Start the Gordon server with registry and proxy components.

Synopsis

gordon serve [options]

Options

Option Short Default Description
--config -c Auto-detected Path to configuration file

Description

Starts the Gordon server, which includes:

  • Container Registry - Receives image pushes on the registry port
  • Reverse Proxy - Routes app hosts to recorded loopback backends
  • Event Bus - Coordinates runtime notifications
  • Config Watcher - Monitors configuration file for changes

Configuration File Detection

Gordon looks for configuration in this order:

  1. Path specified with --config
  2. /etc/gordon/gordon.toml
  3. ~/.config/gordon/gordon.toml
  4. ./gordon.toml

First Run

On first run without a config file, Gordon creates a default configuration at ~/.config/gordon/gordon.toml.

# First run - creates default config
gordon serve
# Edit the config, then restart

Examples

# Basic start
gordon serve

# With custom config
gordon serve --config /path/to/gordon.toml
gordon serve -c ./my-config.toml

# With environment override
GORDON_LOGGING_LEVEL=debug gordon serve

Signals

Gordon responds to these signals:

Signal Action
SIGTERM Graceful shutdown
SIGINT Graceful shutdown (Ctrl+C)
SIGUSR1 Reload installation configuration
SIGUSR2 Reserved; no app deployment action

Running with systemd

# Create user service
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/gordon.service <<EOF
[Unit]
Description=Gordon Container Platform

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/gordon serve

[Install]
WantedBy=default.target
EOF

# Enable and start
systemctl --user daemon-reload
systemctl --user enable --now gordon
sudo loginctl enable-linger $USER

Startup Sequence

  1. Load configuration
  2. Initialize logger
  3. Create PID file
  4. Connect to Docker/Podman runtime
  5. Create storage directories
  6. Initialize services (registry, proxy, auth)
  7. Register event handlers
  8. Start config file watcher
  9. Start HTTP servers
  10. Run best-effort startup recovery (reconcile apps intended to run from active state)

Startup Recovery

After Gordon starts, including after a host reboot, it runs a best-effort recovery pass once the listeners are bound. Errors are logged, but Gordon keeps starting.

  1. Reconcile app boot state - Gordon ensures apps intended to run are running from active state (stopped-intent apps stay stopped, pending desired revisions are never activated).
  2. Start the background monitor - Ongoing crash recovery resumes after the startup pass.

Reload and startup recovery never activate pending desired app state, re-resolve images, or flip intent. They touch installation settings and runtime reconciliation only.

Shutdown Sequence

  1. Receive shutdown signal
  2. Stop accepting new requests
  3. Complete in-flight requests
  4. Stop managed containers (if configured)
  5. Remove PID file
  6. Exit

gordon version

Print version information.

Synopsis

gordon version

Output

Gordon v2.0.0
Commit: abc1234
Build Date: 2024-01-15
source
1# Server Commands
2
3Commands for running and managing the Gordon server process.
4
5## gordon serve
6
7Start the Gordon server with registry and proxy components.
8
9### Synopsis
10
11```bash
12gordon serve [options]
13```
14
15### Options
16
17| Option | Short | Default | Description |
18|--------|-------|---------|-------------|
19| `--config` | `-c` | Auto-detected | Path to configuration file |
20
21### Description
22
23Starts the Gordon server, which includes:
24
25- **Container Registry** - Receives image pushes on the registry port
26- **Reverse Proxy** - Routes app hosts to recorded loopback backends
27- **Event Bus** - Coordinates runtime notifications
28- **Config Watcher** - Monitors configuration file for changes
29
30### Configuration File Detection
31
32Gordon looks for configuration in this order:
33
341. Path specified with `--config`
352. `/etc/gordon/gordon.toml`
363. `~/.config/gordon/gordon.toml`
374. `./gordon.toml`
38
39### First Run
40
41On first run without a config file, Gordon creates a default configuration at `~/.config/gordon/gordon.toml`.
42
43```bash
44# First run - creates default config
45gordon serve
46# Edit the config, then restart
47```
48
49### Examples
50
51```bash
52# Basic start
53gordon serve
54
55# With custom config
56gordon serve --config /path/to/gordon.toml
57gordon serve -c ./my-config.toml
58
59# With environment override
60GORDON_LOGGING_LEVEL=debug gordon serve
61```
62
63### Signals
64
65Gordon responds to these signals:
66
67| Signal | Action |
68|--------|--------|
69| `SIGTERM` | Graceful shutdown |
70| `SIGINT` | Graceful shutdown (Ctrl+C) |
71| `SIGUSR1` | Reload installation configuration |
72| `SIGUSR2` | Reserved; no app deployment action |
73
74### Running with systemd
75
76```bash
77# Create user service
78mkdir -p ~/.config/systemd/user
79cat > ~/.config/systemd/user/gordon.service <<EOF
80[Unit]
81Description=Gordon Container Platform
82
83[Service]
84Type=simple
85Restart=always
86ExecStart=/usr/local/bin/gordon serve
87
88[Install]
89WantedBy=default.target
90EOF
91
92# Enable and start
93systemctl --user daemon-reload
94systemctl --user enable --now gordon
95sudo loginctl enable-linger $USER
96```
97
98### Startup Sequence
99
1001. Load configuration
1012. Initialize logger
1023. Create PID file
1034. Connect to Docker/Podman runtime
1045. Create storage directories
1056. Initialize services (registry, proxy, auth)
1067. Register event handlers
1078. Start config file watcher
1089. Start HTTP servers
10910. Run best-effort startup recovery (reconcile apps intended to run from active state)
110
111### Startup Recovery
112
113After Gordon starts, including after a host reboot, it runs a best-effort recovery pass once the listeners are bound. Errors are logged, but Gordon keeps starting.
114
1151. **Reconcile app boot state** - Gordon ensures apps intended to run are running from active state (stopped-intent apps stay stopped, pending desired revisions are never activated).
1164. **Start the background monitor** - Ongoing crash recovery resumes after the startup pass.
117
118Reload and startup recovery never activate pending desired app state, re-resolve images, or flip intent. They touch installation settings and runtime reconciliation only.
119
120### Shutdown Sequence
121
1221. Receive shutdown signal
1232. Stop accepting new requests
1243. Complete in-flight requests
1254. Stop managed containers (if configured)
1265. Remove PID file
1276. Exit
128
129---
130
131## gordon version
132
133Print version information.
134
135### Synopsis
136
137```bash
138gordon version
139```
140
141### Output
142
143```
144Gordon v2.0.0
145Commit: abc1234
146Build Date: 2024-01-15
147```
148
149## Related
150
151- [CLI Overview](./index.md)
152- [Configuration Reference](../config/index.md)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close