Best practice to cloud firewall outbound traffic rules


What is the best practices to manage the cloud firewall of my droplet . Im using cloudflare , current I restrict inbound traffic to cloudflare Ips .Is it good idea to restrict outbound traffic just only to cloudflare Ips too.

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

If you are using Cloudflare you can certainly use their product to create firewall rules which will help to secure your droplet.

However, cloudflare is operating at the DNS layer and then routing requests to your droplet which you will want to secure independently and here are some resources to help you get started:

Using Managed Firewalls


You do not want to limit outbound traffic to just Cloudflare as that will actually break your website. Cloudflare just handles the inbound request through DNS and then routes it to your droplet, after that your droplet is communicating directly with the user that created the request. So if you limited outbound traffic to just Cloudflare it would break connectivity for your domains.