Installing Cloudflared on DigitalOcean Ubuntu
Cloudflared is a tunneling daemon that allows you to securely connect your server to Cloudflare’s network without exposing your origin server to the internet. This guide will walk you through the steps to install Cloudflared on an Ubuntu server hosted on DigitalOcean.
Prerequisites
An Ubuntu server on DigitalOcean
SSH access to the server
Basic knowledge of command line operations
Step 1: Update Your System
Start by updating your package lists and upgrading existing packages to ensure everything is up to date.
sudo apt upgrade -y
Step 2: Install Required Packages
Install the necessary packages to add the Cloudflare repository.
Step 3: Add the Cloudflare GPG Key and Repository
Add the Cloudflare GPG key and repository to your system.
Since the noble release does not have a repository, you can use the focal release which is often supported.
Step 4: Update Package List Again
Update the package list to include the new Cloudflare repository.
Step 5: Install Cloudflared
Install the Cloudflared package.
Alternative Method: Using Snap
If you prefer using Snap to manage your packages, you can install Cloudflared via Snap. Ensure Snap is installed and then install Cloudflared.
Ensure Snap is installed:
sudo apt update
sudo apt install snapd
sudo snap install core
Install Cloudflared via Snap:
sudo snap install jnsgruk-cloudflared
Step 6: Ensure Cloudflared is in Your PATH
If the cloudflared command is not found, add Snap’s binary path to your system’s PATH.
source ~/.bashrc
Step 7: Verify Installation
Verify that Cloudflared is correctly installed by checking its version.
cloudflared –version
If everything is set up correctly, you should see the path to the cloudflared binary and its version information.
Conclusion
By following these steps, you can install Cloudflared on your DigitalOcean Ubuntu server, allowing you to securely connect your server to Cloudflare’s network. This setup helps enhance your server’s security by keeping it hidden from the public internet.
For more detailed information and troubleshooting, you can refer to the official Cloudflare documentation.
References:
Cloudflare Docs
Snapcraft: Install Cloudflared on Ubuntu
Pi My Life Up: Install Cloudflared on Ubuntu