{"id":451,"date":"2025-09-26T22:37:35","date_gmt":"2025-09-27T02:37:35","guid":{"rendered":"https:\/\/www.grumpyland.com\/blog\/?p=451"},"modified":"2025-09-27T02:33:41","modified_gmt":"2025-09-27T06:33:41","slug":"directadmin-automatic-ssl-certificates-with-3rd-party-dns-and-reverse-proxy-example-with-cloudflare","status":"publish","type":"post","link":"https:\/\/www.grumpyland.com\/blog\/451\/directadmin-automatic-ssl-certificates-with-3rd-party-dns-and-reverse-proxy-example-with-cloudflare\/","title":{"rendered":"DirectAdmin Automatic SSL Certificates with 3rd Party DNS and reverse proxy (example with CloudFlare)"},"content":{"rendered":"\n<p>This is a fairly simple solution done entirely in GUI, but something I had great difficulty finding the answer to from anywhere else.<\/p>\n\n\n\n<p>If you use another DNS and\/or reverse proxy service such as CloudFlare, the DirectAdmin&#8217;s auto SSL feature doesn&#8217;t work anymore since both ZeroSSL and Let&#8217;s Encrypt provided in DirectAdmin is no longer capable of verifying your domain as DNS verification fails.<\/p>\n\n\n\n<p>So your other services such as mail server, etc. will now fail to validate SSL while CloudFlare serves your website since CloudFlare doesn&#8217;t support your other services.<\/p>\n\n\n\n<p>To solve this, DirectAdmin already has a feature to update DNS elsewhere during SSL verification for certain services that provide API access. This tutorial will use CloudFlare as an example as that&#8217;s most likely the most common usage as well as mine. If you use another service that&#8217;s supported in DirectAdmin, steps might look a bit different, but the process will be similar.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 1: Setup API keys and tokens on CloudFlare<\/h2>\n\n\n\n<figure class=\"wp-block-image alignleft size-medium\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"90\" src=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/cloudflare-logo-300x90.png\" alt=\"CloudFlare logo\" class=\"wp-image-457\" srcset=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/cloudflare-logo-300x90.png 300w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/cloudflare-logo-768x229.png 768w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/cloudflare-logo-500x149.png 500w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/cloudflare-logo-800x239.png 800w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/cloudflare-logo.png 874w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>Direct Admin requires 4 fields. Though, seems like over-reach of token requirements, but the ones you need are: Account email, API key, API token with DNS, and API token with Zone.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to CloudFlare<\/li>\n\n\n\n<li>Go to <em>Profile <\/em>(click the user icon on top right corner)<\/li>\n\n\n\n<li>Go to <em>API Tokens<\/em> (Left)<\/li>\n\n\n\n<li>Retrieve the <em>Global API Key<\/em> and keep this for later. This step will require further verification.<\/li>\n\n\n\n<li>We&#8217;re now going to create a token that does both DNS and Zone.<\/li>\n\n\n\n<li>Click <em>Create Token<\/em><\/li>\n\n\n\n<li>Create <em>Custom Token<\/em><\/li>\n\n\n\n<li>Create Permissions like this:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"154\" src=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-2-1024x154.png\" alt=\"Configuration showing the following:\nZone Settings: Read\nZone: Edit\nDNS: Edit\" class=\"wp-image-454\" srcset=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-2-1024x154.png 1024w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-2-300x45.png 300w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-2-768x115.png 768w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-2-500x75.png 500w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-2-800x120.png 800w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-2.png 1099w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>Zone Settings: Read\nZone: Edit\nDNS: Edit<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<ol start=\"9\" class=\"wp-block-list\">\n<li>For zones, you can do All Zones or specify which domains this applies to.<\/li>\n\n\n\n<li>For Client IP Address Filtering, add your server&#8217;s public IP address(es).<\/li>\n\n\n\n<li>Create the token and you&#8217;ll get a long token string.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Part 2: Configuration in Direct Admin<\/h2>\n\n\n\n<figure class=\"wp-block-image alignleft size-medium\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"93\" src=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-300x93.png\" alt=\"Direct Admin logo\" class=\"wp-image-459\" srcset=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-300x93.png 300w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-1024x317.png 1024w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-768x237.png 768w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-1536x475.png 1536w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-500x155.png 500w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-800x247.png 800w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo-1280x396.png 1280w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/directadmin-logo.png 1572w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>We will now setup auto SSL so that it updates CloudFlare accordingly to verify the DNS. We will be using the Evolution skin for this.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Login as the user which has the relevant domain<\/li>\n\n\n\n<li>Go to <em>SSL Certificates<\/em><\/li>\n\n\n\n<li>Select the domain on top right if you have more than one.<\/li>\n\n\n\n<li>Go to <em>Get automatic certificate from ACME Provider<\/em> tab<\/li>\n\n\n\n<li>Now you <strong>MUST <\/strong>select the wildcard checkmark. If you do not, the next options will not be visible.<\/li>\n\n\n\n<li>When checked a new row will appear with the option of <em>DNS provider<\/em>.<\/li>\n\n\n\n<li>Select CloudFlare (or any other third party DNS you&#8217;re using) and then a modal window will popup. This only appears now and will not be visible again, even if you come back to this screen later. For CloudFlare, it will look like so:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"619\" height=\"617\" src=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image.png\" alt=\"direct admin's dns provider configuration figure\" class=\"wp-image-452\" srcset=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image.png 619w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-300x300.png 300w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-100x100.png 100w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-500x498.png 500w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure>\n\n\n\n<ol start=\"8\" class=\"wp-block-list\">\n<li>Fill in the details with the information you got from Part 1. The token goes into both the DNS and Zone section.<\/li>\n\n\n\n<li>Hit Save on the popup window.<\/li>\n\n\n\n<li>Hit Save again for the auto SSL.<\/li>\n<\/ol>\n\n\n\n<p>That&#8217;s it! Now you have automatic SSL with Let&#8217;s Encrypt\/ZeroSSL for your domain and all your subdomains, allowing all services to connect securely while also using CloudFlare for serving the web.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bonus Tidbit<\/h2>\n\n\n\n<figure class=\"wp-block-image alignleft size-medium\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"129\" src=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/daflare_logo-300x129.png\" alt=\"daflare logo\" class=\"wp-image-475\" srcset=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/daflare_logo-300x129.png 300w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/daflare_logo-768x329.png 768w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/daflare_logo-500x214.png 500w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/daflare_logo.png 774w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>If you&#8217;d like to automatically synchronize your DirectAdmin DNS and CloudFlare DNS, you can use a plugin called <a href=\"https:\/\/daflare.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">daflare<\/a>.<\/p>\n\n\n\n<p>This will copy all of your DNS data from your DA to your CF. If you&#8217;ve followed this setup, you&#8217;ve already got almost all the credentials you need for daflare. Just need to grab the account ID from CF from Account home page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"659\" height=\"148\" src=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-3.png\" alt=\"cloudflare's copy account id figure\" class=\"wp-image-460\" srcset=\"https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-3.png 659w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-3-300x67.png 300w, https:\/\/www.grumpyland.com\/blog\/wp-content\/uploads\/2025\/09\/image-3-500x112.png 500w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/figure>\n\n\n\n<p>Just be warned that this plugin saves DNS information in ONE direction. From DA to CF. So all information in CF that&#8217;s not in DA will be deleted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a fairly simple solution done entirely in GUI, but something I had great difficulty finding the answer to from anywhere else. If you use another DNS and\/or reverse proxy service such as CloudFlare, the DirectAdmin&#8217;s auto SSL feature doesn&#8217;t work anymore since both ZeroSSL and Let&#8217;s Encrypt provided in DirectAdmin is no longer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[15],"tags":[68,67,69],"class_list":["post-451","post","type-post","status-publish","format-standard","hentry","category-tutorial","tag-cloudflare","tag-directadmin","tag-dns"],"_links":{"self":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts\/451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/comments?post=451"}],"version-history":[{"count":9,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts\/451\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/media?parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/categories?post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/tags?post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}