mirror of
https://github.com/pterodactyl/documentation.git
synced 2025-12-12 09:21:59 -06:00
60 lines
16 KiB
HTML
60 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>Creating SSL Certificates | Pterodactyl</title>
|
|
<meta name="description" content="The open-source server management solution.">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
|
|
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
|
|
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#0e4688">
|
|
<link rel="manifest" href="/favicons/manifest.json">
|
|
<link rel="shortcut icon" href="/favicons/favicon.ico">
|
|
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
|
|
<meta name="theme-color" content="#0e4688">
|
|
|
|
<link rel="preload" href="/assets/css/0.styles.55a8b33d.css" as="style"><link rel="preload" href="/assets/js/app.8a5a7210.js" as="script"><link rel="preload" href="/assets/js/43.1a2eda90.js" as="script"><link rel="prefetch" href="/assets/js/14.1acbaf05.js"><link rel="prefetch" href="/assets/js/2.7fc94278.js"><link rel="prefetch" href="/assets/js/3.22ad5684.js"><link rel="prefetch" href="/assets/js/4.3b524e63.js"><link rel="prefetch" href="/assets/js/5.be11e27b.js"><link rel="prefetch" href="/assets/js/6.f6e18708.js"><link rel="prefetch" href="/assets/js/7.5774c870.js"><link rel="prefetch" href="/assets/js/8.2e6c9ec6.js"><link rel="prefetch" href="/assets/js/9.27358f20.js"><link rel="prefetch" href="/assets/js/10.ebe1af5e.js"><link rel="prefetch" href="/assets/js/11.e1ef5e68.js"><link rel="prefetch" href="/assets/js/12.15f026d8.js"><link rel="prefetch" href="/assets/js/13.58cd6ae7.js"><link rel="prefetch" href="/assets/js/15.a80c3281.js"><link rel="prefetch" href="/assets/js/16.efed23e1.js"><link rel="prefetch" href="/assets/js/17.a51b9114.js"><link rel="prefetch" href="/assets/js/18.734de936.js"><link rel="prefetch" href="/assets/js/19.a135716b.js"><link rel="prefetch" href="/assets/js/20.340ea65f.js"><link rel="prefetch" href="/assets/js/21.787eeb3c.js"><link rel="prefetch" href="/assets/js/22.8df0a15b.js"><link rel="prefetch" href="/assets/js/23.9cff30d6.js"><link rel="prefetch" href="/assets/js/24.3261f567.js"><link rel="prefetch" href="/assets/js/25.c4cc872f.js"><link rel="prefetch" href="/assets/js/26.f030abd8.js"><link rel="prefetch" href="/assets/js/27.e1d5f531.js"><link rel="prefetch" href="/assets/js/28.0e1e014b.js"><link rel="prefetch" href="/assets/js/29.30f44579.js"><link rel="prefetch" href="/assets/js/30.5aa49dc8.js"><link rel="prefetch" href="/assets/js/31.1d54397d.js"><link rel="prefetch" href="/assets/js/32.b84c8ea1.js"><link rel="prefetch" href="/assets/js/33.468c5898.js"><link rel="prefetch" href="/assets/js/34.05b35e32.js"><link rel="prefetch" href="/assets/js/35.4a6c0b34.js"><link rel="prefetch" href="/assets/js/36.0fadefe0.js"><link rel="prefetch" href="/assets/js/37.dcdbe2c7.js"><link rel="prefetch" href="/assets/js/38.bc8538e8.js"><link rel="prefetch" href="/assets/js/39.e2bae673.js"><link rel="prefetch" href="/assets/js/40.ed0f62dd.js"><link rel="prefetch" href="/assets/js/41.00c13272.js"><link rel="prefetch" href="/assets/js/42.6772fc89.js"><link rel="prefetch" href="/assets/js/44.f3586402.js">
|
|
<link rel="stylesheet" href="/assets/css/0.styles.55a8b33d.css">
|
|
</head>
|
|
<body>
|
|
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="nav"><div class="sidebar-button block md:hidden flex-no-shrink"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <div class="logo-container"><a href="/" class="home-link router-link-active"><img src="/pterodactyl-flat.png" class="logo"> <span class="site-name hidden md:inline can-hide">
|
|
Pterodactyl
|
|
</span></a></div> <div class="w-full"><div class="flex"><div class="search-box"><input aria-label="Search" placeholder="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links flex-no-shrink hidden md:flex"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
|
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
|
</a></div><div class="nav-item"><a href="https://pterodactyl.io/discord" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
Get Help
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
|
Contribute
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></nav></div></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links flex-no-shrink block md:hidden"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
|
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
|
</a></div><div class="nav-item"><a href="https://pterodactyl.io/discord" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
Get Help
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
|
Contribute
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></nav> <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading"><span>Project Information</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/project/introduction.html" class="sidebar-link">Introduction</a></li><li><a href="/project/about.html" class="sidebar-link">About</a></li><li><a href="/project/terms.html" class="sidebar-link">Terminology</a></li><li><a href="/project/community.html" class="sidebar-link">Community Standards</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Panel</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/panel/getting_started.html" class="sidebar-link">Getting Started</a></li><li><a href="/panel/webserver_configuration.html" class="sidebar-link">Webserver Configuration</a></li><li><a href="/panel/upgrading.html" class="sidebar-link">Upgrading</a></li><li><a href="/panel/configuration.html" class="sidebar-link">Environment Configuration</a></li><li><a href="/panel/troubleshooting.html" class="sidebar-link">Troubleshooting</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Daemon</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/daemon/installing.html" class="sidebar-link">Installation</a></li><li><a href="/daemon/upgrading.html" class="sidebar-link">Upgrading</a></li><li><a href="/daemon/configuration.html" class="sidebar-link">Additional Configuration</a></li><li><a href="/daemon/kernel_modifications.html" class="sidebar-link">Kernel Modifications</a></li><li><a href="/daemon/debian_8_docker.html" class="sidebar-link">Docker on Debian 8</a></li><li><a href="/daemon/standalone_sftp.html" class="sidebar-link">Standalone SFTP Server</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading open"><span>Tutorials</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/tutorials/mysql_setup.html" class="sidebar-link">Setting up MySQL</a></li><li><a href="/tutorials/creating_ssl_certificates.html" class="active sidebar-link">Creating SSL Certificates</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/tutorials/creating_ssl_certificates.html#method-1-using-certbot" class="sidebar-link">Method 1: Using Certbot</a></li><li class="sidebar-sub-header"><a href="/tutorials/creating_ssl_certificates.html#troubleshooting" class="sidebar-link">Troubleshooting</a></li></ul></li></ul></div></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>Development & Ops</span> <span class="arrow right"></span></p> <!----></div></li></ul> </div> <div class="page"> <div class="content"><h1 id="creating-ssl-certificates"><a href="#creating-ssl-certificates" aria-hidden="true" class="header-anchor">#</a> Creating SSL Certificates</h1> <p>This tutorial briefly covers creating new SSL certificates for your panel and daemon using LetsEncrypt™.</p> <h2 id="method-1-using-certbot"><a href="#method-1-using-certbot" aria-hidden="true" class="header-anchor">#</a> Method 1: Using Certbot</h2> <p>To begin, we will be installing certbot, a simple script that will automatically renew our certificates and allow much
|
|
cleaner creation of them. The command below is for Ubuntu distributions, but you can always check <a href="https://certbot.eff.org/" target="_blank" rel="noopener noreferrer">Certbot's official
|
|
site<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> for installation instructions.</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> add-apt-repository ppa:certbot/certbot
|
|
<span class="token function">sudo</span> apt update
|
|
<span class="token function">sudo</span> apt <span class="token function">install</span> certbot
|
|
</code></pre></div><h3 id="creating-a-certificate"><a href="#creating-a-certificate" aria-hidden="true" class="header-anchor">#</a> Creating a Certificate</h3> <p>After installing certbot, we need to then generate a certificate. There are a couple ways to do that, but the
|
|
easiest is to have letsencrypt spin-up a temporary web-server to do this. In order for this to work, you will
|
|
first need to stop NGINX or Apache.</p> <p>Then, in the command below, you should replace <code>example.com</code> with the domain you would like to generate a certificate
|
|
for. If you have multiple domains you would like certificates for, simply add more <code>-d anotherdomain.com</code> flags to the
|
|
command. You can also look into generating a wildcard certificate but that is not covered in this tutorial.</p> <p>Once you've generated the certificate you should start NGINX or Apache again to have the certificates applied (assuming
|
|
that you've already configured the webservers to use SSL).</p> <div class="language-bash extra-class"><pre class="language-bash"><code>certbot certonly -d example.com
|
|
</code></pre></div><h3 id="auto-renewal"><a href="#auto-renewal" aria-hidden="true" class="header-anchor">#</a> Auto Renewal</h3> <p>You'll also probably want to configure automatic renewal by adding the command below to a cronjob that runs daily.
|
|
You can add the command below to that crontab. For advanced users, we suggest installing and using <a href="https://acme.sh" target="_blank" rel="noopener noreferrer">acme.sh<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>
|
|
which provides more options (see below), and is much more powerful than certbot.</p> <div class="language-text extra-class"><pre class="language-text"><code>certbot renew
|
|
</code></pre></div><h2 id="troubleshooting"><a href="#troubleshooting" aria-hidden="true" class="header-anchor">#</a> Troubleshooting</h2> <p>If you get an <code>Insecure Connection</code> or related error when trying to access your panel, it is likely that the SSL certificate has expired.
|
|
This can be easily fixed by renewing the SSL certificate, although using the command <code>certbot renew</code> won't do the job. As it'll give a error like: <code>Error: Attempting to renew cert (domain) from /etc/letsencrypt/renew/domain.conf produced an unexpected error</code>.
|
|
This will happen especially if you're running NGINX instead of Apache. The solution for this is to stop NGINX, then renew the certificate, finally restart NGINX.</p> <p>Stop NGINX:</p> <div class="language-bash extra-class"><pre class="language-bash"><code>systemctl stop nginx
|
|
</code></pre></div><p>Renew the certificate:</p> <div class="language-bash extra-class"><pre class="language-bash"><code>certbot renew
|
|
</code></pre></div><p>Once the process has complete, you can restart the NGINX service:</p> <div class="language-bash extra-class"><pre class="language-bash"><code>systemctl start nginx
|
|
</code></pre></div></div> <div class="page-edit"><div class="edit-link"><a href="https://github.com/pterodactyl/documentation/edit/master/tutorials/creating_ssl_certificates.md" target="_blank" rel="noopener noreferrer">Help us improve this page.</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <!----></div> <div class="page-nav"><p class="inner"></p> <div class="prev"><span>
|
|
← <a href="/tutorials/mysql_setup.html">Setting up MySQL</a></span></div> <div class="next"><span><a href="/ops/publish_release.html">Publishing a Release</a> →
|
|
</span></div></div> </div></div></div>
|
|
<script src="/assets/js/43.1a2eda90.js" defer></script><script src="/assets/js/app.8a5a7210.js" defer></script>
|
|
</body>
|
|
</html>
|