AWS
This guide covers how to connect an Amazon Web Services (AWS) virtual machine to Cloudflare using our lightweight connector, cloudflared
.
We will deploy:
- An EC2 virtual machine that runs a basic HTTP server.
- A Cloudflare Tunnel that allows users to connect to the service via either a public hostname or a private IP address.
To complete the following procedure, you will need to:
- Add a website to Cloudflare
- Deploy the WARP client on an end-user device
-
From the AWS console, go to Compute > EC2 > Instances
-
Select Launch instance.
-
Name your VM instance. In this example we will name it
http-test-server
. -
For *Amazon Machine Image (AMI) choose your desired operating system and specifications. For this example, we will use Ubuntu Server 24.04 LTS (HVM), SSD Volume Type.
-
For Instance type:, you can select t2.micro which is available on the free tier.
-
In Key pair (login), create a new key pair to use for SSH. You will need to download the
.pem
file onto your local machine. -
In Network settings, select Create security group.
-
Turn on the following Security Group rules:
- Allow SSH traffic from My IP to prevent the instance from being publicly accessible.
- Allow HTTPS traffic from the internet
- Allow HTTP traffic from the internet
-
Select Launch instance.
-
Once the instance is up and running, go to the Instances summary page and copy its Public IPv4 DNS hostname (for example,
ec2-44-202-59-16.compute-1.amazonaws.com
). -
To log in to the instance over SSH, open a terminal and run the following commands:
-
Run
sudo su
to gain full admin rights to the instance. -
For testing purposes, you can deploy a basic Apache web server on port
80
: