> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v2.ard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Server Certificate Deployment

> Deploy SSL certificates to Stations and Forum servers via SCP and nginx reload

Stations and Forum servers require manual certificate deployment via SCP and nginx reload.

<Note>
  Complete the [SSL Certificate Renewal](/infrastructure/ssl-renewal) process before deploying certificates to servers.
</Note>

## Stations Server

The Stations server requires manual certificate copy via SCP and nginx reload.

### Server Information

**Domain:** [https://stations.arabiaweather.com/](https://stations.arabiaweather.com/)

**Server Console:** [https://console.hetzner.com/projects/45831/servers/573033/overview](https://console.hetzner.com/projects/45831/servers/573033/overview)

**Server IP:** 195.201.22.130

**SSH Key:** `~/.ssh/ydabain.pem`

### Deployment Process

<Steps>
  <Step title="Locate Certificate Files">
    Ensure you have the certificate files from the renewal process. The certificates should be in:

    ```bash theme={null}
    ~/ardlabs/ssl.latest/latest/certs/letsencrypt/arabiaweather.com/
    ```

    Files needed:

    * `fullchain.crt`
    * `privkey.pem`
  </Step>

  <Step title="Copy Certificate Files">
    Copy the certificate files to the Stations server:

    ```bash theme={null}
    scp -i ~/.ssh/ydabain.pem -o IdentitiesOnly=yes \
      ~/ardlabs/ssl.latest/latest/certs/letsencrypt/arabiaweather.com/fullchain.crt \
      root@195.201.22.130:/home/aw/repos/weatherStations/nginx/nginx/certs/chain.crt

    scp -i ~/.ssh/ydabain.pem -o IdentitiesOnly=yes \
      ~/ardlabs/ssl.latest/latest/certs/letsencrypt/arabiaweather.com/privkey.pem \
      root@195.201.22.130:/home/aw/repos/weatherStations/nginx/nginx/certs/private.pem
    ```

    <Note>
      The certificate files are copied to:

      * `fullchain.crt` → `/home/aw/repos/weatherStations/nginx/nginx/certs/chain.crt`
      * `privkey.pem` → `/home/aw/repos/weatherStations/nginx/nginx/certs/private.pem`
    </Note>
  </Step>

  <Step title="Reload Nginx">
    SSH to the Stations server:

    ```bash theme={null}
    ssh -i ~/.ssh/ydabain.pem root@195.201.22.130
    ```

    Switch to the `aw` user:

    ```bash theme={null}
    su - aw
    ```

    Reload nginx to apply the new certificates:

    ```bash theme={null}
    docker container exec -it nginx nginx -s reload
    ```
  </Step>

  <Step title="Verify">
    Test the domain to ensure the certificate is active:

    ```bash theme={null}
    curl -I https://stations.arabiaweather.com/
    ```

    Check that the certificate is valid and matches the expected expiration date.
  </Step>
</Steps>

## Forum Server

The Forum server requires manual certificate copy via SCP and nginx reload.

### Server Information

**Domain:** forum.arabiaweather.com

**Server:** [root@forum.arabiaweather.com](mailto:root@forum.arabiaweather.com)

### Deployment Process

<Steps>
  <Step title="Locate Certificate Files">
    Ensure you have the certificate files from the renewal process. Files needed:

    * `fullchain.crt` (or `fullchain.pem`)
    * `privkey.pem`
  </Step>

  <Step title="Copy Certificate Files">
    Copy the certificate files to the Forum server:

    ```bash theme={null}
    scp privkey.pem root@forum.arabiaweather.com:/etc/nginx/cert/privkey.pem

    scp fullchain.crt root@forum.arabiaweather.com:/etc/nginx/cert/fullchain.pem
    ```

    <Note>
      The certificate files are copied to:

      * `privkey.pem` → `/etc/nginx/cert/privkey.pem`
      * `fullchain.crt` → `/etc/nginx/cert/fullchain.pem`
    </Note>
  </Step>

  <Step title="Reload Nginx">
    SSH to the Forum server:

    ```bash theme={null}
    ssh root@forum.arabiaweather.com
    ```

    Reload nginx to apply the new certificates:

    ```bash theme={null}
    nginx -s reload
    ```
  </Step>

  <Step title="Verify">
    Test the domain to ensure the certificate is active:

    ```bash theme={null}
    curl -I https://forum.arabiaweather.com/
    ```

    Check that the certificate is valid and matches the expected expiration date.
  </Step>
</Steps>

## Verification Checklist

After deploying certificates to both servers:

### Stations Server

* [ ] Certificate files copied to server
* [ ] Nginx reloaded successfully
* [ ] stations.arabiaweather.com accessible with new certificate
* [ ] Certificate expiration date verified

### Forum Server

* [ ] Certificate files copied to server
* [ ] Nginx reloaded successfully
* [ ] forum.arabiaweather.com accessible with new certificate
* [ ] Certificate expiration date verified
