How to connect DigitalOcean app platform with Cloudflare

Connecting DigitalOcean App Platform with Cloudflare involves several steps to ensure that your domain is properly routed through Cloudflare’s content delivery network (CDN) and security services. Here’s a step-by-step guide.

  1. Set Up Your Domain on Cloudflare:
    1. Sign Up/Log In to Cloudflare:
      • Go to Cloudflare and sign up for an account or log in if you already have one.
    2. Add Your Domain:
      • In the Cloudflare dashboard, click on “Add a Site” and enter your domain name.
      • Cloudflare will begin scanning your domain’s DNS records. Wait for this process to complete.
    3. Review DNS Records:
      • Cloudflare will display the DNS records it found for your domain. Verify that these records are correct. You can add or remove records as needed.
    4. Change Your Domain’s Nameservers:
      • Cloudflare will provide you with two nameservers. You need to change your domain’s nameservers to these Cloudflare nameservers. This is usually done through your domain registrar’s website (where you purchased your domain).
  2. Configure DNS Records in Cloudflare for DigitalOcean App Platform
    1. Obtain DigitalOcean App Platform Information:
      • In your DigitalOcean App Platform dashboard, find the necessary information for your app’s custom domain setup, typically including the hostname and target (CNAME or A record).
    2. Add DNS Records in Cloudflare:
      • Go to the DNS section of your Cloudflare dashboard for your domain.
      • Add a new DNS record:
        • Type: Choose CNAME if DigitalOcean provided a CNAME record, or A if an IP address was provided.
        • Name: Enter the subdomain you want to use (e.g., www or @ for the root domain).
        • Target: Enter the value provided by DigitalOcean (either a URL or an IP address).
        • Proxy status: Set to “Proxied” (the orange cloud icon) to enable Cloudflare’s CDN and security features.
    3. Verify Your Setup:
      • Ensure all necessary records are added and that they match the instructions provided by DigitalOcean.
  3. Configure SSL/TLS Settings:
    1. SSL/TLS Mode:
      • Go to the SSL/TLS section in Cloudflare.
      • Choose the appropriate SSL mode (e.g., Flexible, Full, Full (strict)) depending on how SSL is set up on your DigitalOcean app. For full encryption, Full (strict) is recommended, but your app must support it.
    2. Edge Certificates:
      • Ensure that Cloudflare’s Universal SSL is enabled for your domain. This provides SSL termination at the Cloudflare edge servers.
  4. Verify and Test Your Setup
    1. Propagation:
      • Allow some time for DNS changes to propagate. This can take up to 48 hours, but usually, it’s much quicker.
    2. Testing:
      • Test your domain in a browser to ensure it’s loading correctly through Cloudflare.
      • Use tools like WhatsMyDNS to check DNS propagation status.
      • Verify SSL by checking the padlock icon in the browser and by using SSL checking tools like SSL Labs.
Summary

By following these steps, you should have successfully connected your DigitalOcean App Platform app with Cloudflare. This setup leverages Cloudflare’s powerful CDN and security features while pointing your domain to your DigitalOcean-hosted application. Make sure to monitor your site and check for any potential issues that may arise during the DNS propagation period.

Secure Remote Access to DigitalOcean with Netmaker

Securing remote access to your DigitalOcean droplet with Netmaker can significantly enhance the security and management of your network. Netmaker is an open-source network management solution that allows you to create secure, scalable, and high-perfo …

read more

Video Streaming on Premium CPU-Optimized Droplets

Setting up video streaming on DigitalOcean’s premium CPU-optimized droplets can offer high performance for encoding, streaming, and handling multiple simultaneous connections. Below is a step-by-step guide to deploy a video streaming server usi …

read more