# Add SSL Certificate to OctoXLabs

In this tutorial, you will learn how to:

* Add a SSL certificate to OctoXLabs domain
* Change the SSL certificate of OctoXLabs domain

### Before you start﻿ <a href="#before-you-start" id="before-you-start"></a>

Before you start, make sure that you have:

* A DNS/domain name issued for the platform where OctoXLabs is running
* A .crt and its accompanying .key file for the issued DNS/domain name

### Step 1: Shut Down Backend and Frontend﻿ <a href="#step-1-shut-down-backend-and-frontend" id="step-1-shut-down-backend-and-frontend"></a>

Before starting to add the SSL certificate, you need to shut down the OctoXLabs platform:

```
octox-ctl -x down
```

{% hint style="info" %}
Ensure that both the backend and frontend are completely shut down before proceeding.
{% endhint %}

### Step 2: Prepare Necessary Files﻿ <a href="#step-2-prepare-necessary-files" id="step-2-prepare-necessary-files"></a>

If you have a `.pass` file associated with your certificate and key files, include this file in the process. If not, create an empty `.pass` file using the following command:

```
touch octoxlabs.pass
```

Place your `.cer`, `.key` and `.pass` files under the directory `/tmp`. If you would like to place the files under a different path, you may do so.

### Step 3: Add the SSL Certificate﻿ <a href="#step-3-add-the-ssl-certificate" id="step-3-add-the-ssl-certificate"></a>

{% hint style="warning" %}
The SSL certificate to be used must be in `.crt` format.
{% endhint %}

Use the following command to add the SSL certificate, key, and optional password file to the OctoXLabs platform:

```
octox-ctl -x set -c <path/to/file.crt> -k <path/to/file.key> -p <path/to/passfile.pass>
```

{% hint style="info" %}
Replace \<path/to/file.crt>, \<path/to/file.key>, and \<path/to/passfile.pass> with the actual file paths.
{% endhint %}

### Step 4: Complete the Setup﻿ <a href="#step-4-complete-the-setup" id="step-4-complete-the-setup"></a>

After successfully adding the SSL certificate, start the platform to apply the changes:

```
octox-ctl -x up
```

Following these steps will secure your OctoXLabs platform with an SSL certificate. You can verify the successful addition by accessing the platform through your browser.

{% hint style="success" %}
Remember to keep your SSL certificate files secure and update them regularly.
{% endhint %}
