Skip to content

Traefik

Admin0705 edited this page May 23, 2018 · 147 revisions

CLICKING the STAR in the UPPER RIGHT promotes our PROJECT on GITHUB! - WARNING, PLEASE VISIT https://plexguide.com/wikis/ - This is the old wiki!

Time to Deploy Traefik!

Table of Contents: Traefik


About Traefik

WARNING: Port 80 and 443 have to be open for Traefik to work. By default, you should be good. If you have Caddy, CPanel, or some server website hosting software; you may have problems. Without Traefik being able to route through 80 and 443, your certificates will not work!

Traefik is a modern reverse proxy that not enables the use of your subdomains, but has the ability to provide authentication and issue SSL certificate using Lets Encrypt.

Traefik Demo Chart

Traefik V1 versus V2

If you are a new user, legacy Traefik is the easiest to setup and you can switch between both if you ever wantto choose the other. I would recommend to utilize Traefik v2 which also includes the setup of CloudFlareintegration

Legacy Traefik

PROS

  • Easiest to setup.
  • When domain is pointing to your IP prior to setup, process only takes minutes for it work.

CONS

  • Can only request 20 new subdomains per week.
  • You cannot create custom subdomains via PlexGuide.
  • If creating custom containers, these will count against your requests.
  • Not setup for CloudFlare intergration.

Traefik Version 2

PROS

  • After it runs, you can create containers with unlimited subdomains.
  • Able to setup custom subdomains.
  • Do not have to worry about rate count (unless you just decide to run Traefik over and over again for no reason).
  • Requires only a DNS challenge; not authenticating each individual application.
  • PG creates extra subdomains that work. For example, OMBI can be accessed via the following:
    • request.domain.com
    • requests.domain.com
    • ombi.domain.com
    • domain.com

CONS

  • Little more time consuming due to retrieving your API keys depending on your provider!

Configure: Traefik Legacy V1

For this example, we are going to use GoDaddy.com. In general, the concept is the same. You need a wildcard provider (if not, you have to type out each subdomain). You will need to create two A records as shown below!

[ Photo ]

Note Using Other Providers

These instructions generally apply to other providers, granted they allow you to use a WILDCARD. This is something you should ask or find out. If you cannot use a WILDCARD, you can follow the steps below; but you have to type out each subdomain such as plex.domain.com - emby.domain.com

General [ A ] Records

  • Require an @ ( A Record ) that points to your IP!
  • Highly Recommend a * ( Wild Card A Record ) that points to your IP!

* Wild Card Domains

  • After you have signed up for a domain, please goto your domain and you should see the following options. Click - DNS.
  • Next, click the ADD button in the bottom right and type the following

[ PHOTO ]

  • After you setup your wildcard domain, you should see the following:

Final Note

Again, this is the same concept for any domain provider. You needed two create two A records. One is generally there already (the @ record). Then the wildcard (*) record A record. Both need to point to your server IP Address!

Configure: Traefik V2 - CloudFlare

In general, your going to create a free account with CloudFlare. From there, you point your NAMESERVERS to CloudFlare. Afterwards, you'll have to WAIT until CloudFlare says your domain is ready. This can take several minutes to a few a hours.

Note 1: Note, if we made updates to Traefik and/or including the TOML, you must RERUN Traefik under applications > critical.

Note 2: If you have a prior setup using CloudFlare for the current domain, you may want to delete it. One member reported that a prior setup botched their setup with Version 2. Basically took them days to figure everything out and had to go through this process from scratch!

Configuring [ A ] Records with Your Domain Provider

Ensure that you have the following two A records setup. Below is an example of how it would look like if you were utilizing GoDaddy as your domain provider.

Configuring Your Domain to CloudFlare

  1. Ensure that you have the following two A records setup from above!

  2. Next, you will CloudFlare will query your DNS records! Remember, that this process can take hours for the transition to complete!

  3. Select the FREE PLAN unless you just love spending money or if your domain is subject to continuous attacks.

  1. CloudFlare will now scan your DNS records. Ensure that you have your domain and wildcard present. If not, you failed to pay attention above. Ensure that the VALUE point to the IP address of your Domain.

[ PHOTO ]

  1. Now you must change your name servers to what CloudFlare says. Don't care? Then it will never work.

  2. Back to your domain provider, change the name servers. The following picture is an example with GoDaddy.

[ PHOTO ]

  1. Now you must wait for CloudFlare to pick up on the NAMESERVER change! You'll notice back at CloudFlare, you have to wait!

[ PHOTO ]

  1. This picture below should work within an hour, sometimes in minutes. Depends...

Obtain CloudFlare API Keys

  1. Obtain Your API Key.
  2. Scroll downward and select VIEW API KEY for the GLOBAL API KEY.
  3. Copy the Global API Key and Save It! You will need to Paste it in the PlexGuide Interface.

PlexGuide Interface

Note for Windows PUTTY USERS: CTRL+V does not work! Use SHIFT+Insert to PASTE!

  1. Select CloudFlare via the Settings under PlexGuide
  2. Read the Warning!
  3. Type in the CLOUDFLARE_EMAIL information (yes your email)
  4. Type in the CLOUDFLARE_API_KEY
  5. PG will process your information and rebuild your containers accordingly!
  6. It can take a few minutes for your to works (assuming you setup correctly)

View the Portainer Logs

NOTE: If it says your certificate is valid but your https:// is not working, it is because your DNS has not fully propagated meaning you may not see it work for up to 2-24 hours (mostly likely 12). Try using a different browser or clear you cache if your testing for troubleshooting reasons.

NOTE: Visit https://portainer.domain.com or http://ipv4:9000 to view your logs! Portainer will save you a-lot of time from guessing on what's going on!

  1. First click on the Container Links!
  2. Click Logs
  3. Read the Following Information.
  4. Successful View: Should see your domain and/or * wildcard domain in the logs in regards to a valid certificate.

NOTE: Exceed Error Rate - If you run Traefik many times over, you may have to wait up to one week in order to be able to obtain another certificate.

Final Notes

Cloudflare requires a little patience when you move your domain over. Overall, it's free and probably the best option due to the protection it provides. Generally, this should almost work for any domain provider.

Configure: Traefik V2 - GoDaddy

GoDaddy is one of the most popular domain registers and is highly trusted. I found their process easiest to use!

Configure GoDaddy Domain

Ensure that you have the following two A records setup.

Obtaining GoDaddy Keys

  1. Obtain your keys by visiting: https://developer.godaddy.com/keys
  2. Login and click the "create key" button.
  3. Switch to Production! If not, your gonna ask us a billion questions.
  4. Copy Both the Key & Secret for the PlexGuide Interface.

PlexGuide Interface

Note for Windows PUTTY USERS: CTRL+V does not work! Use SHIFT+Insert to PASTE!

  1. Select GoDaddy via the Settings under PlexGuide
  2. Read the Warning!
  3. Type in the GODADDY_API_USER information (API Key)
  4. Type in the GODADDY_API_SECRET
  5. PG will process your information and rebuild your containers accordingly!
  6. It can take a few minutes for your to works (assuming you setup correctly)

View the Portainer Logs

NOTE: Visit https://portainer.domain.com or http://ipv4:9000 to view your logs! Portainer will save you a-lot of time from guessing on what's going on!

  1. First click on the Container Links!
  2. Click Logs.
  3. Read the Following Information.
  4. Successful View: Should see your domain and/or * wildcard domain in the logs in regards to a valid certificate.

NOTE: Exceed Error Rate - If you run Traefik many times over, you may have to wait up to one week in order to be able to obtain another certificate.

Final Notes

GoDaddy's overall experience is pretty good. GoDaddy can tend to be a little spammy with options and they overcharge for privacy protections. Always looks for coupons and low cost alternative domains.

Configure: Traefik V2 - NameCheap

NameCheap requires that you have spent $50 over the last two years before you are able to use their API. As a result, I have not been able to test this for you, but put the required fields in. If this works, please update this guide for others!

NameCheap Work Around

Purchase a domain with NameCheap and then use CloudFlare as a work around. Please visit the Traefik CloudFlare v2 Guide. Be aware that once you make the changes, it can take a few minutes to make all this work!

Configure Your Domain

Ensure that you have the following two A records setup. (Below is a GoDaddy Picture, but same concept)

Obtaining NameCheap API Keys

  1. Obtain your keys by emailing their tech support for their API Key!
  2. Copy Both the Key & Secret for the PlexGuide Interface.

PlexGuide Interface

Note for Windows PUTTY USERS: CTRL+V does not work! Use SHIFT+Insert to PASTE!

  1. Select NameCheap via the Settings under PlexGuide
  2. Read the Warning!
  3. Type in the NAMECHEAP_API_USER information (yes your email)
  4. Type in the NAMECHEAP_API_KEY
  5. PG will process your information and rebuild your containers accordingly!
  6. It can take a few minutes for your to works (assuming you setup correctly)

View the Portainer Logs

NOTE: Visit https://portainer.domain.com or http://ipv4:9000 to view your logs! Portainer will save you a-lot of time from guessing on what's going on!

  1. First click on the Container Links!
  2. Click Logs.
  3. Read the Following Information.
  4. Successful View: Should see your domain and/or * wildcard domain in the logs in regards to a valid certificate.

NOTE: Exceed Error Rate - If you run Traefik many times over, you may have to wait up to one week in order to be able to obtain another certificate.

Final Notes

NameCheap does have cheap domains that you can utilize over a period of 5 years for nearly $6. To get around this, sign up for CloudFlare and point your domain in that direction. NameCheap is behind in that you have to email them for the API and this can take awhile depending on their mode.


Visit our Website By Click the Picture Below! N|Demo

N|Solid N|Solid

Installing PlexGuide

  1. PlexGuide Install Information

Preplanning & Information

  1. PG Folder Structure

Domain and Port Control

  1. CloudFlare Tunnel

Primary Applications

  1. Plex

Useful Links

  1. PG YouTube Channel
Clone this wiki locally