Droplet backup is a service provided by DigitalOcean to help users protect their data by creating automatic, system-level backups of their Droplets. These backups enable users to have access to recent copies of their data, which can be crucial for disaster recovery and minimizing downtime in case of accidental deletion, system failures, or other data loss scenarios.
A few benefits of enabling backups (also, images) for your Droplet are:
In the event that you do not enable backups on your Droplet ,the backup process is not properly configured or encounters issues during execution, you run the risk of having incomplete or corrupt backups, which can complicate data restoration.
- /v2/droplets/$DROPLET_ID/backups
Please review List Backups for a Droplet of the DigitalOcean API reference for more details.
Please refer to our How to Enable Backups Guide
A firewall is a security system that monitors and controls network traffic based on a set of security rules. Firewalls usually sit between a trusted network and an untrusted network; oftentimes the untrusted network is the Internet. Firewalls decide whether to allow incoming and outgoing traffic to pass through. They can be built into hardware, software, or a combination of both.
The primary use case for a firewall is security. Firewalls can intercept incoming malicious traffic before it reaches the network, as well as prevent sensitive information from leaving the network. Other use cases for firewalls include content filtering, logging and auditing, securing remote access via a Virtual Private Network (VPN), etc.
A few benefits of creating a firewall for your Droplet are:
Security: Firewalls act as a bidirectional barrier between your server, a trusted network, and untrusted networks, such as the Internet. Firewalls filter incoming and outgoing network traffic based on a set of predefined rules, allowing only authorized connections to reach your Droplet.
Access Control: Firewalls provide granular control over which services and ports are accessible from the Internet, therein reducing your server’s attack surface.
Protection Against Common Attacks: Firewalls can help mitigate common network-based attacks, such as Distributed Denial of Service (DDoS) attacks, port scanning, and brute force attacks. By blocking suspicious and/or excessive traffic, you can reduce the impact of these attacks on your server’s performance and availability.
Compliance: Many security regulations and compliance standards require the use of firewalls as a basic security measure. By implementing a firewall, you demonstrate your commitment to security best practices, which may be necessary for your organization’s regulatory compliance or auditing purposes.
If firewall rules are too strict or incorrectly configured, legitimate traffic such as client requests, administrative access, or inter-service communication might be blocked, leading to service disruptions or degraded performance.
- ssh -i /path/to/your-ssh-key root@your-droplet-ip
- doctl compute firewall list
- doctl compute firewall list-by-droplet <droplet-id>
If a firewall is enabled and has rules, you will see output similar to the following:
- | Status:Active | | |
- |--------------- |-------- |--------------- |
- | To | Action | From |
- | OpenSSH | Allow | Anywhere |
- | 80/TCP | Allow | Anywhere |
If no firewall is configured, the output will indicate that the firewall is inactive or not installed.
Please review our How to Create Firewalls documentation.
A firewall is a security system that monitors and controls inbound and outbound network traffic based on a set of security rules. Firewalls usually sit between a trusted network and an untrusted network and can be built into hardware, software, or a combination of both.
Firewalls have multiple uses; however, the primary use case for a firewall is security. A firewall can intercept incoming malicious traffic and prevent sensitive information from leaving the network. Other use cases for firewalls include content filtering, logging and auditing, securing remote access via a Virtual Private Network (VPN), etc.
A few benefits of connecting a firewall to your Droplet are:
If firewall rules are too strict or incorrectly configured, legitimate traffic such as client requests, administrative access, or inter-service communication might be blocked, leading to service disruptions or degraded performance.
- ssh -i /path/to/your-ssh-key root@your-droplet-ip
- doctl compute firewall list
If a firewall is enabled and has rules, you will see output similar to the following:
- | Status:Active | | |
- |--------------- |-------- |--------------- |
- | To | Action | From |
- | OpenSSH | Allow | Anywhere |
- | 80/TCP | Allow | Anywhere |
If no firewall is configured, the output will indicate that the firewall is inactive or not installed.
Follow the instructions in our How to Add and Remove Droplets from Firewalls documentation.
Upgrading an operating system is crucial for maintaining an efficient, secure, and compatible computing environment. The upgrades may provide enhanced security, improved performance, and access to new features. Regularly upgrading ensures that users can take full advantage of technological advancements while keeping their systems secure against evolving threats.
A few benefits of upgrading/patching the operating system on a Droplet are:
Upgrades to any operating system carry an inherent risk of failure, data loss, or broken software configuration. Comprehensive backups and extensive testing are strongly advised.
DigitalOcean supports a fixed set of operating systems: Ubuntu, AlmaLinux, Fedora, Debian, CentOS and Rocky Linux). The End of Life.Date project gives a good idea which versions of what operating system are going to expire.
Please note that the specific commands may vary depending on the Linux distribution you are using. The following instructions are for a typical Ubuntu-based system (such as Ubuntu, Debian, or a similar distribution).
- ssh username@your-droplet-ip
If you are using a non-root user with sudo privileges, you can log in with that user and use sudo
for administrative commands.
- lsb_release -a
- cat /etc/os-release
- cat /etc/redhat-release
- uname -a
An operating system update, also known as a patch, improves an operating system’s functionality, security, and stability without upgrading it to a new version. These updates address various issues such as security vulnerabilities, bugs, and other software flaws that could affect the performance and safety of the system.
Updating the operating system on a Droplet is important for:
Improperly updating your operating system can cause several adverse effects, affecting system stability and security to the functionality of installed applications. Best practices for updating an operating system are regularly backing up data, following official documentation, and testing updates in a controlled environment.
DigitalOcean supports a fixed set of operating systems: Ubuntu, AlmaLinux, Fedora, Debian, CentOS and Rocky Linux). The End of Life.Date project gives a good idea which versions of what operating system are going to expire.
The following links require a CIS Workbench account. Please refer to the following links for guidance on updating the latest version of your operating system
Auditd is a user-space component of the Linux Auditing System, mainly used for collecting and writing audit logs to the disk. It helps system administrators monitor security incidents by logging various system events like file accesses and user activities.
Auditd can be configured to track detailed system activity, facilitating the identification of patterns and anomalies that may be indicative of malicious behavior. The system’s flexibility allows for the creation of custom rules tailored to the specific monitoring needs of an organization.
When the auditd service starts, it reads the audit.rules file to load its configuration. The audit.rules file contains specific rules that tell auditd what to log. These rules can specify which system calls to track, which files to watch for changes, and what types of user activity to monitor. Please refer to Red Hat’s Defining Audit Rules guide to determine which rules are appropriate for your organization:
Refer to this list for audit record types: https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/6/html/security\_guide/sec-audit\_record\_types
A few benefits of service auditing for a Droplet are:
Auditd can have performance impacts if incorrectly configured. For example you may not want to write all filesystem writes if you’re running a database service.
Auditd can generate a large volume of logs, especially if configured to track a wide range of activities. This logging can consume considerable system resources (CPU, memory, and disk I/O), potentially affecting the performance of the Droplet, especially if it has limited resources.
The logs generated by auditd can quickly consume disk space. Without proper log rotation strategy and management, this can lead to disk space issues, affecting the Droplet’s stability and performance.
When auditing, it is important to carefully configure the storage requirements for audit logs. By default, auditd will max out the log files at 5MB and retain only 4 copies of them. Older versions will be deleted. It is possible on a system that the 20 MBs of audit logs may fill up the system causing loss of audit data. While the recommendations here provide guidance, check your site policy for audit storage requirements.
To check if service auditing is set up on your DigitalOcean Droplet, you can follow these steps:
Please follow the steps and links below to install and configure auditd for your operating system. The links require a CIS Workbench account.
- ssh username@your-droplet-ip
Replace username with your username, and your-droplet-ip with your Droplet’s IP address.
Install auditd using the Remediation Procedure appropriate for your Linux distribution:
Ensure auditd is enabled and active. Please refer to the CIS Benchmark guide for your Linux distribution:
Enable auditd service at bootup.Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected. Please refer to the CIS Benchmark guide for your Linux distribution:
Ensure the audit backlog limit is sufficient. If audit=1 during boot, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected. The recommended audit backlog limit value is 8192 or larger. Please refer to the CIS Benchmark guide for your Linux distribution:
Configure data retention. Once the log reaches the maximum size, it will be rotated and a new log file will be started. It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost. Please refer to the CIS Benchmark guide for your Linux distribution:
Configure and test auditd rules. The Audit system operates on a set of rules that define what is to be captured in the log files. The following types of Audit rules can be specified:
Audit rules can be set on the command line using the auditctl utility. Note that these rules are not persistent across reboots. They can also be set in a file ending in .rules in the /etc/audit/audit.d/ directory. To define Audit rules that are persistent across reboots, you must either directly include them in the /etc/audit/audit.rules file or use the augenrules program that reads rules located in the /etc/audit/rules.d/ directory.
Test the rules using the following command. No output implies correct syntax.
- sudo auditctl -t < THE FILEPATH FOR YOUR AUDIT.RULES FILE
SSH keys are a pair of cryptographic keys that can be used to authenticate to an SSH server as an alternative to password-based logins. SSH, which stands for Secure Shell, is a network protocol used to securely access and manage machines over an unsecured network. SSH keys offer a more secure way of logging into a server with SSH than using a password alone.
Reasons why SSH key authentication is considered more secure than password authentication:
SSH keys do not have an inherent expiration date like some other authentication methods. This means that old, possibly forgotten keys can remain valid indefinitely unless manually removed, potentially leading to unauthorized access if those keys are compromised. The security of SSH key authentication relies on the private key remaining confidential. If a user’s private key is exposed or stolen, an attacker can gain access to all systems where the corresponding public key is authorized. This risk necessitates careful handling, protection (e.g., with a passphrase), and secure storage of private keys.
To check if your DigitalOcean account has an SSH key associated:
If you do not see any SSH keys listed in this section, it means that there are no SSH keys associated with your DigitalOcean account. In that case, follow the steps outlined in the remediation.
Open a terminal and run the following command:
- ssh-keygen
You will be prompted to save and name the key.
- Generating public/private rsa key pair. Enter file in which to save the key (/Users/USER/.ssh/id_rsa):
Next you will be asked to create and confirm a passphrase for the key (highly recommended):
- Enter passphrase (empty for no passphrase): Enter same passphrase again:
Copy the contents of the .pub file, typically id_rsa.pub.
- cat ~/.ssh/id_rsa.pub
Next,
This SSH can be selected during the Choose Authentication Method step of Droplet creation.
For extra security on Ubuntu, Debian, and CentOS droplets, disable Password-based SSH authentication with the following steps:
- sudo nano /etc/ssh/sshd_config
- sudo vi /etc/ssh/sshd_config
- Password Authentication no
- sudo systemctl reload sshd
Password-based authentication for newly created Alma 9, Rocky 8, and Fedora Droplets has been disabled due to an incompatibility between the operating system’s password authentication mechanism and DigitalOcean’s provisioning system. SSH-based login will remain available.
Please select the link for your Linux distribution to learn how to create a key pair, authenticate keys, and disable password authentication for your server
SSH keys are a pair of cryptographic keys that can be used to authenticate to an SSH server as an alternative to password-based logins. SSH, which stands for Secure Shell, is a network protocol used to securely access and manage machines over an unsecured network. SSH keys offer a more secure way of logging into a server with SSH than using a password alone.
Deleting SSH keys are important for:
Deleting or rotating SSH keys is essential for maintaining strong security, but if not managed properly, it can lead to several issues. The most significant risk is losing access to servers if keys are deleted or rotated without properly configuring the new keys first. Automated processes and services that rely on SSH keys may break if they aren’t updated, leading to disruptions. Additionally, if keys are deleted or rotated without proper documentation or communication, it could result in confusion or accidental removal of critical access.
Please refer to the API documentation for deleting an SSH key from your account: https://docs.digitalocean.com/reference/api/api-reference/#operation/sshKeys_delete
This method deletes the SSH from the account and prevents it from being used on new Droplets, but it does not remove the SSH key from existing Droplets.
To ensure the security of existing assets, review each Droplet and (1) delete the departing user’s account or (2) remove keys from appropriate authorized_keys file and change the user account’s password.
For each Droplet in your team account:
If the system has configured authorized_keys in a different way, please remove them from however your system manages keys.
If it is necessary to keep the user account, please:
If your team’s Droplets are using password auth you must:
SSL certificates increase security for your Droplet and your users by enabling encrypted connections to your server. You can purchase certificates through a commercial SSL certificate authority or use an open source certificate authority like Let’s Encrypt.
This process requires root access or administrative privileges on your Droplet. You must also have a domain name associated with your Droplet, and make sure DNS records are set up correctly.
A few benefits of installing an SSL certificate on your Droplet are:
Encryption: An SSL certificate ensures that data transmitted between the Droplet and its clients is encrypted. This makes it difficult for attackers to intercept, read, or modify the data, thereby protecting sensitive information such as login credentials, personal information, and financial transactions.
Credibility: Having an SSL certificate installed on a Droplet lets users know that their data is protected, which can enhance the credibility of the services hosted on the Droplet.
Compliance: For businesses that handle sensitive data, such as credit card information or personal health records, having an SSL certificate may be part of regulatory compliance requirements.
Compatibility: Modern SSL/TLS certificates are widely compatible with internet browsers, mobile devices, and other internet-facing applications, ensuring that encrypted services hosted on the Droplet can be accessed securely by a broad audience.
An improperly installed SSL certificate may cause accessibility issues, where users are unable to access the website or service hosted on the Droplet. This can result in downtime, affecting the availability of critical services and potentially leading to loss of revenue and damage to the organization’s reputation.
Browsers indicate this security with a padlock icon or a green bar in the address bar, making it easy for users to recognize secure connections.
It is also possible to use the terminal to check for certificates via the following command:
- openssl s_client -showcerts -connect hostname:port
- curl -Iv https://hostname
Methods of securing your server vary based on individual needs.
The following instructions detail remediation using Certbot, a popular tool for obtaining and managing SSL certificates from Let’s Encrypt, a free and widely trusted certificate authority. Instructions for other Linux distributions are also available through this guide.
Please follow the instructions listed in DigitalOcean’s How to Secure Apache with Let’s Encrypt on Ubuntu 20.04:
Note: Ubuntu 20.04 will reach end of life in April 2025.
SSL certificates increase security for your Droplet and your users by enabling encrypted connections to your server. You can purchase certificates through a commercial SSL certificate authority or use an open source certificate authority like Let’s Encrypt.
This process requires root access or administrative privileges on your Droplet. You must also have a domain name associated with your Droplet, and make sure DNS records are set up correctly.
A few benefits of installing an SSL certificate on your Droplet are:
Encryption: An SSL certificate ensures that data transmitted between the Droplet and its clients is encrypted. This makes it difficult for attackers to intercept, read, or modify the data, thereby protecting sensitive information such as login credentials, personal information, and financial transactions.
Credibility: Having an SSL certificate installed on a Droplet lets users know that their data is protected, which can enhance the credibility of the services hosted on the Droplet.
Compliance: For businesses that handle sensitive data, such as credit card information or personal health records, having an SSL certificate may be part of regulatory compliance requirements.
Compatibility: Modern SSL/TLS certificates are widely compatible with internet browsers, mobile devices, and other internet-facing applications, ensuring that encrypted services hosted on the Droplet can be accessed securely by a broad audience.
An improperly installed SSL certificate may cause accessibility issues, where users are unable to access the website or service hosted on the Droplet. This can result in downtime, affecting the availability of critical services and potentially leading to loss of revenue and damage to the organization’s reputation.
Browsers indicate this security with a padlock icon or a green bar in the address bar, making it easy for users to recognize secure connections.
It is also possible to use the terminal to check for certificates via the following command:
- openssl s_client -showcerts -connect hostname:port
- curl -Iv https://hostname
Methods of securing your server vary based on individual needs. The following instructions detail remediation using Certbot, a popular tool for obtaining and managing SSL certificates from Let’s Encrypt, a free and widely trusted certificate authority. Instructions for other Linux distributions are also available through this guide.
Please follow the instructions listed in DigitalOcean’s How to Secure Nginx with Let’s Encrypt on Ubuntu 20.04: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04
Note: Ubuntu 20.04 will reach end of life in April 2025.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.