Generate the Snakeoil SSL Cerificates for nginx on Ubuntu 24.04 LTS

by Aug 27, 2025IT Tips0 comments

Get nginx https running on Ubuntu 24.04 LTS

sudo apt-get install ssl-cert
make-ssl-cert generate-default-snakeoil --force-overwrite

Uncomment the following three lines in /etc/nginx/sites-enabled/default

listen 443 ssl default_server;
listen [::]:443 ssl default_server;
include snippets/snakeoil.conf;

Snippet of /etc/nginx/sites-enabled/default showing uncommented SSL lines

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        listen 443 ssl default_server;
        listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        include snippets/snakeoil.conf;

After you finish editing restart nginx

# first check if there are any errors with the configuration
sudo nginx -t

# restart nginx
sudo systemctl restart nginx.service

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.