Domain

Learn how to set up custom domains for your Piglet Run services.

Overview

Configure custom domains for:

  • Main Application: Your primary domain
  • Subdomains: Service-specific subdomains
  • Multiple Domains: Support multiple domains

Quick Setup

Add a custom domain:

pig domain add example.com

DNS Configuration

Required DNS Records

Point your domain to Piglet Run:

TypeNameValue
A@Your server IP
AwwwYour server IP
CNAMEcode@
CNAMEjupyter@

Using Cloudflare

pig domain add example.com --dns cloudflare --api-key YOUR_API_KEY

Add Custom Domain

Primary Domain

pig domain add example.com --primary

Subdomain for Services

pig domain add code.example.com --service vscode
pig domain add jupyter.example.com --service jupyter

Domain Management

List Domains

pig domain list

Remove Domain

pig domain remove old-domain.com

Set Primary

pig domain primary example.com

Configuration

Domain settings in /etc/piglet/domains.yml:

domains:
  primary: example.com
  aliases:
    - www.example.com
  services:
    vscode: code.example.com
    jupyter: jupyter.example.com
    grafana: monitor.example.com

Verify Domain

Check domain configuration:

pig domain verify example.com

Next Steps