Question

Usar SSL do Droplet

Como tornar meu dominio seguro com o ssl automatico do meu droplet ?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
December 14, 2023

Heya @network2002,

You can use certbot/Let’s Encrypt to add an SSL certificate for your Domain.

Here are the general steps you need to follow:

  1. Update Your Server: Ensure your server is updated. For a Linux server, you can typically do this with commands like sudo apt update and sudo apt upgrade.

  2. Install Certbot: Certbot is the software that will obtain a free SSL certificate from Let’s Encrypt and automatically enable HTTPS on your website. You can install it with a command like sudo apt install certbot.

  3. Choose Web Server and System: Certbot needs to know the web server you are using (e.g., Apache, Nginx) and your operating system (e.g., Ubuntu, Debian).

  4. Run Certbot: Execute Certbot with a command like sudo certbot --apache or sudo certbot --nginx, depending on your web server. Certbot will guide you through the process.

  5. Domain Verification: Certbot will ask for the domain names you want to activate HTTPS for. It will also handle the verification of your domain to ensure you own it.

  6. Configure Automatic Renewal: Let’s Encrypt certificates are valid for 90 days. It’s recommended to set up automatic renewal. This can usually be done by editing the crontab file with sudo crontab -e and adding a line like 0 12 * * * /usr/bin/certbot renew --quiet.

  7. Update Domain DNS Settings: Make sure your domain’s DNS settings point to your server’s IP address. This is done through your domain registrar’s website.

  8. Test Your Configuration: After setting up SSL, test your website to ensure that HTTPS is working correctly. You can also check your SSL setup with online tools like SSL Labs’ SSL Test.

  9. Update Site Configuration: If your site has hardcoded URLs with http, change them to https to avoid mixed content issues.

  10. Redirect HTTP to HTTPS: It’s a good practice to redirect all HTTP traffic to HTTPS. This can be configured in your web server settings.

You can also check this article:

https://docs.digitalocean.com/support/how-do-i-install-an-ssl-certificate-on-a-droplet/

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel