{"id":16961,"date":"2025-04-04T22:09:01","date_gmt":"2025-04-04T20:09:01","guid":{"rendered":"https:\/\/tremhost.com\/blog\/?p=16961"},"modified":"2025-04-04T22:09:01","modified_gmt":"2025-04-04T20:09:01","slug":"how-to-install-ssl-on-a-vps-step-by-step","status":"publish","type":"post","link":"https:\/\/tremhost.com\/blog\/how-to-install-ssl-on-a-vps-step-by-step\/","title":{"rendered":"How to install SSL on a VPS (step-by-step)"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><h1>How to Install SSL on a VPS (Step-by-Step)<\/h1>\n<p>Installing an SSL certificate on your VPS secures your website by encrypting data between the server and your visitors. Below is a step-by-step guide for installing an SSL certificate on a VPS using Let\u2019s Encrypt with Apache. (You can adapt similar steps for Nginx.)<\/p>\n<hr \/>\n<h2>1. Prepare Your VPS Environment<\/h2>\n<h3>a. Update Your System<\/h3>\n<p>Open your terminal and log in to your VPS via SSH:<\/p>\n<pre><code class=\"language-bash\">ssh root@your-vps-ip\r\n<\/code><\/pre>\n<p>Then, update your package lists and upgrade installed packages:<\/p>\n<pre><code class=\"language-bash\">sudo apt update &amp;&amp; sudo apt upgrade -y    # For Ubuntu\/Debian\r\n<\/code><\/pre>\n<p><em>For CentOS\/AlmaLinux, use:<\/em><\/p>\n<pre><code class=\"language-bash\">sudo yum update -y\r\n<\/code><\/pre>\n<h3>b. Install Apache (if not already installed)<\/h3>\n<p>For Ubuntu\/Debian:<\/p>\n<pre><code class=\"language-bash\">sudo apt install apache2 -y\r\n<\/code><\/pre>\n<p>For CentOS\/AlmaLinux:<\/p>\n<pre><code class=\"language-bash\">sudo yum install httpd -y\r\nsudo systemctl start httpd &amp;&amp; sudo systemctl enable httpd\r\n<\/code><\/pre>\n<hr \/>\n<h2>2. Install Certbot<\/h2>\n<p>Certbot is a free, open-source tool to obtain and renew Let\u2019s Encrypt SSL certificates.<\/p>\n<h3>a. Install Certbot on Ubuntu\/Debian:<\/h3>\n<pre><code class=\"language-bash\">sudo apt install certbot python3-certbot-apache -y\r\n<\/code><\/pre>\n<h3>b. Install Certbot on CentOS\/AlmaLinux:<\/h3>\n<pre><code class=\"language-bash\">sudo yum install epel-release -y\r\nsudo yum install certbot python2-certbot-apache -y\r\n<\/code><\/pre>\n<p><em>Note: Adjust package names if using newer versions or different distributions.<\/em><\/p>\n<hr \/>\n<h2>3. Obtain Your SSL Certificate<\/h2>\n<h3>a. Run Certbot for Apache:<\/h3>\n<p>Execute Certbot with the Apache plugin:<\/p>\n<pre><code class=\"language-bash\">sudo certbot --apache\r\n<\/code><\/pre>\n<h3>b. Follow the Prompts:<\/h3>\n<ul>\n<li><strong>Enter Your Email Address:<\/strong><br \/>\nThis is used for urgent notices and renewal reminders.<\/li>\n<li><strong>Agree to the Terms of Service:<\/strong><br \/>\nConfirm that you agree to Let\u2019s Encrypt\u2019s terms.<\/li>\n<li><strong>Select Your Domain:<\/strong><br \/>\nCertbot will automatically detect your domain names from your Apache configuration. Select the ones you want to secure.<\/li>\n<\/ul>\n<p>Certbot will then communicate with Let\u2019s Encrypt, obtain your certificate, and automatically update your Apache configuration to use HTTPS.<\/p>\n<hr \/>\n<h2>4. Verify the Installation<\/h2>\n<h3>a. Test Your Website<\/h3>\n<p>Visit your website using <code>https:\/\/yourdomain.com<\/code> and check that the SSL padlock icon appears in your browser\u2019s address bar.<\/p>\n<h3>b. Check Certificate Details<\/h3>\n<p>You can use online tools such as <a href=\"https:\/\/www.ssllabs.com\/ssltest\/\">SSL Labs\u2019 SSL Test<\/a> to verify that your certificate is correctly installed and configured.<\/p>\n<hr \/>\n<h2>5. Set Up Auto-Renewal<\/h2>\n<p>Let\u2019s Encrypt certificates are valid for 90 days. Certbot automatically sets up a cron job or systemd timer to renew the certificate before expiration.<\/p>\n<h3>a. Test Renewal Process:<\/h3>\n<p>Run a dry-run to ensure renewal works:<\/p>\n<pre><code class=\"language-bash\">sudo certbot renew --dry-run\r\n<\/code><\/pre>\n<hr \/>\n<h2>Final Thoughts<\/h2>\n<p>By following these steps, you\u2019ve successfully installed an SSL certificate on your VPS using Let\u2019s Encrypt and Apache. Your website now benefits from enhanced security and improved SEO. Remember to monitor your certificate&#8217;s expiration and ensure auto-renewal is working correctly.<\/p>\n<p>Ready to secure your website? Follow these steps and enjoy a safer, HTTPS-enabled web presence!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install SSL on a VPS (Step-by-Step) Installing an SSL certificate on your VPS secures your website by encrypting data between the server and your visitors. Below is a step-by-step guide for installing an SSL certificate on a VPS using Let\u2019s Encrypt with Apache. (You can adapt similar steps for Nginx.) 1. Prepare Your [&hellip;]<\/p>\n","protected":false},"author":1772,"featured_media":16891,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[163],"tags":[],"class_list":{"0":"post-16961","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-hosting"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/16961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/users\/1772"}],"replies":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/comments?post=16961"}],"version-history":[{"count":1,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/16961\/revisions"}],"predecessor-version":[{"id":16962,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/16961\/revisions\/16962"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/media\/16891"}],"wp:attachment":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/media?parent=16961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/categories?post=16961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/tags?post=16961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}