Skip to content

Commit 3fdd1c7

Browse files
committed
en-gb version + index
1 parent 2d20fbc commit 3fdd1c7

File tree

3 files changed

+278
-7
lines changed

3 files changed

+278
-7
lines changed
Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
---
2+
title: 'How to install an SSL certificate on a VPS'
3+
excerpt: 'Find out how to install an SSL certificate on an OVHcloud VPS'
4+
updated: 2025-01-24
5+
---
6+
7+
## Objective
8+
9+
Securing your website is essential to protect your users' sensitive data and improve their trust. With an SSL certificate (**S**ecure **S**ockets **L**ayer), 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.
10+
11+
**Find out how to install an SSL certificate on an OVHcloud VPS.**
12+
13+
> [!warning]
14+
>
15+
> OVHcloud provides services that you are responsible for with regard to their configuration and management. It is therefore your responsibility to ensure that they function properly.
16+
>
17+
> We offer this tutorial to help you with common tasks. Nevertheless, we recommend contacting a [specialist provider](/links/partner) and/or the service's publisher if you encounter any difficulties. We will not be able to assist you. More information in the [Go further](#gofurther) section of this tutorial.
18+
>
19+
20+
## Requirements
21+
22+
- A [Virtual Private Server](/links/bare-metal/vps) in your OVHcloud account
23+
- Administrative access (sudo) via SSH to your server
24+
- A functional website accessible in `HTTP`
25+
26+
## Instructions
27+
28+
### Summary
29+
30+
- [Step 1 - Log in to your OVHcloud VPS](#step1)
31+
- [Step 2 - Install Certbot](#step2)
32+
- [Step 3 - Get an SSL certificate with Let's Encrypt](#step3)
33+
- [Step 4 - Configure your web server](#step4)
34+
- [Step 5 - Enable automatic renewal](#step5)
35+
36+
### Step 1 - Log in to your OVHcloud VPS <a name="step1"></a>
37+
38+
1. Download an SSH client like [PuTTY](/pages/web_cloud/web_hosting/ssh_using_putty_on_windows) or use your operating system's built-in terminal.
39+
40+
2. Log in to your OVHcloud VPS with the login information provided:
41+
42+
```bash
43+
ssh root@<vps_ip>
44+
```
45+
Replace `<vps_ip>` with the IP address of your OVHcloud VPS.
46+
47+
### Step 2 - Install Certbot <a name="step2"></a>
48+
49+
Certbot is a tool to automatically manage Let's Encrypt certificates. Follow the steps below to install Certbot according to your Linux distribution.
50+
51+
> [!tabs]
52+
> **Ubuntu/Debian**
53+
>>
54+
>> ```bash
55+
>> sudo apt update
56+
>> sudo apt install certbot
57+
>> ```
58+
>>
59+
> **CentOS**
60+
>>
61+
>> ```bash
62+
>> sudo yum install epel-release
63+
>> sudo yum install certbot
64+
>> ```
65+
>>
66+
> **Fedora**
67+
>>
68+
>> ```bash
69+
>> sudo dnf install certbot
70+
>> ```
71+
72+
Verify that Certbot is properly installed by running the following command:
73+
74+
```bash
75+
certbot --version
76+
```
77+
78+
This should show the version of Certbot installed.
79+
80+
### Step 3 - Get an SSL certificate with Let's Encrypt <a name="step3"></a>
81+
82+
> [!primary]
83+
>
84+
> 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.
85+
86+
#### Automatic use with Certbot Nginx or Apache plugins (recommended)
87+
88+
Depending on your web server, use the corresponding command lines:
89+
90+
> [!tabs]
91+
> **Nginx**
92+
>>
93+
>> Install the Certbot Nginx plugin:
94+
>>
95+
>> ```bash
96+
>> sudo apt install python3-certbot-nginx -y
97+
>> ```
98+
>>
99+
>> Generate the SSL certificate:
100+
>>
101+
>> ```bash
102+
>> sudo certbot --nginx -d your_domain
103+
>> ```
104+
>>
105+
> **Apache**
106+
>>
107+
>> Install the Apache Certbot plugin:
108+
>>
109+
>> ```bash
110+
>> sudo apt install python3-certbot-apache -y
111+
>> ```
112+
>>
113+
>> Generate the SSL certificate:
114+
>>
115+
>> ```bash
116+
>> sudo certbot --apache -d your_domain
117+
>> ```
118+
119+
Certbot will automatically configure the SSL certificate and `HTTPS` redirection. Check that your website is accessible in `HTTPS`.
120+
121+
#### Standalone usage
122+
123+
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.
124+
125+
Use the following command to request a certificate:
126+
127+
```bash
128+
sudo certbot certonly --standalone -d your_domain
129+
```
130+
131+
Replace `your_domain` with your domain name.
132+
133+
> [!warning]
134+
> This method temporarily stops any service using port 80 (for example, another web server).
135+
136+
Once the certificate has been generated, the files are available in `/etc/letsencrypt/live/your_domain/`:
137+
138+
- `fullchain.pem`: the full certificate.
139+
- `privkey.pem`: the private key.
140+
141+
### Step 4 - Configure your web server <a name="step4"></a>
142+
143+
> [!primary]
144+
> If you have used the automatic solution (with Certbot plugins) before ([Step 3](#step3)) and your website is accessible in `HTTPS`, go to [step 5](step 5).
145+
146+
#### Example for Nginx
147+
148+
1\. Open your website's configuration file (for example, `/etc/nginx/sites-available/your_domain.conf`).
149+
150+
2\. Add the following lines to activate SSL:
151+
152+
```nginx
153+
server {
154+
listen 443 ssl;
155+
server_name your_domain;
156+
157+
ssl_certificate /etc/letsencrypt/live/your_domain/fullchain.pem;
158+
ssl_certificate_key /etc/letsencrypt/live/your_domain/privkey.pem;
159+
160+
# Paramètres de sécurité supplémentaires
161+
ssl_protocols TLSv1.2 TLSv1.3;
162+
ssl_ciphers HIGH:!aNULL:!MD5;
163+
164+
# Redirection HTTP vers HTTPS
165+
location / {
166+
try_files $uri $uri/ =404;
167+
}
168+
}
169+
```
170+
171+
3\. Add an automatic `HTTP` to `HTTPS` redirection:
172+
173+
```nginx
174+
server {
175+
listen 80;
176+
server_name your_domain;
177+
return 301 https://$host$request_uri;
178+
}
179+
```
180+
181+
4\. Test and restart Nginx:
182+
183+
```bash
184+
sudo nginx -t
185+
sudo systemctl reload nginx
186+
```
187+
188+
Check that your website is accessible in `HTTPS`.
189+
190+
#### Example for Apache
191+
192+
1\. Enable SSL modules and headers:
193+
194+
```bash
195+
sudo a2enmod ssl
196+
sudo a2enmod headers
197+
```
198+
199+
2\. Modify your website's configuration (e.g. `/etc/apache2/sites-available/your_domain.conf`) to include:
200+
201+
```apache
202+
<VirtualHost *:80>
203+
ServerName your_domain
204+
DocumentRoot /var/www/your_domain
205+
206+
Redirect permanent / https://your_domain/
207+
208+
<Directory /var/www/your_domain>
209+
AllowOverride All
210+
Require all granted
211+
</Directory>
212+
213+
ErrorLog ${APACHE_LOG_DIR}/ssltest_error.log
214+
CustomLog ${APACHE_LOG_DIR}/ssltest_access.log combined
215+
</VirtualHost>
216+
217+
<VirtualHost *:443>
218+
ServerName your_domain
219+
DocumentRoot /var/www/your_domain
220+
221+
# Activer SSL
222+
SSLEngine on
223+
SSLCertificateFile /etc/letsencrypt/live/your_domain/fullchain.pem
224+
SSLCertificateKeyFile /etc/letsencrypt/live/your_domain/privkey.pem
225+
226+
# Paramètres de sécurité supplémentaires
227+
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
228+
SSLCipherSuite HIGH:!aNULL:!MD5
229+
SSLHonorCipherOrder on
230+
231+
<Directory /var/www/your_domain>
232+
AllowOverride All
233+
Require all granted
234+
</Directory>
235+
236+
ErrorLog ${APACHE_LOG_DIR}/ssltest_error.log
237+
CustomLog ${APACHE_LOG_DIR}/ssltest_access.log combined
238+
</VirtualHost>
239+
```
240+
241+
4\. Test and restart Apache:
242+
243+
```bash
244+
sudo apachectl configtest
245+
sudo systemctl restart apache2
246+
```
247+
248+
Check that your website is accessible in `HTTPS`.
249+
250+
### Step 5 - Enable automatic renewal <a name="step5"></a>
251+
252+
Let's Encrypt certificates are valid for 90 days. Configure automatic renewal with Certbot:
253+
254+
Test automatic renewal:
255+
256+
```bash
257+
sudo certbot renew --dry-run
258+
```
259+
260+
Certbot automatically configures a `cron` task or a systemd timer to manage renewal. Check its status with:
261+
262+
```bash
263+
sudo systemctl list-timers | grep certbot
264+
```
265+
266+
## Go further <a name="go-further"></a>
267+
268+
For specialized services (SEO, development, etc.), contact the [OVHcloud partners](/links/partner).
269+
270+
Join our [community of users](/links/community).

pages/bare_metal_cloud/virtual_private_servers/install-ssl-certificate/guide.fr-fr.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ La sécurisation de votre site web est essentielle pour protéger les données s
2121

2222
- Disposer d'une offre [VPS](/links/bare-metal/vps)
2323
- Disposer d'un accès administrateur (sudo) via SSH à votre VPS
24-
- Disposer d'un site web fonctionnel accessible en http
24+
- Disposer d'un site web fonctionnel accessible en `HTTP`
2525

2626
## En pratique
2727

@@ -81,7 +81,7 @@ Cela doit afficher la version de Certbot installée.
8181

8282
> [!primary]
8383
>
84-
> Si vous avez installé votre serveur web (Nginx ou Apache), nous vous recommandons d'utiliser les plugins Certbot pour automatiser la configuration SSL et activer les redirections HTTPS. Ces plugins simplifient l'installation en gérant directement les fichiers de configuration du serveur web.
84+
> Si vous avez installé votre serveur web (Nginx ou Apache), nous vous recommandons d'utiliser les plugins Certbot pour automatiser la configuration SSL et activer les redirections `HTTPS`. Ces plugins simplifient l'installation en gérant directement les fichiers de configuration du serveur web.
8585
8686
#### Utilisation automatique avec les plugins Certbot Nginx ou Apache (recommandée)
8787

@@ -116,7 +116,7 @@ Selon votre serveur web, utilisez les lignes de commandes correspondantes :
116116
>> sudo certbot --apache -d your_domain
117117
>> ```
118118
119-
Certbot configurera automatiquement le certificat SSL et la redirection HTTPS. Vérifiez que votre site web est accessible en `https`.
119+
Certbot configurera automatiquement le certificat SSL et la redirection `HTTPS`. Vérifiez que votre site web est accessible en `HTTPS`.
120120
121121
#### Utilisation en mode autonome
122122
@@ -141,7 +141,7 @@ Une fois le certificat généré, les fichiers sont disponibles dans `/etc/letse
141141
### Étape 4 - Configurez votre serveur web <a name="step4"></a>
142142

143143
> [!primary]
144-
> Si vous avez utilisé la solution automatique (avec les plugins Certbot) précédemment ([Étape 3](#step3)) et que votre site web est accessible en `https`, passez à l'[étape 5](step5).
144+
> Si vous avez utilisé la solution automatique (avec les plugins Certbot) précédemment ([Étape 3](#step3)) et que votre site web est accessible en `HTTPS`, passez à l'[étape 5](step5).
145145
146146
#### Exemple pour Nginx
147147

@@ -168,7 +168,7 @@ server {
168168
}
169169
```
170170

171-
3\. Ajoutez une redirection automatique HTTP vers HTTPS :
171+
3\. Ajoutez une redirection automatique `HTTP` vers `HTTPS` :
172172

173173
```nginx
174174
server {
@@ -185,7 +185,7 @@ sudo nginx -t
185185
sudo systemctl reload nginx
186186
```
187187

188-
Vérifiez que votre site web est accessible en `https`.
188+
Vérifiez que votre site web est accessible en `HTTPS`.
189189

190190
#### Exemple pour Apache
191191

@@ -245,7 +245,7 @@ sudo apachectl configtest
245245
sudo systemctl restart apache2
246246
```
247247

248-
Vérifiez que votre site web est accessible en `https`.
248+
Vérifiez que votre site web est accessible en `HTTPS`.
249249

250250
### Étape 5 - Activez le renouvellement automatique <a name="step5"></a>
251251

pages/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
+ [FAQ](bare_metal_cloud/virtual_private_servers/vps-faq)
227227
+ [How to configure user accounts and root access on a server](bare_metal_cloud/dedicated_servers/changing_root_password_linux_ds)
228228
+ [How to secure a VPS](bare_metal_cloud/virtual_private_servers/secure_your_vps)
229+
+ [How to install an SSL certificate on a VPS](bare_metal_cloud/virtual_private_servers/install-ssl-certificate)
229230
+ [How to get started with SSH](bare_metal_cloud/dedicated_servers/ssh_introduction)
230231
+ [How to create and use SSH keys](bare_metal_cloud/dedicated_servers/creating-ssh-keys-dedicated)
231232
+ [How to store public authentication keys in the OVHcloud Control Panel](bare_metal_cloud/dedicated_servers/import-keys-control-panel)

0 commit comments

Comments
 (0)