{"id":726,"date":"2023-01-03T11:46:47","date_gmt":"2023-01-03T11:46:47","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/01\/03\/6865487-how-to-install-ssl-on-vps-using-certbot-at-hostinger\/"},"modified":"2026-03-16T12:12:04","modified_gmt":"2026-03-16T12:12:04","slug":"6865487-how-to-install-ssl-on-vps-using-certbot-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/6865487-how-to-install-ssl-on-vps-using-certbot-at-hostinger\/","title":{"rendered":"How to Install SSL on VPS Using Certbot at Hostinger"},"content":{"rendered":"<p class=\"no-margin\">If your VPS operating system does not have a control panel or it does not integrate a free SSL option, you can generate and install a free <b>Let&rsquo;s Encrypt SSL<\/b> with <b><a href=\"https:\/\/certbot.eff.org\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Certbot<\/a><\/b>. Just follow these steps:<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_dcf896ac94\">Step 1 &ndash; Prepare the VPS<\/h2><p class=\"no-margin\">Before installing the SSL, make sure that your VPS:<\/p><ul>\n<li>\n<p class=\"no-margin\">Has a <b>web server<\/b> running (eg. Apache, NGINX, etc.)<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">The website hosted on your VPS is set up to be opened by <b>entering the domain name<\/b> on the address bar &ndash; not the IP<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">The domain is fully <b><a href=\"\/support\/4146975-what-is-dns-propagation\" target=\"_blank\" class=\"intercom-content-link\">propagated<\/a> <\/b>and pointing to your VPS <b><a href=\"\/support\/1583401-how-to-create-child-nameservers\" target=\"_blank\" class=\"intercom-content-link\">child nameservers<\/a>. <\/b>Installing an SSL with Certbot while the domain is still propagating will create a <b>self-signed certificate<\/b>, which may cause errors when accessing your website<\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">\n<\/p><h2 id=\"h_7672c321e5\">Step 2 &ndash; Install Dependencies<\/h2><p class=\"no-margin\">Certbot recommends using <code>snapd<\/code> for installation. Since <code>snapd<\/code> is not supported on Hostinger Linux-based VPS, you can use <b>Python<\/b> by installing it first on your server.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To start the process, <b><a href=\"\/support\/5723772-how-to-connect-to-your-vps-via-ssh\" target=\"_blank\" class=\"intercom-content-link\">connect to your VPS using SSH<\/a><\/b>. Next, install the required dependencies (Python 3.6+, venv and Augeas) according to your OS:<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">For APT-based distributions (such as Debian or Ubuntu), run the following:<\/p><pre><code>sudo apt update<br>sudo apt install python3 python3-venv libaugeas0<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">For RPM-based distributions (Fedora, CentOS), use this command:<\/p><pre><code>sudo dnf install python3 augeas-libs<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>NOTES<\/b>:<\/p><ul>\n<li>\n<p class=\"no-margin\">For older distributions that do not support <code>dnf<\/code>, use <code>yum<\/code><b> <\/b>instead<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Some RHEL-based distributions use <code>python3x<\/code><b> <\/b>instead of <code>python3<\/code> (eg. <code>python38<\/code>). Please refer to the documentation of your Linux distribution &#128578; <\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">If you have issues installing cryptography, you may need to install additional dependencies. Check this article for more information: <b><a href=\"https:\/\/cryptography.io\/en\/latest\/installation\/#building-cryptography-on-linux\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Building Cryptography on Linux<\/a><\/b><\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">\n<\/p><h2 id=\"h_c0d9bedf57\">Step 3 &ndash; Install Certbot<\/h2><p class=\"no-margin\">To prevent any conflicts with previous versions, <b>remove any Certbot<\/b> <b>packages<\/b> already installed before installing the newest version. You can use your package manager (apt, dnf, yum, etc.) for this.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Once it&rsquo;s ready, run the following to set up a <b>Python virtual environment<\/b>:<\/p><pre><code>sudo python3 -m venv \/opt\/certbot\/<br>sudo \/opt\/certbot\/bin\/pip install --upgrade pip<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To <b>install Certbot<\/b>, run this on Apache:<\/p><pre><code>sudo \/opt\/certbot\/bin\/pip install certbot certbot-apache<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Or this for NGINX:<\/p><pre><code>sudo \/opt\/certbot\/bin\/pip install certbot certbot-nginx<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Next, create a <b>symbolic link<\/b> so that Certbot can be executed from any path:<\/p><pre><code>sudo ln -s \/opt\/certbot\/bin\/certbot \/usr\/bin\/certbot<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Install and activate SSL<\/b> for your websites and have Certbot do all the configurations by executing the following command for Apache:<\/p><pre><code>sudo certbot --apache<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">For NGINX:<\/p><pre><code>sudo certbot --nginx<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>NOTE<\/b>:<\/p><ul>\n<li>\n<p class=\"no-margin\">To obtain only the certificates and configure the SSL manually, append <code>certonly<\/code><b> <\/b>after <code>certbot<\/code> and before <code>--apache<\/code> or <code>--nginx<\/code>.<\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Since the SSL is active for 90 days, it is recommended to set up automatic renewal. You can do so by running the following:<\/p><pre><code>echo \"0 0,12 * * * root \/opt\/certbot\/bin\/python -c 'import random; import time; time.sleep(random.random() * 3600)' &amp;&amp; sudo certbot renew -q\" | sudo tee -a \/etc\/crontab &gt; \/dev\/null<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">That&rsquo;s it, you can now visit your website on an incognito window to verify that SSL is properly installed and working &#128522; <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Additional resources<\/b>:<\/p><ul>\n<li>\n<p class=\"no-margin\">If your OS has a control panel (such as Cyberpanel or cPanel), check this article: <b><a href=\"\/support\/6360129-how-to-install-ssl-on-vps\" target=\"_blank\" class=\"intercom-content-link\">How to install SSL on VPS<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">You can find more alternative methods to install Certbot here: <b><a href=\"https:\/\/eff-certbot.readthedocs.io\/en\/stable\/install.html#alternative-1-docker\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Install Certbot using Docker, pip<\/a><\/b><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Installing an SSL certificate on your VPS with Certbot using Python<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[201],"tags":[],"class_list":["post-726","post","type-post","status-publish","format-standard","hentry","category-getting-started-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/6865487-how-to-install-ssl-on-vps-using-certbot-at-hostinger\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/6865487-como-instalar-ssl-en-vps-usando-certbot-en-hostinger\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/6865487-comment-installer-un-certificat-ssl-sur-un-vps-a-l-aide-de-certbot-chez-hostinger\/","default":0},{"locale":"lt-LT","link":"https:\/\/www.hostinger.com\/lt\/support\/6865487-kaip-idiegti-ssl-vps-serveryje-naudojant-certbot-hostinger-platformoje\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/6865487-como-instalar-ssl-na-vps-utilizando-certbot-no-hostinger\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=726"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/726\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}