Lesson 2 of 110 of 8 steps

Lesson 2 · about 20 minutes

Get your first app online

By the end of this lesson you'll have a real app at a real web address, open on your phone and sitting on your home screen. It's a tiny app on purpose, so the only new thing to learn is getting it online.

A tiny app, live on Cloudflare at its own address and on your home screen. You'll sign Wrangler in once, try it locally, then deploy.

A Worker serving static files: you sign in once with wrangler login, try it with wrangler dev, and put it live with wrangler deploy, plus a manifest and an icon. Skim the steps; the problems people hit are the useful bit.

How much have you built before?
This lesson's wording changes to match.
FreeNo code to write
The finished first app on a phone: a sprout, the words My first app, a count of 3 and a Tap me button
my-first-app.you.workers.dev

What you'll make

  • A one-page app with a button that counts your taps
  • Live at its own address that anyone can open
  • Added to your phone's home screen, with its own icon

You'll need: a Mac or Windows computer with Claude Code installed (see "Before you start" in lesson 1), and your phone.

1

Make a free Cloudflare account

Cloudflare is where your app will live. It runs a huge share of the web, and its free plan is plenty for a personal app, a family log or a small club.

Go to dash.cloudflare.com/sign-up and sign up with Google, Apple, GitHub or your email.

Cloudflare's sign-up page, with buttons to continue with Google, Apple or GitHub, or an email and password
You should see

"Build, protect, and connect with Cloudflare", with sign-up buttons. Pick whichever is easiest.

If Cloudflare asks what you want to do first, you can skip it. Your agent will do the setting up.

2

Open your agent in a new folder

Each app gets its own folder. Open the Terminal app (on Windows, Terminal or PowerShell) and type these two lines, pressing Enter after each:

Type in Terminal
mkdir my-first-app && cd my-first-app
Then start your agent
claude

The first line makes a folder called my-first-app and goes into it. The second starts Claude Code there, so everything it makes stays in that folder.

3

Sign in to Cloudflare, once

Your agent puts apps online with a tool called Wrangler. It needs to sign in to your Cloudflare account one time. Ask your agent:

Say to your agent
Log me in to Cloudflare with Wrangler.

It runs npx wrangler login. A browser window opens asking you to allow Wrangler into your account. Click Allow.

$
Opening a link in your default browser…
Successfully logged in.
dash.cloudflare.com
Allow Wrangler access to your Cloudflare account?

A drawing of the page you'll see. Click Allow.

CancelAllow

You only do this once per computer. From now on, "put it live" just works.

It says "npx: command not found"
Your computer doesn't have Node.js yet, which Wrangler needs. Say "Install Node.js for me" and your agent will do it, then try this step again.
The browser didn't open
Look in the terminal for a long link starting https://dash.cloudflare.com/oauth2/. Copy it into your browser, click Allow, then come back.
4

Ask for your first app

Now the fun part. Copy this, or say it in your own words:

Say to your agent
Make me a tiny first app to put on Cloudflare Workers: one page with a sprout, the title "My first app", and a button that counts my taps and remembers them. Make it something I can add to my phone's home screen. Don't put it live yet.
A good reply looks like this
I've made four files:
my-first-app/
wrangler.jsonc the app's settings for Cloudflare
public/
index.html the page and the button
manifest.webmanifest name and icon for the home screen
icon.svg the icon

The settings file is short. Yours will look much like this:

{ "name": "my-first-app", "compatibility_date": "2026-11-01", "assets": { "directory": "./public" } }

"name" becomes part of your web address. "assets" tells Cloudflare which folder holds the pages.

5

Try it on your computer

Before anything goes online, look at it. Say:

Say to your agent
Let me try it on my computer.

It runs npx wrangler dev, which starts your app on your own computer only. When it's ready, you'll see a line like this:

$ npx wrangler dev⛅️ wrangler 4.165.0⎔ Starting local server...Ready on http://localhost:8787

it's the real app: go on, tap it ↙

localhost:8787
You should see

Your app, at http://localhost:8787. This is the real one: tap the button a few times, then refresh this page. The count stays.

"localhost" means "this computer". Nobody else can see it yet.

"Address already in use"
Something else is using that address. Say "Use a different port" and it will pick another, like localhost:8788.

Want changes? Say them now: "make the button green", "bigger text". It updates while you watch. This is the cheapest moment to change your mind.

6

Put it live

Happy with it? Say:

Say to your agent
Put it live.

It runs npx wrangler deploy. In a few seconds your files are uploaded and you get your address:

$ npx wrangler deploy✨ Read 3 files from the assets directoryTotal Upload: 0.37 KiB / gzip: 0.25 KiB
Uploading
https://my-first-app.you.workers.devLive
↑ your app, live for anyone

Shortened. Your address has your own name in place of "you".

It asks me to choose a "workers.dev subdomain"
That happens the first time. It's the middle part of your address, so pick something short, like your name. Every app you make will use it: appname.yourname.workers.dev.
The address says "not found" for a minute
A brand-new address can take a minute or two to reach everywhere. Wait, then refresh.
7

Open it on your phone

Send yourself the address (a message to yourself is fine), open it on your phone, then add it to your home screen:

iPhone · Safari
  1. Tap the Share button
  2. Scroll and tap Add to Home Screen
  3. Tap Add
Android · Chrome
  1. Tap the ⋮ menu
  2. Tap Add to Home screen or Install app
  3. Tap Install
my-first-app.you.workers.dev
Copy
Add to Home Screen+
Add Bookmark
🌱First app
You should see

A sprout icon on your home screen. Open it: it fills the screen with no browser bar, like any other app.

Your taps are counted separately on each phone for now. Sharing between phones comes in lesson 4.

8

Change something

This is the loop you'll use for everything from now on: say it, look at it, put it live.

Say to your agent
After 10 taps, say "Nice one!" under the button. Show me on my computer first, then put it live when I say yes.

Then refresh the app on your phone. If you don't see the change straight away, close the app fully and open it again.

Coming up in lesson 6: making sure phones always pick up new versions on their own, with a "new version ready" message.

Lesson 2 doneYou just put a real app online, at its own address and on your phone.
Next up · lesson 3, about 25 minutesKeep every version safe online, and undo a bad release in one step.

Did it work?

Tick these off. They're saved in this browser, so you can come back later.

  • My app has its own web address
  • It opens on my phone
  • It's on my home screen with its own icon
  • I changed something and put it live again