3:I[9275,[],""] 5:I[1343,[],""] 6:I[8700,["231","static/chunks/231-42eeaa612179830e.js","837","static/chunks/837-29ccadcc1eaf8d5e.js","185","static/chunks/app/layout-51a43a25dcad0cd5.js"],"ThemeProviders"] 7:I[9032,["231","static/chunks/231-42eeaa612179830e.js","837","static/chunks/837-29ccadcc1eaf8d5e.js","185","static/chunks/app/layout-51a43a25dcad0cd5.js"],"KBarSearchProvider"] 8:I[231,["231","static/chunks/231-42eeaa612179830e.js","173","static/chunks/173-6f0f3c0be6f44ec5.js","797","static/chunks/app/blog/%5B...slug%5D/page-11e23acd1756039c.js"],""] a:I[509,["231","static/chunks/231-42eeaa612179830e.js","837","static/chunks/837-29ccadcc1eaf8d5e.js","185","static/chunks/app/layout-51a43a25dcad0cd5.js"],"KBarButton"] b:I[1398,["231","static/chunks/231-42eeaa612179830e.js","837","static/chunks/837-29ccadcc1eaf8d5e.js","185","static/chunks/app/layout-51a43a25dcad0cd5.js"],"default"] c:I[8976,["231","static/chunks/231-42eeaa612179830e.js","837","static/chunks/837-29ccadcc1eaf8d5e.js","185","static/chunks/app/layout-51a43a25dcad0cd5.js"],"default"] 4:["slug","plausible-analytics","c"] 9:T11a9,M140.035 229.145h-28.34v-11.899h28.34a15.5 15.5 0 0 0 13.934-8.61l10.644 5.325c-4.687 9.363-14.105 15.184-24.578 15.184M373.47 62.563v285.566c0 6.562-5.336 11.898-11.899 11.898H191.621l-5.676 3.614a52.97 52.97 0 0 1-28.46 8.285H87.901v-82.332c0-11.832 5.657-22.34 14.387-29.043-35.91-11.555-61.98-45.25-61.98-84.953v-5.95c-13.125 0-23.797-10.671-23.797-23.796 0-6.145 2.402-11.704 6.246-15.93-2.906-4.16-4.89-8.836-5.742-13.817H2.934l3.722-14.867a66.7 66.7 0 0 1 11.426-23.953l-16.797-5.59L9.602 59.22C22.77 39.465 44.586 27.477 68.227 26.89c24-15.594 51.765-23.825 80.425-23.825h3.746c21.223 0 41.778 4.457 61.102 13.239l48.855 22.203-24.316 12.156H361.57c6.559 0 11.899 5.336 11.899 11.898M18.184 104.207H28.41v5.95c0 4.831 1.55 9.406 4.324 13.25 2.391-.81 4.907-1.352 7.575-1.352h.671c2.094-10.27 9.434-18.86 19.668-22.274l22.356-7.453c-5.555-5.969-9.942-13.137-12.64-21.242l11.28-3.766a46.2 46.2 0 0 0 43.883 31.63h80.715c-2.476-11.259-11.824-20.106-23.664-21.587L164.5 75.11l1.477-11.804 18.078 2.254c19.793 2.476 34.726 19.39 34.726 39.343v17.153c1.692 0 3.332.191 4.922.523 4.54-9.398 6.977-19.828 6.977-30.27v-8.253l15.129 5.047c-4.778-13.536-13.274-25.149-24.649-33.68l-7.703-5.777 21.25-10.625-26.152-11.887c-17.754-8.074-36.649-12.164-56.16-12.164h-3.75c-25.504 0-50.2 7.172-71.774 20.629l4.89 19.574-11.534 2.887-4.747-19.016c-18.386 1.387-35.187 10.91-45.652 26.285l19.594 6.531-6.813 6.809a54.7 54.7 0 0 0-14.41 25.457Zm223.984-3.785c-.332 3.281-.934 6.523-1.652 9.734h97.254V86.36h-80.336c1.109 3.313 2.07 6.688 2.761 10.157l2.012 10.054-9.61-2.668Zm-17.629 224.547a13.19 13.19 0 0 0 6.14-11.18c.008-7.305-5.937-13.254-13.25-13.254-2.105 0-4.156.488-5.988 1.399l-10.39 5.195 16.101 22.539Zm-43.258-21.258c-3.894-13.45-12.847-24.559-24.484-31.406 1.137 2.136 2.14 4.363 2.86 6.757l9.253 30.844Zm61.305 10.078c0 3.727-.852 7.297-2.352 10.543h97.54v-35.695h-83.29c-6.562 0-11.898-5.336-11.898-11.899V264.84h-75.414c11.5 8.043 20.363 19.703 24.863 33.496l14.086-7.047a25.3 25.3 0 0 1 11.246-2.652c13.934 0 25.219 11.281 25.219 25.152m71.39-37.05v-11.9h-11.898v11.9Zm-23.796-11.9H278.28v11.9h11.899Zm-23.797 0h-11.899v11.9h11.899Zm71.39 0h-11.898v11.9h11.898Zm0-47.593h-83.289c-6.562 0-11.898-5.34-11.898-11.898v-11.903h-25.594c-5.187 25.446-21.27 46.93-43.11 59.496h163.891Zm-130.882-41.648v-35.696a5.957 5.957 0 0 0-5.95-5.949h-47.597a5.957 5.957 0 0 0-5.95 5.95v35.695a5.955 5.955 0 0 0 5.95 5.949h47.597a5.957 5.957 0 0 0 5.95-5.95m-53.547-53.543h47.597c2.094 0 4.079.43 5.95 1.093v-12.296h-81.364c-11.632 0-22.613-3.473-31.859-9.536l-29.254 9.75c-5.633 1.875-9.805 6.36-11.434 11.84 1.641-.5 3.36-.851 5.176-.851h47.594c9.84 0 17.848 8.007 17.848 17.847v5.95h11.898v-5.95c0-9.84 8.004-17.847 17.848-17.847m-95.188 59.492h47.594a5.95 5.95 0 0 0 5.95-5.95v-35.695a5.955 5.955 0 0 0-5.95-5.949H58.156a5.955 5.955 0 0 0-5.949 5.95v35.695a5.95 5.95 0 0 0 5.95 5.949m160.633-47.594v23.797c6.563 0 11.899-5.336 11.899-11.898 0-6.563-5.344-11.899-11.899-11.899m95.188 71.395v-11.903h-11.899v11.903Zm-23.797-11.903H278.28v11.903h11.899Zm-23.797 0h-11.899v11.903h11.899Zm71.39 0h-11.898v11.903h11.898Zm0-47.593h-77.34c-6.562 0-11.898-5.336-11.898-11.899v-11.898h-11.578c-.785 2.015-1.684 3.98-2.629 5.925 5.016 4.368 8.25 10.723 8.25 17.872 0 13.125-10.672 23.796-23.797 23.796v5.95c0 2.011-.172 3.976-.304 5.949H337.77v-35.695Zm-29.746-11.899v-11.898H290.18v11.898Zm-29.746-11.898h-17.847v11.898h17.847Zm59.492 0h-17.847v11.898h17.847ZM40.31 157.75v-23.797c-6.563 0-11.899 5.336-11.899 11.899s5.336 11.898 11.899 11.898m89.238 95.191c36.66 0 67.375-25.668 75.3-59.953-1.265.282-2.562.457-3.906.457h-47.597c-9.84 0-17.848-8.007-17.848-17.847V157.75h-11.898v17.848c0 9.84-8.008 17.847-17.848 17.847H58.156c-1.343 0-2.648-.175-3.91-.457 7.918 34.285 38.64 59.953 75.3 59.953m-5.469 107.086c-5.262-4.277-9.773-9.566-13.14-15.73l-11.145-20.43v36.16Zm83.031-23.96-16.824-23.555-20.61 10.304-5.062 10.125-10.644-5.324 4.898-9.785-10.61-35.36c-3.163-10.546-12.695-17.632-23.706-17.632-13.649 0-24.75 11.105-24.75 24.754v3.113c0 4.121 1.047 8.227 3.023 11.856l18.567 34.035a41.08 41.08 0 0 0 36.093 21.43 41.04 41.04 0 0 0 22.075-6.43ZM361.57 62.562H244.945a83 83 0 0 1 7.461 11.898h85.367c6.563 0 11.899 5.336 11.899 11.898v237.973c0 6.563-5.336 11.898-11.899 11.898H229.008l-18.692 11.899H361.57ZM260.434 300.535h-11.899v11.899h11.899Zm23.796 0h-11.898v11.899h11.898Zm-35.695-59.492h11.899v-11.898h-11.899Zm35.695-11.898h-11.898v11.898h11.898Zm-35.695-59.497h11.899V157.75h-11.899Zm35.695-11.898h-11.898v11.898h11.898Zm0 00:["rmOMwO5iLl1epok6IsNVY",[[["",{"children":["blog",{"children":[["slug","plausible-analytics","c"],{"children":["__PAGE__?{\"slug\":[\"plausible-analytics\"]}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["slug","plausible-analytics","c"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a9b9096fa657c0d0.css","precedence":"next","crossOrigin":"$undefined"}]]}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"en-us","className":"__variable_587f35 scroll-smooth","suppressHydrationWarning":true,"children":[["$","link",null,{"rel":"apple-touch-icon","sizes":"76x76","href":"/static/favicons/apple-touch-icon.png"}],["$","link",null,{"rel":"icon","type":"image/png","sizes":"32x32","href":"/static/favicons/favicon-32x32.png"}],["$","link",null,{"rel":"icon","type":"image/png","sizes":"16x16","href":"/static/favicons/favicon-16x16.png"}],["$","link",null,{"rel":"manifest","href":"/static/favicons/site.webmanifest"}],["$","link",null,{"rel":"mask-icon","href":"/static/favicons/safari-pinned-tab.svg","color":"#5bbad5"}],["$","meta",null,{"name":"msapplication-TileColor","content":"#000000"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"#fff"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"#000"}],["$","link",null,{"rel":"alternate","type":"application/rss+xml","href":"/feed.xml"}],["$","body",null,{"className":"bg-white pl-[calc(100vw-100%)] text-black antialiased dark:bg-gray-950 dark:text-white","children":["$","$L6",null,{"children":[["$undefined","$undefined","$undefined","$undefined","$undefined","$undefined"],["$","section",null,{"className":"mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0","children":[["$","$L7",null,{"kbarConfig":{"searchDocumentsPath":"/search.json"},"children":[["$","header",null,{"className":"flex items-center w-full bg-white dark:bg-gray-950 justify-between py-10","children":[["$","$L8",null,{"className":"break-words","href":"/","aria-label":"Self Host Labs","children":["$","div",null,{"className":"flex items-center justify-between","children":[["$","div",null,{"className":"mr-3","children":["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":500,"height":500,"viewBox":"0 0 375 375","className":"h-10 w-10 sm:h-12 sm:w-12","children":[["$","defs",null,{"children":[["$","clipPath",null,{"id":"SelfHostLabs_svg__a","children":["$","path",null,{"d":"M1 3.066h373V372H1Zm0 0"}]}],["$","clipPath",null,{"id":"SelfHostLabs_svg__b","children":["$","path",null,{"d":"$9"}]}]]}],["$","g",null,{"clipPath":"url(#SelfHostLabs_svg__a)","children":["$","g",null,{"clipPath":"url(#SelfHostLabs_svg__b)","children":["$","path",null,{"fill":"#0bb1d3","d":"M1.285 3.066v368.86H373.47V3.066Zm0 0"}]}]}]]}]}],["$","div",null,{"className":"hidden h-6 text-2xl font-semibold sm:block","children":"Self Host Labs"}]]}]}],["$","div",null,{"className":"flex items-center space-x-4 leading-5 sm:space-x-6","children":[["$","div",null,{"className":"no-scrollbar hidden max-w-40 items-center space-x-4 overflow-x-auto sm:flex sm:space-x-6 md:max-w-72 lg:max-w-96","children":[["$","$L8",null,{"className":"block font-medium text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400","href":"/blog","children":"Blog"}],["$","$L8",null,{"className":"block font-medium text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400","href":"/tags","children":"Tags"}],["$","a",null,{"className":"block font-medium text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400","target":"_blank","rel":"noopener noreferrer","href":"https://jadhav.dev","children":"About"}]]}],["$","$La",null,{"aria-label":"Search","children":["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24","strokeWidth":1.5,"stroke":"currentColor","className":"h-6 w-6 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400","children":["$","path",null,{"strokeLinecap":"round","strokeLinejoin":"round","d":"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"}]}]}],["$","$Lb",null,{}],["$","$Lc",null,{}]]}]]}],["$","main",null,{"className":"mb-auto","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":["$","div",null,{"className":"flex flex-col items-start justify-start md:mt-24 md:flex-row md:items-center md:justify-center md:space-x-6","children":[["$","div",null,{"className":"space-x-2 pb-8 pt-6 md:space-y-5","children":["$","h1",null,{"className":"text-6xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 md:border-r-2 md:px-6 md:text-8xl md:leading-14","children":"404"}]}],["$","div",null,{"className":"max-w-md","children":[["$","p",null,{"className":"mb-4 text-xl font-bold leading-normal md:text-2xl","children":"Sorry we couldn't find this page."}],["$","p",null,{"className":"mb-8","children":"But dont worry, you can find plenty of other things on our homepage."}],["$","$L8",null,{"className":"focus:shadow-outline-blue inline rounded-lg border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium leading-5 text-white shadow transition-colors duration-150 hover:bg-blue-700 focus:outline-none dark:hover:bg-blue-500","href":"/","children":"Back to homepage"}]]}]]}],"notFoundStyles":[],"styles":null}]}]]}],["$","footer",null,{"children":["$","div",null,{"className":"mt-16 flex flex-col items-center","children":[["$","div",null,{"className":"mb-3 flex space-x-4","children":[["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"mailto:selfhostlabs@jadhav.dev","children":[["$","span",null,{"className":"sr-only","children":"mail"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 20 20","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":[["$","title",null,{"children":"Mail"}],["$","path",null,{"d":"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z"}],["$","path",null,{"d":"M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"}]]}]]}],["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"https://github.com/selfhostlabs","children":[["$","span",null,{"className":"sr-only","children":"github"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 24 24","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":[["$","title",null,{"children":"GitHub"}],["$","path",null,{"d":"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"}]]}]]}],null,null,["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"https://www.linkedin.com/in/jadhav-karan/","children":[["$","span",null,{"className":"sr-only","children":"linkedin"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 24 24","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":[["$","title",null,{"children":"Linkedin"}],["$","path",null,{"d":"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"}]]}]]}],["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"https://twitter.com/iamkaranjadhav","children":[["$","span",null,{"className":"sr-only","children":"twitter"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 24 24","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":[["$","title",null,{"children":"Twitter"}],["$","path",null,{"d":"M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"}]]}]]}],null,null,null]}],["$","div",null,{"className":"mb-2 flex space-x-2 text-sm text-gray-500 dark:text-gray-400","children":[["$","div",null,{"children":"Karan Jadhav"}],["$","div",null,{"children":" • "}],["$","div",null,{"children":"© 2024"}],["$","div",null,{"children":" • "}],["$","$L8",null,{"className":"break-words","href":"/","children":"Self Host Labs"}]]}],["$","div",null,{"className":"mb-8 text-sm text-gray-500 dark:text-gray-400","children":["$","a",null,{"className":"break-words","target":"_blank","rel":"noopener noreferrer","href":"https://github.com/timlrx/tailwind-nextjs-starter-blog","children":"Tailwind Nextjs Theme"}]}]]}]}]]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/12f79b66d1500f09.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/11d10060d794138f.css","precedence":"next","crossOrigin":"$undefined"}]],"$Ld"]]]] e:I[4347,["231","static/chunks/231-42eeaa612179830e.js","173","static/chunks/173-6f0f3c0be6f44ec5.js","797","static/chunks/app/blog/%5B...slug%5D/page-11e23acd1756039c.js"],"default"] f:I[8173,["231","static/chunks/231-42eeaa612179830e.js","173","static/chunks/173-6f0f3c0be6f44ec5.js","797","static/chunks/app/blog/%5B...slug%5D/page-11e23acd1756039c.js"],"Image"] 10:I[408,["231","static/chunks/231-42eeaa612179830e.js","173","static/chunks/173-6f0f3c0be6f44ec5.js","797","static/chunks/app/blog/%5B...slug%5D/page-11e23acd1756039c.js"],"default"] 11:I[9629,["231","static/chunks/231-42eeaa612179830e.js","173","static/chunks/173-6f0f3c0be6f44ec5.js","797","static/chunks/app/blog/%5B...slug%5D/page-11e23acd1756039c.js"],"default"] 2:[["$","script",null,{"type":"application/ld+json","dangerouslySetInnerHTML":{"__html":"{\"@context\":\"https://schema.org\",\"@type\":\"BlogPosting\",\"headline\":\"Self hosting Plausible Analytics with Docker\",\"datePublished\":\"2024-03-24T00:00:00.000Z\",\"dateModified\":\"2024-03-24T00:00:00.000Z\",\"description\":\"This is a guide to self host Plausible Analytics using Docker.\",\"image\":\"/static/images/twitter-card.png\",\"url\":\"https://selfhostlabs.dev/blog/plausible-analytics\",\"author\":[{\"@type\":\"Person\",\"name\":\"Karan Jadhav\"}]}"}}],["$","section",null,{"className":"mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0","children":[["$","$Le",null,{}],["$","article",null,{"children":["$","div",null,{"className":"xl:divide-y xl:divide-gray-200 xl:dark:divide-gray-700","children":[["$","header",null,{"className":"pt-6 xl:pb-6","children":["$","div",null,{"className":"space-y-1 text-center","children":[["$","dl",null,{"className":"space-y-10","children":["$","div",null,{"children":[["$","dt",null,{"className":"sr-only","children":"Published on"}],["$","dd",null,{"className":"text-base font-medium leading-6 text-gray-500 dark:text-gray-400","children":["$","time",null,{"dateTime":"2024-03-24T00:00:00.000Z","children":"Sunday, March 24, 2024"}]}]]}]}],["$","div",null,{"children":["$","h1",null,{"className":"text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-5xl md:leading-14","children":"Self hosting Plausible Analytics with Docker"}]}]]}]}],["$","div",null,{"className":"grid-rows-[auto_1fr] divide-y divide-gray-200 pb-8 dark:divide-gray-700 xl:grid xl:grid-cols-4 xl:gap-x-6 xl:divide-y-0","children":[["$","dl",null,{"className":"pb-10 pt-6 xl:border-b xl:border-gray-200 xl:pt-11 xl:dark:border-gray-700","children":[["$","dt",null,{"className":"sr-only","children":"Authors"}],["$","dd",null,{"children":["$","ul",null,{"className":"flex flex-wrap justify-center gap-4 sm:space-x-12 xl:block xl:space-x-0 xl:space-y-8","children":[["$","li","Karan Jadhav",{"className":"flex items-center space-x-2","children":[["$","$Lf",null,{"src":"/static/images/avatar.png","width":38,"height":38,"alt":"avatar","className":"h-10 w-10 rounded-full"}],["$","dl",null,{"className":"whitespace-nowrap text-sm font-medium leading-5","children":[["$","dt",null,{"className":"sr-only","children":"Name"}],["$","dd",null,{"className":"text-gray-900 dark:text-gray-100","children":"Karan Jadhav"}],["$","dt",null,{"className":"sr-only","children":"Twitter"}],["$","dd",null,{"children":["$","a",null,{"className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","target":"_blank","rel":"noopener noreferrer","href":"https://twitter.com/iamkaranjadhav","children":"@iamkaranjadhav"}]}]]}]]}]]}]}]]}],["$","div",null,{"className":"divide-y divide-gray-200 dark:divide-gray-700 xl:col-span-3 xl:row-span-2 xl:pb-0","children":[["$","div",null,{"className":"prose max-w-none pb-8 pt-10 dark:prose-invert","children":[["$","h2",null,{"className":"content-header","id":"introduction","children":[["$","a",null,{"className":"break-words","href":"#introduction","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Introduction"]}],["$","p",null,{"children":"Hey Everyone, in todays post we are going to learn how to self host Plausible Analytics using Docker. We will configure the Plausible Analytics to run behind a reverse proxy using its built-in Caddy server with HTTPS enabled."}],["$","ul",null,{"className":"","children":[["$","li","0",{"className":"","children":[["$","a",null,{"href":"#what-is-plausible-analytics","children":"What is Plausible Analytics?"}],null]}],["$","li","1",{"className":"","children":[["$","a",null,{"href":"#prerequisites","children":"Prerequisites"}],null]}],["$","li","2",{"className":"","children":[["$","a",null,{"href":"#installation","children":"Installation"}],["$","ul",null,{"className":"","children":[["$","li","0",{"className":"","children":[["$","a",null,{"href":"#step-1-update-the-system","children":"Step 1: Update the system"}],null]}],["$","li","1",{"className":"","children":[["$","a",null,{"href":"#step-2-clone-the-plausible-analytics-repository","children":"Step 2: Clone the Plausible Analytics repository"}],null]}],["$","li","2",{"className":"","children":[["$","a",null,{"href":"#step-3-configure-plausible-analytics","children":"Step 3: Configure Plausible Analytics"}],null]}],["$","li","3",{"className":"","children":[["$","a",null,{"href":"#step-4-configure-dns-records-for-the-domain","children":"Step 4: Configure DNS records for the domain"}],null]}]]}]]}],["$","li","3",{"className":"","children":[["$","a",null,{"href":"#step-5-run-the-plausible-analytics","children":"Step 5: Run the Plausible Analytics"}],null]}]]}],["$","h2",null,{"className":"content-header","id":"what-is-plausible-analytics","children":[["$","a",null,{"className":"break-words","href":"#what-is-plausible-analytics","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"What is Plausible Analytics?"]}],["$","p",null,{"children":["According to ",["$","a",null,{"className":"break-words","target":"_blank","rel":"noopener noreferrer","href":"https://plausible.io/","children":"Plausible Analytics"}],": Plausible Analytics is a simple, open-source, lightweight (< 1 KB), and privacy-friendly alternative to Google Analytics. It doesn't use cookies and is fully compliant with GDPR, CCPA, and PECR. It's a great way to get insights into your website traffic without compromising your users' privacy."]}],["$","h2",null,{"className":"content-header","id":"prerequisites","children":[["$","a",null,{"className":"break-words","href":"#prerequisites","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Prerequisites"]}],["$","ul",null,{"children":[["$","li",null,{"children":"A server running Ubuntu 20.04 or more recent. This guide will use Ubuntu 20.04."}],["$","li",null,{"children":"A non-root user with sudo privileges."}],["$","li",null,{"children":"A domain name pointed at your server's IP address. (will configure it to run behind a reverse proxy later)"}],["$","li",null,{"children":["Docker installed on your server. You can follow the guide ",["$","a",null,{"className":"break-words","target":"_blank","rel":"noopener noreferrer","href":"https://docs.docker.com/engine/install/ubuntu/","children":"here"}]," to install Docker on your server."]}]]}],["$","h2",null,{"className":"content-header","id":"installation","children":[["$","a",null,{"className":"break-words","href":"#installation","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Installation"]}],["$","h3",null,{"className":"content-header","id":"step-1-update-the-system","children":[["$","a",null,{"className":"break-words","href":"#step-1-update-the-system","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Step 1: Update the system"]}],["$","p",null,{"children":"Before we start, its always better to update the system to the latest version. You can do it by running following command"}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," update ",["$","span",null,{"className":"token operator","children":"&&"}]," ",["$","span",null,{"className":"token function","children":"sudo"}]," ",["$","span",null,{"className":"token function","children":"apt"}]," upgrade\n"]}]}]}],["$","h3",null,{"className":"content-header","id":"step-2-clone-the-plausible-analytics-repository","children":[["$","a",null,{"className":"break-words","href":"#step-2-clone-the-plausible-analytics-repository","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Step 2: Clone the Plausible Analytics repository"]}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":"Create a new directory to install Plausible Analytics and navigate to it."}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token function","children":"mkdir"}]," analytics\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token builtin class-name","children":"cd"}]," analytics\n"]}]]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["clone the Plausible Analytics repository from their Github. ",["$","a",null,{"className":"break-words","target":"_blank","rel":"noopener noreferrer","href":"https://github.com/plausible/community-editio","children":"Plausible Analytics Github"}]]}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"git"}]," clone https://github.com/plausible/community-edition.git\n"]}]}]}],["$","p",null,{"children":"output:"}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":["ubuntu@selfhostlabs:~$ ",["$","span",null,{"className":"token function","children":"git"}]," clone https://github.com/plausible/community-edition ",["$","span",null,{"className":"token builtin class-name","children":"."}],"\n"]}],["$","span",null,{"className":"code-line","children":["Cloning into ",["$","span",null,{"className":"token string","children":"'analytics'"}],["$","span",null,{"className":"token punctuation","children":".."}],".\n"]}],["$","span",null,{"className":"code-line","children":["remote: Enumerating objects: ",["$","span",null,{"className":"token number","children":"342"}],", done.\n"]}],["$","span",null,{"className":"code-line","children":["remote: Counting objects: ",["$","span",null,{"className":"token number","children":"100"}],"% ",["$","span",null,{"className":"token punctuation","children":"("}],["$","span",null,{"className":"token number","children":"210"}],"/210",["$","span",null,{"className":"token punctuation","children":")"}],", done.\n"]}],["$","span",null,{"className":"code-line","children":["remote: Compressing objects: ",["$","span",null,{"className":"token number","children":"100"}],"% ",["$","span",null,{"className":"token punctuation","children":"("}],["$","span",null,{"className":"token number","children":"125"}],"/125",["$","span",null,{"className":"token punctuation","children":")"}],", done.\n"]}],["$","span",null,{"className":"code-line","children":["remote: Total ",["$","span",null,{"className":"token number","children":"342"}]," ",["$","span",null,{"className":"token punctuation","children":"("}],"delta ",["$","span",null,{"className":"token number","children":"116"}],["$","span",null,{"className":"token punctuation","children":")"}],", reused ",["$","span",null,{"className":"token number","children":"149"}]," ",["$","span",null,{"className":"token punctuation","children":"("}],"delta ",["$","span",null,{"className":"token number","children":"84"}],["$","span",null,{"className":"token punctuation","children":")"}],", pack-reused ",["$","span",null,{"className":"token number","children":"132"}],"\n"]}],["$","span",null,{"className":"code-line","children":["Receiving objects: ",["$","span",null,{"className":"token number","children":"100"}],"% ",["$","span",null,{"className":"token punctuation","children":"("}],["$","span",null,{"className":"token number","children":"342"}],"/342",["$","span",null,{"className":"token punctuation","children":")"}],", ",["$","span",null,{"className":"token number","children":"8.50"}]," MiB ",["$","span",null,{"className":"token operator","children":"|"}]," ",["$","span",null,{"className":"token number","children":"5.08"}]," MiB/s, done.\n"]}],["$","span",null,{"className":"code-line","children":["Resolving deltas: ",["$","span",null,{"className":"token number","children":"100"}],"% ",["$","span",null,{"className":"token punctuation","children":"("}],["$","span",null,{"className":"token number","children":"145"}],"/145",["$","span",null,{"className":"token punctuation","children":")"}],", done.\n"]}]]}]}]]}]]}],["$","p",null,{"children":"This are the files which we are going to use to run the Plausible Analytics."}],["$","ul",null,{"children":[["$","li",null,{"children":[["$","strong",null,{"children":"docker-compose.yml"}],": This file contains the configuration to run the Plausible Analytics using Docker."]}],["$","li",null,{"children":[["$","strong",null,{"children":"plausible-conf.env"}],": This file contains the configuration for the Plausible Analytics."]}],["$","li",null,{"children":[["$","strong",null,{"children":"reverse-proxy/docker-compose.caddy-gen.yml"}],": This file contains the configuration to run the Caddy server which will act as a reverse proxy for the Plausible Analytics."]}]]}],["$","h3",null,{"className":"content-header","id":"step-3-configure-plausible-analytics","children":[["$","a",null,{"className":"break-words","href":"#step-3-configure-plausible-analytics","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Step 3: Configure Plausible Analytics"]}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":["Let's start with configuring the configuration environment file ",["$","code",null,{"children":"plausible-conf.env"}],". Here is the default configuration which comes with the repository."]}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token variable assign-left","children":"BASE_URL"}],["$","span",null,{"className":"token operator","children":"="}],"replace-me\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token variable assign-left","children":"SECRET_KEY_BASE"}],["$","span",null,{"className":"token operator","children":"="}],"replace-me\n"]}]]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Replace the ",["$","code",null,{"children":"BASE_URL"}]," with the domain which you want to use for serving the analytics. In my case, I will be using ",["$","code",null,{"children":"analytics.selfhostlabs.dev"}],"."]}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token variable assign-left","children":"BASE_URL"}],["$","span",null,{"className":"token operator","children":"="}],"https://analytics.selfhostlabs.dev\n"]}]}]}],["$","p",null,{"children":"we have used https as we will be configuring the Caddy server to serve the Plausible Analytics using HTTPS later in the post."}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Put a random string in the ",["$","code",null,{"children":"SECRET_KEY_BASE"}]," field. You can generate a random string using the following command."]}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":["openssl rand ",["$","span",null,{"className":"token variable parameter","children":"-base64"}]," ",["$","span",null,{"className":"token number","children":"48"}],"\n"]}]}]}],["$","p",null,{"children":"output:"}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":["ubuntu@selfhostlabs:~/analytics$ openssl rand ",["$","span",null,{"className":"token variable parameter","children":"-base64"}]," ",["$","span",null,{"className":"token number","children":"48"}],"\n"]}],["$","span",null,{"className":"code-line","children":"S6KYL2R9hEPBsjN2Lc8+Q8wjItcKZQ6OZgnH1OkeqkOwcfNSFWNKLL1ORuW1WF+p\n"}]]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Copy the generated string and replace the ",["$","code",null,{"children":"SECRET_KEY_BASE"}]," with it."]}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token variable assign-left","children":"SECRET_KEY_BASE"}],["$","span",null,{"className":"token operator","children":"="}],"S6KYL2R9hEPBsjN2Lc8+Q8wjItcKZQ6OZgnH1OkeqkOwcfNSFWNKLL1ORuW1WF+p\n"]}]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Here is the updated ",["$","code",null,{"children":"plausible-conf.env"}]," file."]}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token variable assign-left","children":"BASE_URL"}],["$","span",null,{"className":"token operator","children":"="}],"https://analytics.selfhostlabs.dev\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token variable assign-left","children":"SECRET_KEY_BASE"}],["$","span",null,{"className":"token operator","children":"="}],"S6KYL2R9hEPBsjN2Lc8+Q8wjItcKZQ6OZgnH1OkeqkOwcfNSFWNKLL1ORuW1WF+p\n"]}]]}]}],["$","p",null,{"children":"Make sure to replace the domain name and secret key with your actual domain name and secret key."}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Now we have to configure the reverse proxy to serve the Plausible Analytics using HTTPS. We will use the Caddy server which comes with the repository. Open the ",["$","code",null,{"children":"reverse-proxy/docker-compose.caddy-gen.yml"}]," file to start configuring it."]}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"nano"}]," reverse-proxy/docker-compose.caddy-gen.yml\n"]}]}]}],["$","p",null,{"children":"Check the plausible block in the file. Here is the default configuration."}],["$","$L10",null,{"className":"language-yaml","children":["$","code",null,{"className":"code-highlight language-yaml","children":[["$","span",null,{"className":"code-line line-number","line":"1","children":[["$","span",null,{"className":"token atrule key","children":"plausible"}],["$","span",null,{"className":"token punctuation","children":":"}],"\n"]}],["$","span",null,{"className":"code-line line-number","line":"2","children":[" ",["$","span",null,{"className":"token atrule key","children":"labels"}],["$","span",null,{"className":"token punctuation","children":":"}],"\n"]}],["$","span",null,{"className":"code-line line-number","line":"3","children":[" ",["$","span",null,{"className":"token atrule key","children":"virtual.host"}],["$","span",null,{"className":"token punctuation","children":":"}]," ",["$","span",null,{"className":"token string","children":"\"example.com\""}]," ",["$","span",null,{"className":"token comment","children":"# change to your domain name"}],"\n"]}],["$","span",null,{"className":"code-line line-number","line":"4","children":[" ",["$","span",null,{"className":"token atrule key","children":"virtual.port"}],["$","span",null,{"className":"token punctuation","children":":"}]," ",["$","span",null,{"className":"token string","children":"\"8000\""}],"\n"]}],["$","span",null,{"className":"code-line line-number","line":"5","children":[" ",["$","span",null,{"className":"token atrule key","children":"virtual.tls-email"}],["$","span",null,{"className":"token punctuation","children":":"}]," ",["$","span",null,{"className":"token string","children":"\"admin@example.com\""}]," ",["$","span",null,{"className":"token comment","children":"# change to your email"}],"\n"]}]]}]}]]}],["$","li",null,{"children":[["$","p",null,{"children":["Replace the ",["$","code",null,{"children":"virtual.host"}]," with the domain name with the domain which we used in the ",["$","code",null,{"children":"plausible-conf.env"}]," file. It will be used to serve the Plausible Analytics and also put the email address in the ",["$","code",null,{"children":"virtual.tls-email"}]," field. Here is the updated configuration."]}],["$","$L10",null,{"className":"language-yaml","children":["$","code",null,{"className":"code-highlight language-yaml","children":[["$","span",null,{"className":"code-line line-number","line":"1","children":[["$","span",null,{"className":"token atrule key","children":"plausible"}],["$","span",null,{"className":"token punctuation","children":":"}],"\n"]}],["$","span",null,{"className":"code-line line-number","line":"2","children":[" ",["$","span",null,{"className":"token atrule key","children":"labels"}],["$","span",null,{"className":"token punctuation","children":":"}],"\n"]}],["$","span",null,{"className":"code-line line-number highlight-line","line":"3","children":[" ",["$","span",null,{"className":"token atrule key","children":"virtual.host"}],["$","span",null,{"className":"token punctuation","children":":"}]," ",["$","span",null,{"className":"token string","children":"\"analytics.selfhostlabs.dev\""}],"\n"]}],["$","span",null,{"className":"code-line line-number","line":"4","children":[" ",["$","span",null,{"className":"token atrule key","children":"virtual.port"}],["$","span",null,{"className":"token punctuation","children":":"}]," ",["$","span",null,{"className":"token string","children":"\"8000\""}],"\n"]}],["$","span",null,{"className":"code-line line-number highlight-line","line":"5","children":[" ",["$","span",null,{"className":"token atrule key","children":"virtual.tls-email"}],["$","span",null,{"className":"token punctuation","children":":"}]," ",["$","span",null,{"className":"token string","children":"\"lab@selfhostlabs.dev\""}],"\n"]}]]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"Save and exit the file."}]}]]}],["$","h3",null,{"className":"content-header","id":"step-4-configure-dns-records-for-the-domain","children":[["$","a",null,{"className":"break-words","href":"#step-4-configure-dns-records-for-the-domain","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Step 4: Configure DNS records for the domain"]}],["$","ol",null,{"children":[["$","li",null,{"children":["$","p",null,{"children":["Let's configure the DNS records for the domain which we are going to use to serve the Analytics. For this, we will create an A record pointing your domain to the IP address of the server. In my case, I will be using ",["$","code",null,{"children":"analytics.selfhostlabs.dev"}]," as the domain to point to 159.65.157.121."]}]}],["$","li",null,{"children":["$","p",null,{"children":"Login to your domain registrar and navigate to the DNS management section."}]}],["$","li",null,{"children":[["$","p",null,{"children":"Create an A record with the following details."}],["$","ul",null,{"children":[["$","li",null,{"children":"Record Type: A"}],["$","li",null,{"children":"Host: your domain name (analytics)"}],["$","li",null,{"children":"Points to: IP address of your server"}]]}],["$","$Lf",null,{"src":"/static/images/plausible-analytics/dns_records.png","alt":"DNS Records","width":"1080","height":"720"}]]}],["$","li",null,{"children":["$","p",null,{"children":["Save the changes and the DNS records will be updated. It may take some time to propagate the DNS records. You can check the propagation status using ",["$","a",null,{"className":"break-words","target":"_blank","rel":"noopener noreferrer","href":"https://www.whatsmydns.net/","children":"whatsmydns.net"}],"."]}]}],["$","li",null,{"children":["$","p",null,{"children":"Once the DNS records are propagated, you can proceed to the next step."}]}]]}],["$","h2",null,{"className":"content-header","id":"step-5-run-the-plausible-analytics","children":[["$","a",null,{"className":"break-words","href":"#step-5-run-the-plausible-analytics","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"content-header-link","children":["$","svg",null,{"className":"h-5 linkicon w-5","fill":"currentColor","viewBox":"0 0 20 20","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z"}],["$","path",null,{"d":"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z"}]]}]}]}],"Step 5: Run the Plausible Analytics"]}],["$","ol",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":"Now that we have configured everything, let's start with running the Plausible Analytics using Docker. Navigate to the directory where you have cloned the repository and run the following command."}],["$","$L10",null,{"className":"language-bash","children":["$","code",null,{"className":"language-bash code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token function","children":"docker"}]," compose ",["$","span",null,{"className":"token variable parameter","children":"-f"}]," docker-compose.yml ",["$","span",null,{"className":"token variable parameter","children":"-f"}]," reverse-proxy/docker-compose.caddy-gen.yml up ",["$","span",null,{"className":"token variable parameter","children":"-d"}],"\n"]}]}]}]]}],["$","li",null,{"children":["$","p",null,{"children":"It will start with downloading the required images and then start the Plausible Analytics and Caddy reverse proxy server. Once the services are up and running, you can go to the domain which you have configured to access the Plausible Analytics."}]}],["$","li",null,{"children":[["$","p",null,{"children":"Open the domain in the browser and it will show you folowing screen and ask you to create an account."}],["$","$Lf",null,{"src":"/static/images/plausible-analytics/create_account.png","alt":"Create Account","width":"1080","height":"720"}]]}],["$","li",null,{"children":[["$","p",null,{"children":"fill in the details and click on \"Create account\" button. Once the account is created, you will be redirected to the setup page where you have to fill in the details about your website."}],["$","$Lf",null,{"src":"/static/images/plausible-analytics/setup_domain.png","alt":"Setup Domain","width":"1080","height":"720"}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Fill in the details and click on \"Add snippet\" button. It will show you the snippet which you have to add to head section of your website."}],["$","$Lf",null,{"src":"/static/images/plausible-analytics/add_snippet.png","alt":"Add Snippet","width":"1080","height":"720"}]]}],["$","li",null,{"children":[["$","p",null,{"children":"Click on \"Start Collecting data\" button and you will be redirected to the dashboard where you can see Plausible Analytics started to listening to the events."}],["$","$Lf",null,{"src":"/static/images/plausible-analytics/analytics_dashboard.png","alt":"Analytics Dashboard","width":"1080","height":"720"}]]}]]}],["$","p",null,{"children":"Here we have successfully installed and configured the Plausible Analytics to run behind a reverse proxy using Docker. You can start using the Plausible Analytics to track the events on your website."}],["$","p",null,{"children":"I hope this post was helpful to you. Please let me know your feedback in the comments section."}],["$","p",null,{"children":"Thank you for reading."}]]}],["$","div",null,{"className":"pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300","children":[["$","a",null,{"className":"break-words","target":"_blank","rel":"nofollow","href":"https://mobile.twitter.com/search?q=https%3A%2F%2Fselfhostlabs.dev%2Fblog%2Fplausible-analytics","children":"Discuss on Twitter"}]," • ",["$","a",null,{"className":"break-words","target":"_blank","rel":"noopener noreferrer","href":"https://github.com/selfhostlabs/selfhostlabs.dev/blob/main/data/blog/plausible-analytics.mdx","children":"View on GitHub"}]]}],["$","div",null,{"className":"pb-6 pt-6 text-center text-gray-700 dark:text-gray-300","id":"comment","children":["$","$L11",null,{"slug":"plausible-analytics"}]}]]}],["$","footer",null,{"children":[["$","div",null,{"className":"divide-gray-200 text-sm font-medium leading-5 dark:divide-gray-700 xl:col-start-1 xl:row-start-2 xl:divide-y","children":[["$","div",null,{"className":"py-4 xl:py-8","children":[["$","h2",null,{"className":"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400","children":"Tags"}],["$","div",null,{"className":"flex flex-wrap","children":[["$","$L8",null,{"href":"/tags/docker","className":"mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":"docker"}],["$","$L8",null,{"href":"/tags/analytics","className":"mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":"analytics"}]]}]]}],["$","div",null,{"className":"flex justify-between py-4 xl:block xl:space-y-8 xl:py-8","children":[["$","div",null,{"children":[["$","h2",null,{"className":"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400","children":"Previous Article"}],["$","div",null,{"className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":["$","$L8",null,{"className":"break-words","href":"/blog/nextcloud-snap","children":"Self hosting NextCloud with snap on Ubuntu"}]}]]}],["$","div",null,{"children":[["$","h2",null,{"className":"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400","children":"Next Article"}],["$","div",null,{"className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":["$","$L8",null,{"className":"break-words","href":"/blog/wordpress-nginx","children":"Self hosting WordPress with Nginx on Ubuntu"}]}]]}]]}]]}],["$","div",null,{"className":"pt-4 xl:pt-8","children":["$","$L8",null,{"className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","href":"/blog","aria-label":"Back to the blog","children":"← Back to the blog"}]}]]}]]}]]}]}]]}]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Self hosting Plausible Analytics with Docker | Self Host Labs"}],["$","meta","3",{"name":"description","content":"This is a guide to self host Plausible Analytics using Docker."}],["$","meta","4",{"name":"robots","content":"index, follow"}],["$","meta","5",{"name":"googlebot","content":"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"}],["$","link","6",{"rel":"canonical","href":"https://selfhostlabs.dev/blog/plausible-analytics"}],["$","link","7",{"rel":"alternate","type":"application/rss+xml","href":"https://selfhostlabs.dev/feed.xml"}],["$","meta","8",{"property":"og:title","content":"Self hosting Plausible Analytics with Docker"}],["$","meta","9",{"property":"og:description","content":"This is a guide to self host Plausible Analytics using Docker."}],["$","meta","10",{"property":"og:url","content":"https://selfhostlabs.dev/blog/plausible-analytics"}],["$","meta","11",{"property":"og:site_name","content":"Self Host Labs"}],["$","meta","12",{"property":"og:locale","content":"en_US"}],["$","meta","13",{"property":"og:image","content":"https://selfhostlabs.dev/static/images/twitter-card.png"}],["$","meta","14",{"property":"og:type","content":"article"}],["$","meta","15",{"property":"article:published_time","content":"2024-03-24T00:00:00.000Z"}],["$","meta","16",{"property":"article:modified_time","content":"2024-03-24T00:00:00.000Z"}],["$","meta","17",{"property":"article:author","content":"Karan Jadhav"}],["$","meta","18",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","19",{"name":"twitter:title","content":"Self hosting Plausible Analytics with Docker"}],["$","meta","20",{"name":"twitter:description","content":"This is a guide to self host Plausible Analytics using Docker."}],["$","meta","21",{"name":"twitter:image","content":"https://selfhostlabs.dev/static/images/twitter-card.png"}],["$","meta","22",{"name":"next-size-adjust"}]] 1:null