Como tornar meu dominio seguro com o ssl automatico do meu droplet ?
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!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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:
Update Your Server: Ensure your server is updated. For a Linux server, you can typically do this with commands like
sudo apt update
andsudo apt upgrade
.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
.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).
Run Certbot: Execute Certbot with a command like
sudo certbot --apache
orsudo certbot --nginx
, depending on your web server. Certbot will guide you through the process.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.
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 like0 12 * * * /usr/bin/certbot renew --quiet
.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.
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.
Update Site Configuration: If your site has hardcoded URLs with
http
, change them tohttps
to avoid mixed content issues.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/