How to use Cloudflare tunnels for free
Jan 31, 2022
You've built an app but it still lives on your
localhost:3000. You want to share a preview of this app with your friends, boss, or client without the need to deploy it. Or you might just want to test a service worker. Whatever the case, something or someone needs access to your
This is where tunnels come in. Here is a quick overview of what this article covers:
- what is a tunnel and free tunnel services available
- how to set up Cloudflare tunnels for Windows, macOS, and Linux
- how to use your free Cloudflare tunnel
- REST clients to test your API endpoints for Chrome, native desktop tools, and VSCode extensions
What is a tunnel and free tunnel services available
A tunnel is a secure connection between your
localhost and the internet. Here is a quick list of tunneling services available:
- ngrok - comes with a free tier that allows for up to 4 tunnels and 40 connections per minute.
- tunnelto.dev -
tunneltois an open-source software that is available on GitHub with no vendor lock-in. However, if you don't want to do the setup yourself, there is a $2 option for up to 50 dedicated custom subdomains
- localtunnel - localtunnel is another open-source MIT licensed project that lets you expose your localhost for easy testing and sharing. All you have to do is install it and run
npx localhost --port 8000.
- Cloudflare - Cloudflare is a cloud hosting service that provides a content delivery network and DDoS mitigation. In addition to this, Cloudflare also provides a free tunnel service that we will be using to demonstrate how to use tunnels.
How to set up Cloudflare tunnels
Cloudflare free tunnel for Windows
For Windows, go to the download page here and download the executable for your system.
rename your download to
(optional: move your
cloudflared.exeto where you want it to sit and point your
Powershelland run the following command:
- If you didn't set your
PATH, make sure you navigate to where your
cloudflared.exeis before running the command below:
- If your
- If you didn't set your
Cloudflare free tunnel for macOS
- For macOS, you can install Cloudflare tunnel with
brewcommand as below:
- Once completed, you can create a tunnel using the following command:
Cloudflare free tunnel for Linux
For Linux, you can download and install via
amd64 / x86-64is used in the examples below.
Once completed, you can create a tunnel using the following command:
How to use your free Cloudflare tunnel
Once your run the tunnel command, you will get something like this:
Use the quick tunnel link as your base URL. So if your API route is
localhost:8080/users, then your tunnel API URL will look something like this based on the given link above -
If you are using a tunnel for API requests, here is a list of REST clients you can use to help you test your endpoints.
Top 9 REST clients for testing API endpoints
If you're working with APIs, you're going to need to test them somehow. This is where REST clients comes in. A REST client lets you test your endpoints easily allows you to mock requests and receive responses back for you to verify or debug your APIs. Using a REST client is also a great way to test if your Cloudflare tunnel is working as expected with minimal effort.
REST client via Chrome extensions
Boomerang SOAP and REST Client has over 80,000 users and is a must-have developer tool for your Chrome extension. It is easy to use with call histories that you can use to quickly create a working API call example reference. You can also export the data and share it as projects.
Yet Another REST Client is used by over 50,000 users and has over 120 positive reviews. It is easy to use with the ability to add custom authentication credentials. You can also re-use headers and payloads with a click of a button. In addition to this, it also comes with an import and export functionality.
JaSON is a minimalistic REST client that comes with a beautiful interface to work with. It's great for testing and debugging JSON, XML, RESTful APIs, GraphQL and web services. It also automatically sends Chrome cookies with it, making it useful for testing authentication.
REST client via downloads
If you prefer a stand-alone desktop REST client, then Postman REST Client might just be the solution for you. Postman can be used to create and execute queries, and it also works with SOAP and GraphQL.
Advanced REST Client is a free and open-source API testing tool that you can use to create built-in API documentation for RAML or OAS. You can also view the details for each request, helping you debug your issues faster and more efficiently.
REST client via VSCode extensions
If you prefer to stay within your editor and work with Visual Studio Code, the REST Client by Huachao Mao is a free tool with over 2 million installs and a 5-star rating. With this tool, you can send, cancel and rerun HTTP requests in the editor and view the response in a separate pane with syntax highlighting. It also covers GraphQL queries and you can author GraphQL variables in the editor.
With approximately half a million installs, Thunder Client is a free REST API client extension for Visual Studio Code. It is voted #10 Product of the day on Product Hunt and has an easy-to-use interface with response syntax highlighting.
Simple REST Client is exactly what its name implies - simple. This extension plugin is great if you just want to quickly make an HTTP call and it will give you the barebones basics of the response in a separate panel.
Cloudflare tunnels are quick to set up, easy to use, and a great way to test applications that lets you use webhooks.
If you are using UseCSV, you can use Cloudflare tunnels for your test CSV uploads and hook your frontend up with your backend without the need to deploy.