# Let's Encrypt SSL Generation

Instructions for creating a free certificate from Let's Encrypt.

To begin with, we update the lists of packages and repositories of the system:

```
sudo apt-get -y update && sudo apt-get -y dist-upgrade
```

Installing **CertBot**:

```
sudo apt-get -y install certbot
```

Next, we install additional packages:

For **Nginx**:

```
sudo apt-get -y install python3-certbot-nginx
```

For **Apache2**:

```
sudo apt-get -y install python3-certbot-apache
```

## Certificate generation:

{% hint style="warning" %}
Please note that the **Web server** must be enabled!
{% endhint %}

For **Nginx**:

```
certbot certonly --nginx -d yoursite.com
```

For **Apache2**:

```
certbot certonly --apache -d yoursite.com
```

If you cannot enable the **Web server**, use the following command:

```
certbot certonly --standalone -d yoursite.com
```

We use the command to automatically issue an **SSL certificate**:

```
certbot renew
```

{% hint style="success" %}
Next, an automatic verification of the validity of your certificate will take place daily.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spacecore.gitbook.io/wiki/en/web-development/generate-lets-encrypt-ssl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
