Add additional domains? #285

Closed
opened 2025-11-13 11:55:37 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @maietta on GitHub (May 1, 2025).

I can't seem to find a way to add additional domains to this software so that I can tunnel with them.

Are multiple domains supported? If so, how?

Originally created by @maietta on GitHub (May 1, 2025). I can't seem to find a way to add additional domains to this software so that I can tunnel with them. Are multiple domains supported? If so, how?
Author
Owner

@tannkosten commented on GitHub (May 1, 2025):

It is supported
https://forum.hhf.technology/t/adding-multiple-domains-to-your-pangolin-stack/563

@tannkosten commented on GitHub (May 1, 2025): It is supported https://forum.hhf.technology/t/adding-multiple-domains-to-your-pangolin-stack/563
Author
Owner

@maietta commented on GitHub (May 1, 2025):

Absolutely pathetic that I have to sign up for a forum to see this. It wasn't in the docs, either. So, I've had Grok clean it up for others to find.


Adding Multiple Domains to Your Pangolin Stack

This feature enables managing resources across multiple domains from a single Pangolin instance. Below are two methods to add domains: an automated script (recommended) and manual configuration.


The automated script simplifies domain management by handling formatting, validation, and stack restarts.

Step 1: Download the Domain Management Script

  1. Download add_domain.sh to your Pangolin installation directory:
    curl -o add_domain.sh https://gist.githubusercontent.com/hhftechnology/40627e4c5054e7846555cb5379ea46cf/raw/73f01dd48f7c450fc72d881f730e2aa66aeec860/add_domain.sh
    
  2. Make the script executable:
    chmod +x add_domain.sh
    

Step 2: Add Domains Using the Script

Run the script to add domains to your Pangolin configuration:

  • Add a domain with the default Let’s Encrypt certificate resolver:
    ./add_domain.sh example.com
    
  • Add a domain with a custom certificate resolver (advanced users only):
    ./add_domain.sh example.com customresolver
    

The script will:

  • Validate the domain format and DNS configuration (warns if DNS is not propagated).
  • Add the domain to the correct section of the configuration file.
  • Fix misplaced domain entries (with permission).
  • Offer to restart the Pangolin stack automatically.

After the stack restarts, refresh the Pangolin UI to see the new domains.

Script Benefits:

  • Validates DNS resolution.
  • Creates a backup of your config file (./config/config.yml.bak).
  • Ensures proper YAML formatting and structure.
  • Places domains correctly in the config file.
  • Handles errors and monitors stack restarts.

Step 3: Configure DNS Records

For each domain:

  • Create A records pointing to your Pangolin server’s IP address.
  • For wildcard subdomains, create *.your-domain.com DNS records.

Step 4: Create Resources on Different Domains

  1. In the Pangolin UI, go to the Resources tab and click Add Resource.
  2. Select the desired domain from the dropdown.
  3. Enter the subdomain name and complete the resource creation process.

Verification

Ensure:

  • SSL certificates are issued correctly for each domain.
  • Resources are accessible via their respective domains.
  • Authentication and access control function properly.

Method 2: Manually Edit the Configuration File

Step 1: Edit the Configuration File

  1. Navigate to your Pangolin installation directory and open the configuration file:
    nano ./config/config.yml
    
  2. Locate the app section and verify the main dashboard URL.
  3. Add a domains section (if not present) with entries for each domain. Example:
    app:
      dashboard_url: "https://pangolin.your-primary-domain.com"
      base_domain: "your-primary-domain.com"
      log_level: "info"
      save_logs: false
    
    domains:
      domain1:
        base_domain: "your-primary-domain.com"
        cert_resolver: "letsencrypt"
      domain2:
        base_domain: "your-secondary-domain.com"
        cert_resolver: "letsencrypt"
    
  4. Save the file and restart the Pangolin stack:
    docker-compose down && docker-compose up -d
    

Common Issues and Troubleshooting

  • SSL Certificate Errors: Verify DNS records and ensure ports 80 and 443 are open.
  • Domain Not in Dropdown: Restart the Pangolin stack after adding domains.
  • Misplaced Domains: Use the automated script to fix configuration issues.
  • Logs: Check Traefik and Pangolin logs for specific error messages.

Notes

  • Each domain requires its own SSL certificate, managed automatically by Traefik and Let’s Encrypt.
  • Consider wildcard certificates for multiple subdomains.
  • Ensure ports 80, 443, and 51820 are open in your firewall.
  • The script backs up your config file to ./config/config.yml.bak before changes.

For further assistance, refer to the Pangolin documentation or share logs in this issue.


People should not have to sign up for a forum to see the instructions. They should only have to sign up to be able to reply.

@maietta commented on GitHub (May 1, 2025): Absolutely pathetic that I have to sign up for a forum to see this. It wasn't in the docs, either. So, I've had Grok clean it up for others to find. --- ## Adding Multiple Domains to Your Pangolin Stack This feature enables managing resources across multiple domains from a single Pangolin instance. Below are two methods to add domains: an automated script (recommended) and manual configuration. --- ### Method 1: Using the Automated Script (Recommended) The automated script simplifies domain management by handling formatting, validation, and stack restarts. #### Step 1: Download the Domain Management Script 1. Download `add_domain.sh` to your Pangolin installation directory: ```bash curl -o add_domain.sh https://gist.githubusercontent.com/hhftechnology/40627e4c5054e7846555cb5379ea46cf/raw/73f01dd48f7c450fc72d881f730e2aa66aeec860/add_domain.sh ``` 2. Make the script executable: ```bash chmod +x add_domain.sh ``` #### Step 2: Add Domains Using the Script Run the script to add domains to your Pangolin configuration: - **Add a domain with the default Let’s Encrypt certificate resolver**: ```bash ./add_domain.sh example.com ``` - **Add a domain with a custom certificate resolver** (advanced users only): ```bash ./add_domain.sh example.com customresolver ``` The script will: - Validate the domain format and DNS configuration (warns if DNS is not propagated). - Add the domain to the correct section of the configuration file. - Fix misplaced domain entries (with permission). - Offer to restart the Pangolin stack automatically. After the stack restarts, refresh the Pangolin UI to see the new domains. **Script Benefits**: - Validates DNS resolution. - Creates a backup of your config file (`./config/config.yml.bak`). - Ensures proper YAML formatting and structure. - Places domains correctly in the config file. - Handles errors and monitors stack restarts. #### Step 3: Configure DNS Records For each domain: - Create `A` records pointing to your Pangolin server’s IP address. - For wildcard subdomains, create `*.your-domain.com` DNS records. #### Step 4: Create Resources on Different Domains 1. In the Pangolin UI, go to the **Resources** tab and click **Add Resource**. 2. Select the desired domain from the dropdown. 3. Enter the subdomain name and complete the resource creation process. #### Verification Ensure: - SSL certificates are issued correctly for each domain. - Resources are accessible via their respective domains. - Authentication and access control function properly. --- ### Method 2: Manually Edit the Configuration File #### Step 1: Edit the Configuration File 1. Navigate to your Pangolin installation directory and open the configuration file: ```bash nano ./config/config.yml ``` 2. Locate the `app` section and verify the main dashboard URL. 3. Add a `domains` section (if not present) with entries for each domain. Example: ```yaml app: dashboard_url: "https://pangolin.your-primary-domain.com" base_domain: "your-primary-domain.com" log_level: "info" save_logs: false domains: domain1: base_domain: "your-primary-domain.com" cert_resolver: "letsencrypt" domain2: base_domain: "your-secondary-domain.com" cert_resolver: "letsencrypt" ``` 4. Save the file and restart the Pangolin stack: ```bash docker-compose down && docker-compose up -d ``` --- ### Common Issues and Troubleshooting - **SSL Certificate Errors**: Verify DNS records and ensure ports 80 and 443 are open. - **Domain Not in Dropdown**: Restart the Pangolin stack after adding domains. - **Misplaced Domains**: Use the automated script to fix configuration issues. - **Logs**: Check Traefik and Pangolin logs for specific error messages. --- ### Notes - Each domain requires its own SSL certificate, managed automatically by Traefik and Let’s Encrypt. - Consider wildcard certificates for multiple subdomains. - Ensure ports 80, 443, and 51820 are open in your firewall. - The script backs up your config file to `./config/config.yml.bak` before changes. For further assistance, refer to the [Pangolin documentation](https://example.com/docs) or share logs in this issue. --- People should not have to sign up for a forum to see the instructions. They should only have to sign up to be able to reply.
Author
Owner

@miloschwartz commented on GitHub (May 2, 2025):

It's not super clear and we need to eventually add this to the UI but it's pretty easy to add multiple domains via the config file:

https://docs.fossorial.io/Pangolin/Configuration/config

Look at the domains section.

@miloschwartz commented on GitHub (May 2, 2025): It's not super clear and we need to eventually add this to the UI but it's pretty easy to add multiple domains via the config file: https://docs.fossorial.io/Pangolin/Configuration/config Look at the `domains` section.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#285