dream-setup/CERTIFICATE.md
2025-03-25 17:50:12 +01:00

839 B

To issue a certificate:

  1. Set certificates in your server .conf to this:

    ssl_certificate /etc/nginx/snakeoil.pem;
    ssl_certificate_key /etc/nginx/snakeoil.key;
    
  2. Issue the certificate:

    export DOMAIN=<domain>
    docker compose exec acme mkdir /etc/ssl/$DOMAIN
    docker compose exec acme --issue --server letsencrypt -d $DOMAIN --webroot /var/www/html/$DOMAIN
    docker compose exec acme --install-cert -d $DOMAIN --key-file /etc/ssl/$DOMAIN/key.pem --fullchain-file /etc/ssl/$DOMAIN/fullchain.pem
    
  3. Set certificates in your server .conf to this:

    ssl_certificate /etc/ssl/<domain>/fullchain.pem;
    ssl_certificate_key /etc/ssl/<domain>/key.pem;
    
  4. Restart nginx:

    docker compose exec nginx nginx -s reload
    

    You have to do this (or restart) every up to 3 months.