How to set up a Digital Ocean Cloud firewall
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!
Hi there,
Setting up a DigitalOcean Cloud Firewall is pretty straightforward and doesn’t require installing anything on your Droplet.
At a high level, you can do it directly from the control panel:
Go to Networking → Firewalls
Click Create Firewall
Give it a name
Add your inbound rules (for example: SSH on port 22, HTTP 80, HTTPS 443)
Add outbound rules (usually allow all by default)
Attach it to your Droplet (or use tags)
Once applied, the firewall will block all traffic that isn’t explicitly allowed by your rules:
https://docs.digitalocean.com/products/networking/firewalls/
A couple of quick tips:
Start with allowing SSH (port 22), otherwise you might lock yourself out
Only open the ports you actually need
You can restrict access by IP instead of allowing everything
Overall, it’s one of the easier cloud firewalls to set up, and it’s free to use with your Droplets.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.