Server Configuration
Core server settings for Gordon.
Configuration
[server]
port = 8080 # HTTP proxy port
registry_port = 5000 # Container registry port
tls_enabled = false # Enable native TLS listener
tls_port = 443 # HTTPS listener port
tls_cert_file = "" # PEM certificate file (required when TLS enabled)
tls_key_file = "" # PEM key file (required when TLS enabled)
gordon_domain = "gordon.mydomain.com" # Gordon domain (required)
# data_dir = "~/.gordon" # Data storage directory (default)
Options
| Option |
Type |
Default |
Description |
port |
int |
80 |
HTTP proxy port for routing traffic to containers |
registry_port |
int |
5000 |
Docker registry port for image push/pull |
tls_enabled |
bool |
false |
Enable native HTTPS listener for proxy traffic |
tls_port |
int |
443 |
HTTPS listener port when tls_enabled is true |
tls_cert_file |
string |
"" |
Path to PEM certificate file |
tls_key_file |
string |
"" |
Path to PEM private key file |
gordon_domain |
string |
required |
Domain for Gordon (registry + admin API) |
registry_domain |
string |
- |
Deprecated alias for gordon_domain |
data_dir |
string |
~/.gordon |
Directory for registry data, logs, and env files |
max_proxy_body_size |
string |
"512MB" |
Maximum request body size for proxied requests |
max_blob_chunk_size |
string |
"95MB" |
Maximum request body size for a single registry blob upload chunk |
Port Configuration
Proxy Port
The port setting controls where Gordon listens for HTTP traffic:
[server]
port = 8080 # Use 8080 for rootless containers with port forwarding
For rootless containers, you'll typically use a high port and configure firewall port forwarding:
# Forward port 80 to 8080
sudo firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=8080
Native TLS Listener
Enable native HTTPS directly in Gordon:
[server]
tls_enabled = true
tls_port = 443
tls_cert_file = "/etc/gordon/certs/fullchain.pem"
tls_key_file = "/etc/gordon/certs/privkey.pem"
With TLS enabled:
- Gordon terminates HTTPS on
tls_port
- Host-based routing still works (apps,
/v2/*, /auth/*, /admin/*)
port remains available for plain HTTP unless you restrict it externally
- If
tls_cert_file/tls_key_file are empty, Gordon auto-generates a self-signed pair in {data_dir}/tls/
Registry Port
The registry_port setting controls where Gordon accepts image pushes:
[server]
registry_port = 5000
Docker/Podman clients push to this port:
docker push registry.mydomain.com:5000/myapp:latest
Gordon Domain
The gordon_domain is required and must match your DNS configuration:
[server]
gordon_domain = "gordon.mydomain.com"
This domain is used for:
- Docker login and image push/pull operations
- Admin API access (
/admin/* endpoints)
- CLI remote targeting (
gordon routes --remote https://gordon.mydomain.com)
- Authentication endpoints (
/auth/*)
When requests arrive on the proxy port with this domain as the Host header, Gordon routes them to the backend services (registry and admin API).
Note: registry_domain is supported as a deprecated alias for backwards compatibility.
Data Directory
The data_dir setting controls where Gordon stores data:
[server]
data_dir = "~/.gordon" # Default for user installations
Directory Structure
~/.gordon/
├── registry/ # Container images and manifests
│ ├── blobs/
│ └── manifests/
├── env/ # Environment files per domain
│ ├── app_mydomain_com.env
│ └── api_mydomain_com.env
├── logs/ # Application and container logs
│ ├── gordon.log
│ ├── proxy.log
│ └── containers/
└── secrets/ # Secrets (unsafe backend only)
Permissions
Gordon creates directories with secure permissions:
- Directories:
0700 (owner only)
- Files:
0600 (owner only)
Maximum Proxy Body Size
The max_proxy_body_size setting limits the size of request bodies that Gordon will forward to backend containers:
[server]
max_proxy_body_size = "512MB" # Default
Purpose: Prevents resource exhaustion attacks from extremely large uploads through the proxy.
Supported units: B, KB, MB, GB, TB (case-insensitive, decimal/1024-based)
Examples:
max_proxy_body_size = "100MB" # Stricter limit
max_proxy_body_size = "1GB" # Allow larger uploads
max_proxy_body_size = "0" # No limit (not recommended)
Behavior:
- When a request exceeds the limit, Gordon returns
413 Request Entity Too Large
- The limit is applied before the request reaches the backend container
- Uploads in progress are terminated when the limit is exceeded
Use cases:
- File upload services: increase to
1GB or higher
- CI/CD artifact uploads: adjust based on your largest artifacts
- Tight security: reduce to
100MB or lower
- Default (512MB): suitable for most applications
Warning: Setting this to 0 (no limit) allows unlimited upload sizes, which can lead to disk exhaustion and DoS vulnerabilities. Always set a reasonable limit for production deployments.
Maximum Registry Blob Chunk Size
The max_blob_chunk_size setting limits the size of a single blob upload request to the registry (PATCH/PUT under /v2/*/blobs/uploads/*):
[server]
max_blob_chunk_size = "95MB" # Default
Purpose: Prevents excessive memory usage during blob uploads while allowing large real-world image layers.
Supported units: B, KB, MB, GB, TB (case-insensitive, decimal/1024-based)
Examples:
max_blob_chunk_size = "256MB" # Stricter limit
max_blob_chunk_size = "1GB" # Allow larger layers
Behavior:
- When a blob chunk exceeds the limit, Gordon returns
413 Request Entity Too Large
- Docker/Podman may send a full layer in one request, so set this high enough for your base images
- Default (
95MB) is compatible with Cloudflare and most CDN proxies; increase if pushing very large layers directly
Examples
Development Configuration
[server]
port = 8080
registry_port = 5000
gordon_domain = "gordon.local"
data_dir = "./dev-data"
Production Configuration
[server]
port = 8080
registry_port = 5000
gordon_domain = "gordon.company.com"
data_dir = "/var/lib/gordon"
Rootless Container Setup
[server]
port = 8080 # High port for rootless
registry_port = 5000
gordon_domain = "gordon.mydomain.com"
With firewall port forwarding:
sudo firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=8080
sudo firewall-cmd --reload
source
1# Server Configuration
2
3Core server settings for Gordon.
4
5## Configuration
6
7```toml
8[server]
9port = 8080 # HTTP proxy port
10registry_port = 5000 # Container registry port
11tls_enabled = false # Enable native TLS listener
12tls_port = 443 # HTTPS listener port
13tls_cert_file = "" # PEM certificate file (required when TLS enabled)
14tls_key_file = "" # PEM key file (required when TLS enabled)
15gordon_domain = "gordon.mydomain.com" # Gordon domain (required)
16# data_dir = "~/.gordon" # Data storage directory (default)
17```
18
19## Options
20
21| Option | Type | Default | Description |
22|--------|------|---------|-------------|
23| `port` | int | `80` | HTTP proxy port for routing traffic to containers |
24| `registry_port` | int | `5000` | Docker registry port for image push/pull |
25| `tls_enabled` | bool | `false` | Enable native HTTPS listener for proxy traffic |
26| `tls_port` | int | `443` | HTTPS listener port when `tls_enabled` is true |
27| `tls_cert_file` | string | `""` | Path to PEM certificate file |
28| `tls_key_file` | string | `""` | Path to PEM private key file |
29| `gordon_domain` | string | **required** | Domain for Gordon (registry + admin API) |
30| `registry_domain` | string | - | Deprecated alias for `gordon_domain` |
31| `data_dir` | string | `~/.gordon` | Directory for registry data, logs, and env files |
32| `max_proxy_body_size` | string | `"512MB"` | Maximum request body size for proxied requests |
33| `max_blob_chunk_size` | string | `"95MB"` | Maximum request body size for a single registry blob upload chunk |
34
35## Port Configuration
36
37### Proxy Port
38
39The `port` setting controls where Gordon listens for HTTP traffic:
40
41```toml
42[server]
43port = 8080 # Use 8080 for rootless containers with port forwarding
44```
45
46For rootless containers, you'll typically use a high port and configure firewall port forwarding:
47
48```bash
49# Forward port 80 to 8080
50sudo firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=8080
51```
52
53### Native TLS Listener
54
55Enable native HTTPS directly in Gordon:
56
57```toml
58[server]
59tls_enabled = true
60tls_port = 443
61tls_cert_file = "/etc/gordon/certs/fullchain.pem"
62tls_key_file = "/etc/gordon/certs/privkey.pem"
63```
64
65With TLS enabled:
66- Gordon terminates HTTPS on `tls_port`
67- Host-based routing still works (apps, `/v2/*`, `/auth/*`, `/admin/*`)
68- `port` remains available for plain HTTP unless you restrict it externally
69- If `tls_cert_file`/`tls_key_file` are empty, Gordon auto-generates a self-signed pair in `{data_dir}/tls/`
70
71### Registry Port
72
73The `registry_port` setting controls where Gordon accepts image pushes:
74
75```toml
76[server]
77registry_port = 5000
78```
79
80Docker/Podman clients push to this port:
81
82```bash
83docker push registry.mydomain.com:5000/myapp:latest
84```
85
86## Gordon Domain
87
88The `gordon_domain` is required and must match your DNS configuration:
89
90```toml
91[server]
92gordon_domain = "gordon.mydomain.com"
93```
94
95This domain is used for:
96- Docker login and image push/pull operations
97- Admin API access (`/admin/*` endpoints)
98- CLI remote targeting (`gordon routes --remote https://gordon.mydomain.com`)
99- Authentication endpoints (`/auth/*`)
100
101When requests arrive on the proxy port with this domain as the Host header, Gordon routes them to the backend services (registry and admin API).
102
103> **Note:** `registry_domain` is supported as a deprecated alias for backwards compatibility.
104
105## Data Directory
106
107The `data_dir` setting controls where Gordon stores data:
108
109```toml
110[server]
111data_dir = "~/.gordon" # Default for user installations
112```
113
114### Directory Structure
115
116```
117~/.gordon/
118├── registry/ # Container images and manifests
119│ ├── blobs/
120│ └── manifests/
121├── env/ # Environment files per domain
122│ ├── app_mydomain_com.env
123│ └── api_mydomain_com.env
124├── logs/ # Application and container logs
125│ ├── gordon.log
126│ ├── proxy.log
127│ └── containers/
128└── secrets/ # Secrets (unsafe backend only)
129```
130
131### Permissions
132
133 Gordon creates directories with secure permissions:
134 - Directories: `0700` (owner only)
135 - Files: `0600` (owner only)
136
137 ## Maximum Proxy Body Size
138
139 The `max_proxy_body_size` setting limits the size of request bodies that Gordon will forward to backend containers:
140
141 ```toml
142 [server]
143 max_proxy_body_size = "512MB" # Default
144 ```
145
146 **Purpose:** Prevents resource exhaustion attacks from extremely large uploads through the proxy.
147
148 **Supported units:** B, KB, MB, GB, TB (case-insensitive, decimal/1024-based)
149
150 **Examples:**
151 ```toml
152 max_proxy_body_size = "100MB" # Stricter limit
153 max_proxy_body_size = "1GB" # Allow larger uploads
154 max_proxy_body_size = "0" # No limit (not recommended)
155 ```
156
157 **Behavior:**
158 - When a request exceeds the limit, Gordon returns `413 Request Entity Too Large`
159 - The limit is applied before the request reaches the backend container
160 - Uploads in progress are terminated when the limit is exceeded
161
162 **Use cases:**
163 - File upload services: increase to `1GB` or higher
164 - CI/CD artifact uploads: adjust based on your largest artifacts
165 - Tight security: reduce to `100MB` or lower
166 - Default (512MB): suitable for most applications
167
168 > **Warning:** Setting this to `0` (no limit) allows unlimited upload sizes, which can lead to disk exhaustion and DoS vulnerabilities. Always set a reasonable limit for production deployments.
169
170## Maximum Registry Blob Chunk Size
171
172The `max_blob_chunk_size` setting limits the size of a single blob upload request to the registry (`PATCH`/`PUT` under `/v2/*/blobs/uploads/*`):
173
174```toml
175[server]
176max_blob_chunk_size = "95MB" # Default
177```
178
179**Purpose:** Prevents excessive memory usage during blob uploads while allowing large real-world image layers.
180
181**Supported units:** B, KB, MB, GB, TB (case-insensitive, decimal/1024-based)
182
183**Examples:**
184
185```toml
186max_blob_chunk_size = "256MB" # Stricter limit
187max_blob_chunk_size = "1GB" # Allow larger layers
188```
189
190**Behavior:**
191- When a blob chunk exceeds the limit, Gordon returns `413 Request Entity Too Large`
192- Docker/Podman may send a full layer in one request, so set this high enough for your base images
193- Default (`95MB`) is compatible with Cloudflare and most CDN proxies; increase if pushing very large layers directly
194
195## Examples
196
197### Development Configuration
198
199```toml
200[server]
201port = 8080
202registry_port = 5000
203gordon_domain = "gordon.local"
204data_dir = "./dev-data"
205```
206
207### Production Configuration
208
209```toml
210[server]
211port = 8080
212registry_port = 5000
213gordon_domain = "gordon.company.com"
214data_dir = "/var/lib/gordon"
215```
216
217### Rootless Container Setup
218
219```toml
220[server]
221port = 8080 # High port for rootless
222registry_port = 5000
223gordon_domain = "gordon.mydomain.com"
224```
225
226With firewall port forwarding:
227```bash
228sudo firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=8080
229sudo firewall-cmd --reload
230```
231
232## Related
233
234- [Configuration Overview](./index.md)
235- [Installation Guide](../installation.md)
236- [Routes Configuration](./routes.md)