<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bemals Dvanitha</title>
    <description>The latest articles on Forem by Bemals Dvanitha (@bemals_dvanitha_5b14b68f9).</description>
    <link>https://forem.com/bemals_dvanitha_5b14b68f9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3680996%2F508c0361-8364-4396-8369-ec659a0bdee6.jpg</url>
      <title>Forem: Bemals Dvanitha</title>
      <link>https://forem.com/bemals_dvanitha_5b14b68f9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bemals_dvanitha_5b14b68f9"/>
    <language>en</language>
    <item>
      <title>Protecting Your Website with Cloudflare: Security, Performance, and Reliability [Part 2]</title>
      <dc:creator>Bemals Dvanitha</dc:creator>
      <pubDate>Sun, 18 Jan 2026 12:20:57 +0000</pubDate>
      <link>https://forem.com/bemals_dvanitha_5b14b68f9/protecting-your-website-with-cloudflare-security-performance-and-reliability-part-2-4b</link>
      <guid>https://forem.com/bemals_dvanitha_5b14b68f9/protecting-your-website-with-cloudflare-security-performance-and-reliability-part-2-4b</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22e7cd1iqwbua5ykr8w7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22e7cd1iqwbua5ykr8w7.png" alt="main-section-img" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;Cloudflare is an integral service for the modern web, delivering performance, integrity, and security on the edge of the network. In Part 1 of this series, the basic infrastructure deployment domain set-up, onboarding of Cloudflare, domain routing, and origin server preparation were covered.&lt;/p&gt;

&lt;p&gt;If you haven’t read Part 1 yet, it’s recommended to start there to understand the baseline architecture and configuration before moving forward:&lt;/p&gt;

&lt;p&gt;👉 Read Part 1: &lt;a href="https://dev.to/bemals_dvanitha_5b14b68f9/protecting-your-website-with-cloudflare-security-performance-and-reliability-part-1-24jk"&gt;Cloudflare Fundamentals &amp;amp; Setup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As this guide has grown to cover multiple layers of infrastructure, it makes sense to continue with a focused follow-up.&lt;/p&gt;

&lt;p&gt;In Part 2, we’ll dive into edge-level security and traffic control, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI crawl control and bot behavior management&lt;/li&gt;
&lt;li&gt;Rate limiting for APIs and sensitive endpoints&lt;/li&gt;
&lt;li&gt;Turnstile for user-friendly request validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This part is all about hardening your application at the edge while keeping performance fast and user experience smooth.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;AI Crawl Control&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why controlling AI crawlers matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI crawlers are no longer limited to traditional search engines. Many modern bots are designed to collect content for AI training, assistants, or large-scale analysis, often without providing direct value back to your site.&lt;/p&gt;

&lt;p&gt;Uncontrolled AI crawling can lead to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increased bandwidth and infrastructure costs&lt;/li&gt;
&lt;li&gt;Higher origin load and degraded performance&lt;/li&gt;
&lt;li&gt;Unwanted content harvesting or dataset creation&lt;/li&gt;
&lt;li&gt;Reduced visibility into who is accessing your content and why&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the same time, not all crawlers are bad. Search engine bots are critical for discoverability and SEO. The challenge is allowing the right bots while blocking or limiting the rest.&lt;/p&gt;

&lt;p&gt;This is exactly where Cloudflare’s AI Crawl Control becomes essential.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navigating to AI Crawl Control in Cloudflare&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To access AI Crawl Control:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your Cloudflare dashboard&lt;/li&gt;
&lt;li&gt;Select the domain you want to manage&lt;/li&gt;
&lt;li&gt;From the left-hand navigation menu, click AI Crawl Control&lt;/li&gt;
&lt;li&gt;Open the Crawlers tab&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5k1rf2i7rzna77nempt3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5k1rf2i7rzna77nempt3.png" alt="ai-crawler-control" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This section provides a centralized view of all detected crawlers accessing your site, along with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Crawler name and organization&lt;/li&gt;
&lt;li&gt;Category (Search Engine Crawler, AI Crawler, AI Assistant, Archiver, etc.)&lt;/li&gt;
&lt;li&gt;Request volume and recent activity&lt;/li&gt;
&lt;li&gt;Allow / Block controls per crawler&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Blocking specific AI crawlers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Within the Crawlers tab, Cloudflare lists individual bots such as AI trainers, assistant crawlers, and large-scale data collectors.&lt;/p&gt;

&lt;p&gt;To block a specific crawler:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Locate the crawler in the list&lt;/li&gt;
&lt;li&gt;Review its category and request behavior&lt;/li&gt;
&lt;li&gt;Click Block in the Action column&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp92o8zmgk65iwj158ql1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp92o8zmgk65iwj158ql1.png" alt="block-ai-crawler" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once blocked, Cloudflare enforces this rule at the edge, preventing requests from reaching your origin server. This helps reduce unnecessary load and protects your content from being harvested for unintended use.&lt;/p&gt;

&lt;p&gt;You can selectively block:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI training crawlers&lt;/li&gt;
&lt;li&gt;AI assistant fetchers&lt;/li&gt;
&lt;li&gt;Data aggregation bots&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Keep search engine crawlers allowed (critical for SEO)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Search engine crawlers should almost always remain allowed, as they play a fundamental role in how your site is discovered and ranked. Bots such as Googlebot, Bingbot, and other verified search engine crawlers are responsible for indexing your content, updating search rankings, and driving organic traffic to your site. Blocking these crawlers can have serious consequences, including reduced visibility in search results, ranking drops, and even complete removal of pages from search engine indexes. For most websites, restricting search engine crawlers should only be done with a very specific and well-understood reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Rate Limiting&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Rate limiting is a critical defense mechanism for protecting websites and APIs from abuse, brute-force attempts, scraping, and excessive automated traffic. By limiting how frequently a client can make requests within a defined time window, you can prevent malicious or misconfigured clients from overwhelming your application—while still allowing legitimate users to operate normally.&lt;/p&gt;

&lt;p&gt;In Cloudflare, rate limiting is enforced at the edge, meaning abusive traffic is stopped before it reaches your origin, reducing load, latency, and infrastructure costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navigating to Security Rules&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create a Rate Limiting rule:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to the Cloudflare dashboard&lt;/li&gt;
&lt;li&gt;Select your domain&lt;/li&gt;
&lt;li&gt;From the left-hand menu, go to Security&lt;/li&gt;
&lt;li&gt;Click Security rules&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00cpyhuiahtvjpz1xaav.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00cpyhuiahtvjpz1xaav.png" alt="rate-limiting-nav" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This section is where Cloudflare allows you to define how incoming requests are evaluated and mitigated using custom rules, managed rules, and Rate Limiting rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Rate Limiting rule&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside Security rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click Create rule&lt;/li&gt;
&lt;li&gt;From the dropdown, select Rate limiting rules&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fur2hcp18b8kx3uec6z7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fur2hcp18b8kx3uec6z7g.png" alt="rate-limiting-rule" width="493" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This opens the rate limiting rule builder, where you define what traffic to monitor, how often it’s allowed, and what action Cloudflare should take when limits are exceeded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuring the rate limiting rule&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Rule name&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Start by giving your rule a clear, descriptive name. For example:&lt;/p&gt;

&lt;p&gt;api-rate-limit&lt;/p&gt;

&lt;p&gt;A meaningful name makes future maintenance and troubleshooting much easier.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;When incoming requests match…&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This section defines which requests the rule applies to.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Field: URI Path&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Operator: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use Wildcard if you want to match a group of URLs&lt;/li&gt;
&lt;li&gt;  Use Equals if you want to target a single, exact path&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Value:&lt;br&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  /api/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using a wildcard is ideal for APIs or grouped endpoints, as it applies the rule to all matching paths under &lt;code&gt;/api/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;When rate exceeds…&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This section defines how much traffic is allowed before Cloudflare takes action.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requests: 10&lt;/li&gt;
&lt;li&gt;Period: 10 seconds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means a single client (based on IP, by default) can make up to 10 requests within 10 seconds. Any additional requests beyond this threshold will trigger the configured action.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Then take action…&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Choose what Cloudflare should do once the rate limit is exceeded.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Action: Block&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Blocking immediately stops matching requests and prevents Cloudflare from evaluating additional rules for that request, making it an effective mitigation for abusive behavior.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For duration…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This setting defines how long the block remains active.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duration: 10 seconds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After the duration expires, the client is allowed to send requests again—unless the rate limit is exceeded once more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Saving and deploying the rule
&lt;/h2&gt;

&lt;p&gt;Once all fields are configured:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Review the rule settings&lt;/li&gt;
&lt;li&gt;Click Deploy&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The rate limiting rule becomes active immediately and is enforced at Cloudflare’s edge across all incoming traffic that matches your criteria.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6xofjhcnvfjovl8h9b8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6xofjhcnvfjovl8h9b8.png" alt="cloud-flare-rule" width="800" height="733"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To validate the rate-limiting rule, we can intentionally send multiple rapid requests to the same endpoint to simulate abusive behavior. Once the defined threshold is exceeded (for example, more than 10 requests within 10 seconds), Cloudflare immediately blocks further requests from the same client. At this point, the client receives Error 1015 – You are being rate limited, indicating that Cloudflare has temporarily restricted access. This confirms that the rule is working as expected and that excessive or abusive traffic is being stopped at the edge before reaching the origin server.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3ehy5jn39ih7xi3fw6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3ehy5jn39ih7xi3fw6d.png" alt="cloudflare-rule-break" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Setting Up Cloudflare Turnstile: Step-by-Step Guide&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Cloudflare Turnstile provides bot protection without traditional CAPTCHAs, making it both user-friendly and secure. In this section, we’ll walk through the complete setup process, from creating a Turnstile widget in the Cloudflare dashboard to applying security rules and integrating it into your application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navigate to Turnstile in Cloudflare Dashboard&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your Cloudflare dashboard.&lt;/li&gt;
&lt;li&gt;Select your account or domain.&lt;/li&gt;
&lt;li&gt;From the left navigation panel, go to:
Application Security → Turnstile&lt;/li&gt;
&lt;li&gt;This section is where all Turnstile widgets are managed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjb4jzpg9aa6uz4lofm3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjb4jzpg9aa6uz4lofm3e.png" alt="turnsile-1" width="307" height="774"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a New Turnstile Widget&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the “Add widget” button under Turnstile widgets.&lt;/li&gt;
&lt;li&gt;Provide a Widget Name (e.g., turnstile-test) to identify it later.&lt;/li&gt;
&lt;li&gt;Under Hostname Management, click Add Hostnames.&lt;/li&gt;
&lt;li&gt;Select an existing hostname or add a custom hostname where Turnstile should be active.&lt;/li&gt;
&lt;li&gt;Click Add to confirm the hostname selection.&lt;/li&gt;
&lt;li&gt;This ensures Turnstile challenges are only valid for the specified domain(s).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Widget Mode&lt;/p&gt;

&lt;p&gt;Choose how Turnstile behaves for users:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Managed (Recommended)
Cloudflare automatically decides whether interaction is needed based on request risk.&lt;/li&gt;
&lt;li&gt;Non-interactive
Shows a loading-style challenge without user input.&lt;/li&gt;
&lt;li&gt;Invisible
Runs entirely in the background with no UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For most applications, Managed mode offers the best balance between security and user experience.&lt;/p&gt;

&lt;p&gt;Once configured, click Create.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faadeozycbhrw3lbwp0p5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faadeozycbhrw3lbwp0p5.png" alt="turnsile-2" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhyesxwwihlyb23kuip1s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhyesxwwihlyb23kuip1s.png" alt="turnsile-3" width="800" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwvw1wfknl50qusy3beu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwvw1wfknl50qusy3beu.png" alt="turnsile-4" width="648" height="883"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fst7nncvkj9sbj6m95m7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fst7nncvkj9sbj6m95m7e.png" alt="turnsile-5" width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retrieve Site Key and Secret Key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After successful creation, Cloudflare displays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Site Key – used on the client side (frontend)&lt;/li&gt;
&lt;li&gt;Secret Key – used on the server side for verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Important: Store the Secret Key securely. It should never be exposed in frontend code.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4hbu097ruyss7e20sz0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4hbu097ruyss7e20sz0t.png" alt="turnsile-6" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client-Side Integration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add the Turnstile script and widget container to your HTML page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;div class="cf-turnstile"
     data-sitekey="YOUR_SITE_KEY"&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What Happens Here&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script loads asynchronously to avoid blocking page load.&lt;/li&gt;
&lt;li&gt;Turnstile automatically runs risk analysis in the background.&lt;/li&gt;
&lt;li&gt;Legitimate users usually see no visible challenge.&lt;/li&gt;
&lt;li&gt;Bots or suspicious traffic are blocked or challenged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Apply Turnstile Using Security Rules&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To enforce Turnstile on specific routes or actions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to Security → Security rules.&lt;/li&gt;
&lt;li&gt;Click Create rule → Custom rules.&lt;/li&gt;
&lt;li&gt;Define matching conditions (e.g., URI Path equals / or /api/*).&lt;/li&gt;
&lt;li&gt;Set the Action to Managed Challenge.&lt;/li&gt;
&lt;li&gt;Choose rule order (usually First for critical paths).&lt;/li&gt;
&lt;li&gt;Click Deploy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzp54nonnzscnw26lvdd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzp54nonnzscnw26lvdd.png" alt="turnsile-8" width="298" height="808"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n4zpnjv4qujsd5qodwz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n4zpnjv4qujsd5qodwz.png" alt="turnsile-9" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiic1fp1ei57bjs0hs23v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiic1fp1ei57bjs0hs23v.png" alt="turnsile-10" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This ensures Turnstile is triggered only where it’s needed, such as login pages or sensitive APIs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify and Monitor&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once active:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use View analytics on the widget to track human vs bot traffic.&lt;/li&gt;
&lt;li&gt;Monitor challenge success rates and request patterns.&lt;/li&gt;
&lt;li&gt;Adjust rules or widget mode if necessary.&lt;/li&gt;
&lt;li&gt;Cloudflare’s analytics help fine-tune protection without degrading user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmus15hktp12hufz5kwmk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmus15hktp12hufz5kwmk.png" alt="turnsile-end" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cloudflare provides far more than a single layer of protection—it offers a comprehensive security ecosystem designed to defend modern applications against a wide range of threats. In this article, we explored how Turnstile delivers frictionless bot protection without degrading user experience, and how it can be combined with other Cloudflare features such as custom security rules, managed challenges, and rate limiting to build a stronger defensive posture.&lt;/p&gt;

&lt;p&gt;When used together, these controls allow you to protect sensitive endpoints, reduce abusive traffic, and handle sudden spikes or malicious behavior with confidence. Instead of relying on one mechanism, Cloudflare enables a layered security strategy—balancing usability, performance, and protection. By thoughtfully configuring these features, teams can stay ahead of automated abuse while keeping applications fast, accessible, and resilient at scale.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>security</category>
      <category>webdev</category>
      <category>cloudflare</category>
    </item>
    <item>
      <title>Protecting Your Website with Cloudflare: Security, Performance, and Reliability [Part 1]</title>
      <dc:creator>Bemals Dvanitha</dc:creator>
      <pubDate>Fri, 09 Jan 2026 11:46:58 +0000</pubDate>
      <link>https://forem.com/bemals_dvanitha_5b14b68f9/protecting-your-website-with-cloudflare-security-performance-and-reliability-part-1-24jk</link>
      <guid>https://forem.com/bemals_dvanitha_5b14b68f9/protecting-your-website-with-cloudflare-security-performance-and-reliability-part-1-24jk</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjk03q8qc8slgdq0od1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjk03q8qc8slgdq0od1a.png" alt="cloudflare-article-main-image" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;Application availability and security are just as important in today's web infrastructure as application logic. Distributed denial-of-service attacks, abusive traffic, automated crawlers, and common web exploits can impair performance or completely stop services, even with well-configured servers and properly encrypted connections.&lt;/p&gt;

&lt;p&gt;Operating as a security and performance layer between users and origin servers, Cloudflare is located at the network edge. It protects against large-scale DDoS attacks, malicious bots, and abusive request patterns by stopping traffic before it reaches your infrastructure. It also reduces latency through intelligent caching and worldwide content delivery.&lt;/p&gt;

&lt;p&gt;Cloudflare provides a wide range of controls for contemporary threats in addition to standard CDN functionality. These include rate limiting to safeguard APIs and login endpoints, Turnstile for seamless human verification, AI-driven bot and crawler management, adaptive DDoS mitigation, and integrated defenses against frequent attacks like SQL injection, cross-site scripting, and credential abuse.&lt;/p&gt;

&lt;p&gt;This post will discuss how a website can be strengthened against actual threats using Cloudflare. We'll concentrate on useful setups and essential features, such as DDoS defense, crawler control, Turnstile, rate limiting, caching techniques, and common attack prevention, demonstrating how they cooperate to lower attack surface while preserving user experience and performance.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Connecting Your Domain to Cloudflare via Nameserver Update&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You must assign DNS authority by changing your domain's nameservers at the domain provider (such as GoDaddy or Namecheap) in order to put Cloudflare in front of your website. At this point, no DNS records have been changed; this is the only necessary adjustment.&lt;/p&gt;

&lt;p&gt;The following steps avoid needless changes during onboarding and adhere to a safe, production-ready workflow.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Add Your Domain in Cloudflare&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxdikzvyymnppvjflgn8z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxdikzvyymnppvjflgn8z.png" alt="add-domain" width="721" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the Cloudflare dashboard, navigate to Domains → Onboard a domain and enter your existing domain name.&lt;/p&gt;

&lt;p&gt;When prompted to import DNS configuration, select:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Manually enter DNS records (Advanced)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if you do not plan to add records immediately, this option gives you full control and avoids assumptions made by automated scans.&lt;/p&gt;

&lt;p&gt;During onboarding, Cloudflare presents initial controls for AI crawlers and training bots.&lt;/p&gt;

&lt;p&gt;You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block AI training bots globally&lt;/li&gt;
&lt;li&gt;Allow them selectively&lt;/li&gt;
&lt;li&gt;Or leave them unblocked&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This setting can be changed later and does not affect nameserver activation, but Cloudflare applies it once traffic starts passing through its network.&lt;/p&gt;

&lt;p&gt;Continue with the setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F16y4ji1djfnmx0zg1ipu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F16y4ji1djfnmx0zg1ipu.png" alt="domain-setup" width="800" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Select a Cloudflare Plan&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To continue, select the Free plan.&lt;br&gt;
This plan already consists of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DDoS defense at the network layer&lt;/li&gt;
&lt;li&gt;DNS for Global Anycast&lt;/li&gt;
&lt;li&gt;Caching and CDN&lt;/li&gt;
&lt;li&gt;Basic bot detection and WAF&lt;/li&gt;
&lt;li&gt;SSL for all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Later on, you can upgrade without having to switch nameservers once more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgr4x15agweu67z5d480.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgr4x15agweu67z5d480.png" alt="paying-plan" width="349" height="682"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Obtain Cloudflare Nameservers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cloudflare will now assign two authoritative nameservers for your domain&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frs1b2p73olwjlkmpc9kh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frs1b2p73olwjlkmpc9kh.png" alt="nameserver-setup" width="615" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These values are unique per domain.&lt;/p&gt;

&lt;p&gt;At this point, Cloudflare will show the domain status as Pending until nameserver delegation is completed.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Replace Nameservers at Your Domain Provider (GoDaddy Example)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For GoDaddy, the process is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your domain settings&lt;/li&gt;
&lt;li&gt;Go to DNS / Nameservers&lt;/li&gt;
&lt;li&gt;Choose Custom nameservers&lt;/li&gt;
&lt;li&gt;Remove all existing nameserver entries&lt;/li&gt;
&lt;li&gt;Paste the two Cloudflare nameservers exactly as provided&lt;/li&gt;
&lt;li&gt;Save the changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk24g554tcd8pce155zam.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk24g554tcd8pce155zam.png" alt="nameserver-godaddy" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo56yufsnlppjei4nllly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo56yufsnlppjei4nllly.png" alt="godaddy-confirm" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Verify Nameserver Propagation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nameserver changes require global propagation. To confirm progress, use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.whatsmydns.net/" rel="noopener noreferrer"&gt;whatsmydns.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51b9vuukxtz7fdsolmp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51b9vuukxtz7fdsolmp6.png" alt="check-nameserver-records" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Confirm Domain Activation in Cloudflare&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once propagation finishes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloudflare will mark the domain as Active&lt;/li&gt;
&lt;li&gt;DNS authority is fully delegated&lt;/li&gt;
&lt;li&gt;Cloudflare now sits in front of your infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47nydr9lxiylhalwwnie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47nydr9lxiylhalwwnie.png" alt="confirm-cloudflare" width="800" height="24"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Creating DNS Records and Routing Traffic Through Cloudflare&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once your domain is Active in Cloudflare, Cloudflare is now the authoritative DNS provider. The next step is to create DNS records that point traffic to your application server.&lt;/p&gt;

&lt;p&gt;In this setup, the origin server is an Amazon Web Services EC2 instance or any other vpc running NGINX.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Origin Server Setup (NGINX + SSL)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The EC2 instance runs NGINX as the web server and reverse proxy. SSL termination on the origin is handled using Certbot with Let’s Encrypt.&lt;/p&gt;

&lt;p&gt;To avoid repeating implementation details, the full server-side setup—including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NGINX installation&lt;/li&gt;
&lt;li&gt;Reverse proxy configuration&lt;/li&gt;
&lt;li&gt;SSL certificate issuance&lt;/li&gt;
&lt;li&gt;Automatic renewal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;—is covered in detail in the following article:&lt;/p&gt;

&lt;p&gt;👉 &lt;em&gt;Boost Your Website’s Security: NGINX and SSL Setup with Certbot Made Easy&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://dev.to/bemals_dvanitha_5b14b68f9/boost-your-websites-security-nginx-and-ssl-setup-with-certbot-made-easy-3iki"&gt;full_guide_for_nginx_certbot_setup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This Cloudflare guide intentionally focuses on edge-level protection, while the linked article covers origin-level security.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create DNS Records in Cloudflare&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigate to:&lt;/p&gt;

&lt;p&gt;Domain → DNS → Records&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53i4e8qb9j0t57e12hie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53i4e8qb9j0t57e12hie.png" alt="adding-a-records" width="352" height="766"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is where Cloudflare resolves hostnames to your origin server and determines whether traffic is proxied through its edge.&lt;/p&gt;

&lt;p&gt;Example: Creating an A Record for an API or Application&lt;/p&gt;

&lt;p&gt;Add a new record with the following values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Type: A
Name: api        (or @ for root domain)
IPv4 address: &amp;lt;EC2_PUBLIC_IP&amp;gt;
Proxy status: Proxied (orange cloud enabled)
TTL: Auto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ydgq86nq3pom94qem48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ydgq86nq3pom94qem48.png" alt="setup-ssl" width="800" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficcdb9ec6bi6xfjsxwe3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficcdb9ec6bi6xfjsxwe3.png" alt="setup-ssl-2" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Key points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Proxied status ensures traffic passes through Cloudflare&lt;/li&gt;
&lt;li&gt;Cloudflare now hides the origin IP and applies security controls&lt;/li&gt;
&lt;li&gt;Requests no longer reach the EC2 instance directly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once saved, Cloudflare immediately begins routing traffic.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify DNS Propagation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To confirm the DNS record is resolving globally, use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.whatsmydns.net/" rel="noopener noreferrer"&gt;whatsmydns.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhf3oxfap3geeun6bavc2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhf3oxfap3geeun6bavc2.png" alt="confirm-a-records" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Confirm Application Reachability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After DNS propagation completes, validate application access via HTTPS:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://your-domain-or-subdomain/health" rel="noopener noreferrer"&gt;check-ssl&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1m9t7jx4an0ffl07euy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1m9t7jx4an0ffl07euy.png" alt="confirm-ssl" width="588" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture Overview and Design Rationale&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By combining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloudflare at the edge (DNS, DDoS, bot control, rate limiting)&lt;/li&gt;
&lt;li&gt;NGINX on EC2 as the origin&lt;/li&gt;
&lt;li&gt;End-to-end HTTPS via Certbot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduced attack surface&lt;/li&gt;
&lt;li&gt;Hidden origin IP&lt;/li&gt;
&lt;li&gt;Built-in DDoS mitigation&lt;/li&gt;
&lt;li&gt;Secure, encrypted traffic from client to server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation keeps responsibilities clear and the system easier to maintain.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s Next&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As this guide has grown to cover multiple layers of infrastructure—domain configuration, Cloudflare onboarding, DNS routing, and origin server setup—it makes sense to split the remaining topics into a follow-up article.&lt;/p&gt;

&lt;p&gt;In Part 2, we’ll focus entirely on Cloudflare’s edge-level security and traffic controls, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI Crawl Control and bot behavior management&lt;/li&gt;
&lt;li&gt;Rate limiting for APIs and sensitive endpoints&lt;/li&gt;
&lt;li&gt;Caching strategies to reduce origin load and improve latency&lt;/li&gt;
&lt;li&gt;Turnstile for user-friendly request validation&lt;/li&gt;
&lt;li&gt;Additional protections for common abuse and automated attacks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next in the series:
&lt;/h2&gt;

&lt;p&gt;This article focuses on baseline Cloudflare setup. The follow-up dives deeper into application-level protections, including Turnstile, rate limiting, and custom security rules for production workloads.&lt;/p&gt;

&lt;p&gt;👉 Read Part 2 here: &lt;a href="https://dev.to/bemals_dvanitha_5b14b68f9/protecting-your-website-with-cloudflare-security-performance-and-reliability-part-2-4b"&gt;https://dev.to/bemals_dvanitha_5b14b68f9/protecting-your-website-with-cloudflare-security-performance-and-reliability-part-2-4b&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>security</category>
      <category>cloudflare</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Boost Your Website’s Security: NGINX and SSL Setup with Certbot Made Easy</title>
      <dc:creator>Bemals Dvanitha</dc:creator>
      <pubDate>Sat, 03 Jan 2026 11:35:41 +0000</pubDate>
      <link>https://forem.com/bemals_dvanitha_5b14b68f9/boost-your-websites-security-nginx-and-ssl-setup-with-certbot-made-easy-3iki</link>
      <guid>https://forem.com/bemals_dvanitha_5b14b68f9/boost-your-websites-security-nginx-and-ssl-setup-with-certbot-made-easy-3iki</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bh2sewxmvjctu5eh9ui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bh2sewxmvjctu5eh9ui.png" alt="Nginx-Cerbot" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;Website security is now essential in today's digital environment. Securing your website with HTTPS has become essential for trust, performance, and search engine ranking due to the increase in cyber threats and users' growing awareness of privacy. SSL/TLS certificates are necessary for any serious online presence because search engines favor encrypted websites and modern browsers actively alert users when a website is not secure.&lt;/p&gt;

&lt;p&gt;One of the most widely used web servers, NGINX, powers millions of websites globally and is renowned for its excellent performance and stability. It offers a quick, safe, and dependable basis for serving web content when paired with SSL encryption. However, because of the complexity of configuration and certificate management, setting up SSL can be intimidating for many developers and system administrators.&lt;/p&gt;

&lt;p&gt;Here's where Certbot makes things easier. Certbot eliminates a significant portion of the manual labor typically involved in HTTPS setup by automating the purchase, installation, and renewal of free SSL certificates from Let's Encrypt. We'll go over how to install NGINX, secure it with SSL using Certbot, and make sure your website stays safe with little to no maintenance in this guide.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Installing and Configuring NGINX on Ubuntu&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Installing and configuring a web server is the first step before using SSL to secure your website. We'll use NGINX, a high-performance, lightweight web server that is frequently used for reverse proxying and serving web applications, in this tutorial.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An Ubuntu server (18.04, 20.04, or later)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A non-root user with sudo privileges&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A registered domain name pointing to your server’s IP address&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install NGINX&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start by updating your package list and installing NGINX using the default Ubuntu repositories&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, NGINX automatically starts running on your server.&lt;/p&gt;

&lt;p&gt;You can confirm that NGINX is running by checking its status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service nginx status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, open your server’s public IP address in a browser. If NGINX is working correctly, you should see the default “Welcome to NGINX” page.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure a Server Block&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;NGINX uses server blocks (similar to virtual hosts in Apache) to manage multiple websites on a single server.&lt;/p&gt;

&lt;p&gt;Navigate to the directory where enabled site configurations are stored&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /etc/nginx/sites-enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new configuration file for your domain (replace proxy with a meaningful name)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano proxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    listen [::]:80;

    server_name YOUR-DOMAIN-NAME;

    location / {
        proxy_pass http://localhost:PORT/;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configuration Breakdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;listen 80: Listens for incoming HTTP traffic&lt;/li&gt;
&lt;li&gt;server_name: Replace with your actual domain (e.g., example.com)&lt;/li&gt;
&lt;li&gt;proxy_pass: Forwards requests to an application running locally (such as a Node.js or backend service)&lt;/li&gt;
&lt;li&gt;PORT: Replace with the port your application is running on (e.g., 3000)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Save and exit the file (CTRL + O, then CTRL + X).&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test NGINX Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before applying changes, always test the configuration syntax&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the output shows “syntax is ok” and “test is successful”, you’re good to proceed.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restart and check status of NGINX&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service nginx restart
sudo service nginx status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Securing NGINX with SSL Using Certbot (Let’s Encrypt)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Enabling HTTPS is a crucial next step after NGINX has successfully served your application over HTTP. In addition to preventing man-in-the-middle attacks and enhancing user confidence and search engine rankings, SSL/TLS encryption safeguards data transferred between users and your server.&lt;/p&gt;

&lt;p&gt;In this section, we'll automatically acquire and set up a free SSL certificate for NGINX using Certbot, the official Let's Encrypt client.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install Certbot Using Snap&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On Ubuntu, the recommended way to install Certbot is via Snap, as it ensures you always receive the latest and most secure version.&lt;/p&gt;

&lt;p&gt;First, install and update the Snap core&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install core
sudo snap refresh core
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, install Certbot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install --classic certbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make the certbot command globally accessible, create a symbolic link&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /snap/bin/certbot /usr/bin/certbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can verify the installation by running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;certbot --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Obtain and Install SSL Certificate for NGINX&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Certbot can automatically detect your NGINX configuration and configure SSL with minimal input.&lt;/p&gt;

&lt;p&gt;Run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot --nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During the process, you will be prompted to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter your email address (used for renewal and security notices)&lt;/li&gt;
&lt;li&gt;Agree to the Let’s Encrypt terms of service&lt;/li&gt;
&lt;li&gt;Select the domain(s) you want to secure&lt;/li&gt;
&lt;li&gt;Choose whether to redirect HTTP traffic to HTTPS (recommended)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once completed, Certbot will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate an SSL certificate&lt;/li&gt;
&lt;li&gt;Update your NGINX configuration automatically&lt;/li&gt;
&lt;li&gt;Reload NGINX with HTTPS enabled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify HTTPS Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After Certbot finishes, open your website in a browser using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://YOUR-DOMAIN-NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see a secure connection (🔒) in the browser’s address bar.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automatic Certificate Renewal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s Encrypt certificates are valid for 90 days. Certbot automatically sets up a renewal timer, but you can test it manually&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot renew --dry-run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures your SSL certificates will renew automatically without service interruption.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>nginx</category>
      <category>certbot</category>
      <category>ssl</category>
    </item>
    <item>
      <title>Docker Is Not Dead — But Podman Might Be Better</title>
      <dc:creator>Bemals Dvanitha</dc:creator>
      <pubDate>Sat, 27 Dec 2025 08:48:34 +0000</pubDate>
      <link>https://forem.com/bemals_dvanitha_5b14b68f9/docker-is-not-dead-but-podman-might-be-better-3hdj</link>
      <guid>https://forem.com/bemals_dvanitha_5b14b68f9/docker-is-not-dead-but-podman-might-be-better-3hdj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8znopceton6rbf5a6sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8znopceton6rbf5a6sw.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Containerisation?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Containerization is a lightweight virtualization technique that allows applications to run in isolated user spaces called containers, while sharing the same operating system kernel. To ensure that an application functions consistently in various environments, each container packages an application along with its dependencies, including libraries, binaries, and configuration files.&lt;/p&gt;

&lt;p&gt;Containers lack a complete guest operating system, in contrast to conventional virtual machines (VMs). As a result, they are much quicker to launch, more resource-efficient, and simpler to scale.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Docker?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A major factor in the widespread adoption of containerization was the container platform Docker. Docker made it simpler for developers to package, distribute, and run applications consistently by hiding the complexity of Linux containers behind straightforward tooling and workflows.&lt;/p&gt;

&lt;p&gt;Fundamentally, Docker makes it possible to bundle applications into portable container images with all necessary dependencies, including libraries, runtime components, and configuration files. Regardless of underlying infrastructure differences, these images can run on any Docker-compatible system. Long-standing issues with inconsistent environments throughout the stages of development, testing, and production were addressed by this portability.&lt;/p&gt;

&lt;p&gt;Many of the conventions that characterize contemporary container workflows, such as image layering, declarative build instructions, and standardized registries for image distribution, were also established in part by Docker. Docker consequently became deeply ingrained in cloud platforms and development pipelines, impacting the creation of alternative runtimes and container orchestration systems.&lt;/p&gt;

&lt;p&gt;Docker is still a crucial point of reference even though the container ecosystem has since grown with new tools and architectural strategies. Newer daemonless runtimes like Podman and other container-compatible technologies continue to rely on its image format and workflow conventions.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Podman?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Podman is an open-source container engine created for daemonless and rootless container development, management, and operation. Podman runs containers directly as the user's child processes, enhancing security and streamlining system architecture in contrast to conventional container platforms that depend on a long-running background service.&lt;/p&gt;

&lt;p&gt;Because Podman is completely compatible with Docker images and current container standards, users can adopt it with little modification to their current workflows. Podman is a well-liked option in server and enterprise environments because of its emphasis on security, adherence to standards, and close integration with Linux system tools.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Docker vs Podman: Key Differences and Advantages&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Both Docker and Podman support the same OCI-compliant image formats and offer container-based application workflows. However, their design philosophies diverge greatly, resulting in significant practical differences, especially in the areas of operational flexibility, security, and architecture.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Advantages on Podman over docker&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Architecture: Daemon vs Daemonless&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker is dependent on a central daemon that oversees every container and operates continuously in the background. This daemon serves as a single control point for container lifecycle operations and usually runs with elevated privileges.&lt;/p&gt;

&lt;p&gt;In contrast, Podman lacks daemon. The Podman process launches containers directly, and they operate like regular Linux processes. This layout:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;removes a single point of failure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;decreases the complexity of the system&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;increases openness when examining active workloads&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Security: Root vs Rootless Containers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to manage containers, Docker typically requires root-level privileges, which can expand the attack surface in the event that the daemon is compromised.&lt;/p&gt;

&lt;p&gt;Rootless containers were a key component in the design of Podman. Containers can be used by users without root access, offering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Improved user isolation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;decreased chance of privilege escalation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced adherence to security-focused settings&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of this, Podman is particularly appealing for enterprise deployments and multi-user systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Compatibility and Migration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Podman retains command-line compatibility with Docker in spite of architectural differences. Existing images can be reused without alteration, and many Docker commands remain unchanged. Instead of doing a complete migration, this enables teams to move to Podman gradually.&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Moving from Docker to Podman&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It's easy to switch from Docker to Podman, especially if you're already familiar with container workflows. The majority of current procedures can be carried over with little modification thanks to Podman's broad compatibility with Docker commands and image formats.&lt;/p&gt;

&lt;p&gt;The installation, container creation, and operation of Podman on Ubuntu are all covered in the following steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Podman on Ubuntu&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, update the package index and install Podman using the default Ubuntu repositories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt-get install podman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can verify the installation by checking the version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike Docker, Podman does not require a background daemon, so no additional services need to be started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building a Container Image&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Podman uses the same Dockerfile format, so existing Dockerfiles work without modification.&lt;/p&gt;

&lt;p&gt;To build an image from a Dockerfile in the current directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman build -t test-image .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command behaves the same as docker build, creating a local image tagged as test-image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running a Container
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;To run a container from the built image&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First, we used the --name option to give the container a name. This facilitates future reference to the container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman run --name test-container test-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Running the Container with Port Mapping&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, we used the -p flag to map the container's exposed port to a host port.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman run --name test-container -p 8080:80 test-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This maps port 80 inside the container to port 8080 on the host.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Running the Container with Environment Variables&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, we passed environment variables at runtime using the -e option.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman run \
  --name test-container \
  -p 8080:80 \
  -e APP_ENV=production \
  -e APP_PORT=80 \
  test-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application inside the container has access to these environment variables without requiring modifications to the image itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Pushing and Pulling Images&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Podman supports pushing and pulling images to and from container registries.&lt;/p&gt;

&lt;h2&gt;
  
  
  To push an image
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman push test-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  To pull an image
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman pull test-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similar to Docker, authentication and registry configuration adhere to standard container registry workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Key Takeaway for Docker Users&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Podman commands closely resemble Docker commands for the majority of daily tasks, such as creating images, executing containers, and interacting with registries. Because of this compatibility, teams can use Podman gradually while taking advantage of its rootless and daemonless design.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>containers</category>
      <category>podman</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
