Contact sales

Hosting a public webpage with Tachyon

Set up a Cloudflare tunnel into your SBC, which will serve a webpage to anyone who visits the URL.

Hosting a public webpage with Tachyon
Hosting a public webpage with Tachyon - Mobile
Ready to build your IoT product?

Create your Particle account and get access to:

  • Discounted IoT devices
  • Device management console
  • Developer guides and resources
Start for free

Introduction

A powerful single-board computer with 5G out of the box can enable a bunch of useful remote monitoring projects. But, with your sensors wired up and your code running, you’ll need a way to interact with the device while it’s deployed. How about with a publicly available website hosted by the device itself?

In this post, we’ll walk through how to set up a Cloudflare tunnel into your Tachyon. This will serve a webpage to anyone who visits the URL.

In this example, we’ve got a camera connected to the Tachyon that’s running a Flask server. A user could then log in to the webpage served by Flask and monitor the live camera feed. Flockr uses this configuration, so let’s walk through how we’ve set it up.

image (2) center

Domain and Cloudflare configuration

First you’ll need a base domain. In this example, we’ll be using Namecheap as the domain registrar. Purchase a domain that makes sense for your project — the example project uses flockr.xyz (because it was cheap).

domain center

Now, head over to Cloudflare and create an account if you haven’t already.

From “Account Home,” add your domain.

add-domain-to-cloudflare center

Luckily, this configuration will fall under Cloudflare’s free tier usage limits.

free-plan center

Next, on the “Review your DNS records” step, keep the defaults. Scroll to the bottom, and choose “Continue to activation,” Choose “confirm” in the “Add records later” modal.

add-records-modal center

On the following page, scroll to step three: “Add Cloudflare’s nameservers” and make note of the two assigned Cloudflare nameservers.

replace-nameservers center

Head back to Namecheap (or your chosen domain provider) to edit to your domain’s configuration. Update the domain’s nameservers with the values provided by Cloudflare in the previous step.

manage-domain center

update-nameservers center

Once complete, go back to your Cloudflare console and choose “Continue,” You’ll be notified that it may take up to 24 hours to process these changes. We’ve found that it typically takes much less time.

cloudflare-update-nameservers center

Once it completes, you’ll receive an email notifying you that the nameservers have been successfully updated.

email-confirmation center

Cloudflare tunnel

Once the domain has been properly configured, we can move on to setting up the tunnel that will route traffic to the Particle application serving the webpage. In Cloudflare, navigate to Access > Launch Zero Trust.

zero-trust center

If this is your first time in the Zero Trust portal, choose a team name for your account.

team-name center

The free tier will be plenty for this tutorial, but you may need to add your credit card information.

Navigate to Networks > Tunnels and choose “Add a tunnel.”

tunnels-nav center

Choose “Cloudflared” for the tunnel type:

create-a-tunnel center

Give your tunnel a name and save it:

tunnel-name center

In “Choose your environment type,” select the Docker option and copy the run command. We’ll use this to add another service to our Particle application running on the Tachyon.

docker-command center

Setting up the Particle application

The following steps will assume you’ve already got a Tachyon set up and running. Once your Tachyon is online, navigate to the Particle Console’s device details view and select the terminal tab. Open a new shell into your Tachyon.

tachyon-shell center

Switch the active user to the profile you configured during set up and navigate to the home directory. In this case, we’re using the default particle user.

sudo su particle cd ~

Clone the particle-flask-webcam starter repository into a directory of your choice:

mkdir Documents/projects git clone https://github.com/epietrowicz/particle-flask-webcam.git

Now, we’ll need to add the Cloudflare token from the previous step to our project’s docker-compose.yaml file.

To update your Cloudflare device token, run:

cd particle-flask-webcam nano flask-webcam/docker-compose.yaml

Find the line under the cloudflared service that contains the command. Replace the text after --token with the token provided in the “Route tunnel” step back in the Cloudflare configuration.

replace-token center

To save your changes and exit nano type: ctrl + o and ctrl + x

The next steps will assume you have Particle for Linux version 0.20.2 or above and the Particle CLI version 3.42.1 or above.

From here, run particle container run to build and start the Cloudflared and app containers.

You should be greeted with output that indicates the Flask server is up and running. Look for the following lines and make note of the IP address that the server is running on. http://172.27.0.2:5001 in this case.

flask-webcam | * Serving Flask app 'src/main.py' flask-webcam | * Debug mode: off cloudflared-1 | 2025-07-24T15:28:55Z INF Generated Connector ID: b1036e18-8f19-4173-b6ed-b4936e8b9164 flask-webcam | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. flask-webcam | * Running on all addresses (0.0.0.0) flask-webcam | * Running on http://127.0.0.1:5001 flask-webcam | * Running on http://172.27.0.2:5001 flask-webcam | Press CTRL+C to quit flask-webcam | * Restarting with stat

Adding a public route

Head back to the Cloudflare console and navigate to the tunnel you configured before: Zero Trust > Networks > Tunnels > YourTunnelName. Select the tunnel and click “Edit.”

edit-tunnel center

Navigate to the “Public hostnames” section of your tunnel’s configuration page. Choose “+ Add a public hostname.”

public-hostname center

Fill in your hostname details. You can choose any subdomain, but make sure to select HTTP and provide the URL from the container’s output. This could easily be adapted to use HTTPS, however, you’ll need to modify the project to use a production grade Flask server such as guincorn.

configure-public-host center

And that’s it! In this case, navigating to http://bird.flockr.xyz should pull up your Flask webpage with a video feed from the webcam.

Now we’ve got a live video feed of the server that’s hosting the webpage we’re visiting. How meta.

meta center

Ready to get started?

Order your Tachyon from the store.

Binary background texture