Domains & SSL
Configure custom domains with automatic HTTPS certificates
Domains & SSL
Senate provides automatic domain management and SSL certificate provisioning through its built-in Caddy reverse proxy.
Overview
When you add a domain to a service:
- Senate configures Caddy to route traffic to your container
- If HTTPS is enabled, Let's Encrypt automatically provisions an SSL certificate
- Traffic is proxied from the domain to your container's port

Adding a Domain
- Navigate to your service
- Go to the Domains tab
- Click Add Domain
- Configure the domain:
| Field | Description | Example |
|---|---|---|
| Host | The domain name | app.example.com |
| Port | Container port to route to | 3000 |
| Path | URL path prefix | / or /api |
| Protocol | HTTP or HTTPS | https |
- Click Save
Domain Configuration
Host
The fully qualified domain name (FQDN):
- Subdomains:
app.example.com,api.example.com - Root domain:
example.com - Wildcard: Not currently supported
Port
The internal container port your application listens on:
- Must match the port your app binds to inside the container
- Different from host port bindings
- Common ports:
3000,8080,80
Path
Route specific URL paths to different services:
| Path | Routes |
|---|---|
/ | All traffic |
/api | Only /api/* requests |
/admin | Only /admin/* requests |
Path-based routing allows multiple services to share a single domain.
Protocol
| Protocol | Description |
|---|---|
https | Automatic SSL via Let's Encrypt (recommended) |
http | No encryption (not recommended for production) |
SSL Certificates
Senate supports three SSL certificate modes:
Automatic (HTTP-01 Challenge)
Default mode using Let's Encrypt HTTP-01 challenge:
- Configures Caddy with the domain
- Caddy requests a certificate from Let's Encrypt
- HTTP-01 challenge validates domain ownership
- Certificate is installed and auto-renewed
Requirements:
- Domain DNS must point to your server's IP
- Port 80 must be accessible (for HTTP-01 challenge)
- Port 443 must be accessible (for HTTPS traffic)
DNS Challenge (Cloudflare)
Use DNS-01 challenge with Cloudflare DNS provider:
- Select DNS mode when adding a domain
- Choose Cloudflare as the DNS provider
- Provide your Cloudflare API token
- Caddy uses DNS-01 challenge (no port 80 required)
Use when: Port 80 is not accessible or you prefer DNS validation.
Custom Certificate
Upload your own SSL certificate:
- Select Custom mode when adding a domain
- Paste your certificate (PEM format)
- Paste your private key (PEM format)
- Certificate is used directly (no auto-renewal)
Use when: You have your own certificate or use a private CA.
Certificate Renewal
Certificates obtained via Automatic or DNS modes are automatically renewed before expiration. Custom certificates require manual renewal.
Internal Endpoints
Services also get internal endpoints for container-to-container communication:
http://{service-name}-{id}:{port}These are displayed in the Domains tab under "Internal Endpoints."
Managing Domains
Edit Domain
- Click the edit icon (✏️) on a domain
- Modify the configuration
- Click Save
Changes take effect immediately. SSL certificates are preserved.
Delete Domain
- Click the delete icon (🗑️) on a domain
- Confirm deletion
The route is immediately removed from Caddy.
Gateway Integration
Domains are managed by the Gateway (Caddy) on each machine. View all routes:
- Go to Machines → Select machine → Gateway
- See all configured domains grouped by service
- Monitor certificate status
- View upstream health
Troubleshooting
Certificate not provisioning
- DNS not configured: Verify with
dig yourdomain.com - Port 80 blocked: Check firewall allows HTTP traffic
- Rate limited: Let's Encrypt has rate limits; wait and retry
- Invalid domain: Ensure domain is publicly resolvable
Domain not accessible
- Service not running: Check service status
- Wrong port: Verify port matches container's listening port
- Path mismatch: Check path configuration
- Firewall: Ensure ports 80/443 are open
Best Practices
- Always use HTTPS in production
- Set up proper DNS before adding domains
- Use path routing to consolidate services on fewer domains
- Monitor Gateway status for certificate and routing issues
Related
- Custom Domain Guide - Step-by-step setup
- Gateway - Advanced routing
- Environment Variables - Configure BASE_URL