How to install an SSL certificate on a VPS
Find out how to install an SSL certificate on an OVHcloud VPS
Objective
Securing your website is essential to protect your users' sensitive data and improve their trust. With an SSL certificate (Secure Sockets Layer), you can encrypt the exchanges between your visitors and your website, while strengthening its credibility. This guide documents the use of Let's Encrypt, a free and automated service.
Find out how to install an SSL certificate on an OVHcloud VPS.
Information regarding OVHcloud service administration and how to find appropriate assistance
When using OVHcloud guides, please be aware of the following conditions:
- User instructions aim to provide as many details as possible but cannot cover individual use cases. You might need to adapt the pertinent actions to your requirements.
- The OVHcloud ecosystem is built for flexibility and freedom of choice. Customers are therefore responsible for the secure and proper configuration of their services. To prevent data loss, we strongly recommend to apply backup strategies to all your important data.
- Our guides and tutorials may reference third-party software or services in combination with OVHcloud solutions. The technical support provided by OVHcloud does not include the configuration of systems or products outside of our responsibility. This includes but is not limited to:
- Operating systems and user interfaces (Windows, Debian, Plesk, etc.).
- Any other third-party software (FTP clients, email software, etc.).
- Services offered by other providers (DNS, APIs, user interfaces, etc.).
To receive the appropriate assistance for any issues you might experience, follow these guidelines:
- You seek personalized advice or you would like to discuss a topic that is not covered in detail by our documentation?
Join the OVHcloud Community to search for your topic and reach out to other users. - You need to report an incident regarding your OVHcloud service or you are experiencing difficulties in the OVHcloud Control Panel?
Create a support request in our Help Centre. - You require professional assistance for your project or you need help with tasks outside our support scope?
Visit our partner portal to search for experts who are familiar with OVHcloud solutions. - You are looking for more detailed information regarding our support levels and Professional Services?
Please visit our web pages for OVHcloud support levels and OVHcloud Professional Services.
You can participate in improving our documentation:
- You would like to share feedback to improve a guide page or you want to report insufficient information on a specific page?
Use the "Was this page helpful?" buttons at the bottom of the page to let us know. - You would like to propose a specific documentation update?
Use the "Edit this page" function, available at the bottom of the page and in the sidebar.
Requirements
- A Virtual Private Server in your OVHcloud account
- Administrative access (sudo) via SSH to your server
- A functional website accessible in
HTTP
Instructions
Summary
- Step 1 - Log in to your OVHcloud VPS
- Step 2 - Install Certbot
- Step 3 - Get an SSL certificate with Let's Encrypt
- Step 4 - Configure your web server
- Step 5 - Enable automatic renewal
Step 1 - Log in to your OVHcloud VPS
- Download an SSH client like PuTTY or use your operating system's built-in terminal.
- Log in to your OVHcloud VPS with the login information provided:
Replace <vps_ip> with the IP address of your OVHcloud VPS.
Step 2 - Install Certbot
Certbot is a tool to automatically manage Let's Encrypt certificates. Follow the steps below to install Certbot according to your Linux distribution.
Verify that Certbot is properly installed by running the following command:
This should show the version of Certbot installed.
Step 3 - Get an SSL certificate with Let's Encrypt
If you have set up your web server (Nginx or Apache), we recommend using Certbot plugins to automate SSL configuration and enable HTTPS redirections. These plugins simplify the installation by directly managing the configuration files of the web server.
Automatic use with Certbot Nginx or Apache plugins (recommended)
Depending on your web server, use the corresponding command lines:
Install the Certbot Nginx plugin:
Generate the SSL certificate:
Certbot will automatically configure the SSL certificate and HTTPS redirection. Check that your website is accessible in HTTPS.
Standalone usage
If you prefer to configure your server manually, use Certbot in standalone mode. This mode uses a temporary server built into Certbot to validate your domain name and generate an SSL certificate.
Use the following command to request a certificate:
Replace your_domain with your domain name.
This method temporarily stops any service using port 80 (for example, another web server).
Once the certificate has been generated, the files are available in /etc/letsencrypt/live/your_domain/:
fullchain.pem: the full certificate.privkey.pem: the private key.
Step 4 - Configure your web server
Example for Nginx
1. Open your website's configuration file (for example, /etc/nginx/sites-available/your_domain.conf).
2. Add the following lines to activate SSL:
3. Add an automatic HTTP to HTTPS redirection:
4. Test and restart Nginx:
Check that your website is accessible in HTTPS.
Example for Apache
1. Enable SSL modules and headers:
2. Modify your website's configuration (e.g. /etc/apache2/sites-available/your_domain.conf) to include:
3. Test and restart Apache:
Check that your website is accessible in HTTPS.
Step 5 - Enable automatic renewal
Let's Encrypt certificates are valid for 90 days. Configure automatic renewal with Certbot:
Test automatic renewal:
Certbot automatically configures a cron task or a systemd timer to manage renewal. Check its status with:
Go further
For specialized services (SEO, development, etc.), contact the OVHcloud partners.
Join our community of users.