From Local App to Public Website in Minutes

Editor
18 Min Read


, I’ll show you 3 completely free ways to quickly deploy a simple web app so it’s publicly available on the internet. By “simple,” I mean a static web app, i.e., one that has no database back end, user accounts, or server-side logic.

While this might seem a little bit limiting, there’s still a lot you can do with just HTML, CSS and JavaScript.

Since the focus is on different deployment methods, I won’t spend much time on the web app itself.

I wanted a small project that was straightforward, but still real enough to deploy and share. So I had Codex build a browser game, a simple Space Invaders-style shooter which the agent decided to call Starline Defender.

The game is easy to play. You move a little ship left and right with the arrow keys, shoot incoming aliens using the space-bar, hide behind shields, lose lives when you get hit, and move through faster waves as the score climbs. It works with keyboard controls on desktop and touch controls on mobile. I’ll leave links to all three app URLs I deployed to at the end, so you can play with them yourself.

Here is the prompt I used.

Create a simple web app containing html, css and javascript that’s a simple space invaders type game

After around 16 minutes, Codex spat this out.

Worked for 16m 45s

I'll build this as a single self-contained HTML file with embedded CSS and 
JavaScript, using canvas so it runs anywhere without a build step. I'll keep 
the existing downloader file untouched and add a new game page.
I'm going to include the whole game in one file: canvas rendering, alien 
waves, shields, scoring, lives, levels, keyboard controls, and on-screen 
controls for touch devices. After that I'll open it locally through the 
existing localhost server and do a quick visual sanity check.
Created 1 file

The game file is in place. I'm checking it through localhost now so we can 
catch blank canvas issues, script errors, or layout problems before I hand it 
over.
Verify game page

The page loads over localhost. The browser's read-only page check couldn't 
inspect canvas pixels directly, so I'm switching to a screenshot and 
console-log check, which is the right kind of sanity test for this 
canvas-heavy page.
Screenshot game

The screenshot found one layout wrinkle: on a short viewport the game board 
shrinks but hugs the left side, leaving dead space to the right. I'm centering 
and constraining the board dimensions so it looks intentional on both 
mobile-sized and desktop-sized panes.
Edited 1 file

I've patched the responsive sizing. I'm reloading the page now and doing 
one interaction pass: start the game, confirm the canvas updates, and check 
that there are no console errors.
Verify updated game
Done. I created the single-file SPA here:
starline-defenders.html
You can play it in the in-app browser at:
http://127.0.0.1:8765/starline-defenders.html

I also verified it loads, starts, renders the canvas, and has no browser 
console errors.

I tested the game locally, and it worked OK. So, now to deploy it to the web so that the world can marvel at its awesomeness!

The deployment systems we’ll look at are:-

1. GitHub Pages
2. here.now
3. Hugging Face Spaces

To avoid doubt, other than being a user of these systems, I have no association, affiliation or connection with any of the companies mentioned above.

General Pre-requisites

Most static hosts expect the homepage to be named index.html, so the first thing to do is rename our file from starline-defenders.html. For this project, that’s all we need, as all our assets and code are in this one file.

Create an empty folder on your local system e.g starline-defenders/ and copy the index.html file there.

Method 1: Deploy with GitHub Pages

GitHub Pages is a classic choice for small static sites and web apps like this. If your project already lives in GitHub, this is usually the simplest permanent deployment.

GitHub Pages can serve HTML, CSS, JavaScript, images, and other static assets directly from a repository. For a one-file game, like this, it’s all the infrastructure you need.

What You Need

The prerequisites for the GitHub install are:-

  • A GitHub account
  • Git Bash installed locally
  • A public GitHub repository. This is essential for free deployment.

Step 1: Create a GitHub account

Go to https://github.com and click the Sign up button at the top right of the screen.

Step 2: Install the git bash app

Git, via its Bash command-line interface, enables you to interact with GitHub, e.g., copy files to repositories.

Get it by clicking:

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

and following the installation instructions appropriate to your local system.

Step 3: Create a New Repository

Log in to your GitHub account and create a new repository called, for example:

starline-defenders

Make sure it’s a public repository.

Step 4: Put your index.html file into the public repository

You do that by opening the Git Bash command-line terminal, then changing directory to the local folder containing your index.html file. Now type the following commands into Git Bash.

git init
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git add index.html
git commit -m "Add space invaders type game"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/starline-defenders.git
git push -u origin main

Replace `YOUR_USERNAME`with your GitHub username.

Step 5: Enable GitHub Pages

Open the new repository on GitHub, then:

1. Go to Settings.
2. Open Pages in the left sidebar.
3. Under Build and deployment, choose Deploy from a branch.
4. Set the source branch to `main`.
5. Set the folder to `/root`.
6. Click Save.

GitHub will start publishing the site. It usually takes a minute or two, and your final URL will look like this:

https://YOUR_USERNAME.github.io/starline-defenders/

FYI, if you need to make changes to your web app in the future, just make the required changes to your local index.html file, commit it and push again:

git add index.html
git commit -m "Update game"
git push

Your updated app will redeploy automatically.

Method 2: Deploy using here.now

here.now is a service built for publishing static sites and files quickly. It can host HTML, CSS, JavaScript, images, documents, and other static files at a live `*.here.now` URL. Although here.now is built for agentic access, you can also interface with it manually, which is what I’ll show here.

There are two ways you can publish to here.now. Both are free. The first method is called anonymous mode and requires no sign-up or registration. In this mode, here.now will host your app at a temporary URL for 24 hours. 

For a permanent here.now URL, which is what we’ll use, you need to publish with an API key.

The flow is:

  1. Sign up/in at here.now
  2. Obtain an API key
  3. Save it locally
  4. Run command-line scripts to publish the app
  5. The returned URL is permanent on your account

The prerequisites for the here.now deployment are:-

  • A here.now account
  • A here.now API key

Step 1: Sign up to here.now

Click here.now/dashboard and use the Sign In button at the top right of the screen. 

You’ll receive a link in your email to click, which will log you in to here.now properly.

Step 2: Get an API key 

Once you’re logged in, there will be an API link on the left-hand menu bar. Click that, then copy the generated key to your clipboard.

Step 3: Publish your site

On a Windows PC like the one I’m using, publishing your app involves running some PowerShell commands. There’s a similar process for Linux and other operating system users.

# Create a folder to hold your API key if required
#
New-Item -ItemType Directory -Force "$env:USERPROFILE\.herenow" | Out-Null

# Save the API key
#
Set-Content "$env:USERPROFILE\.herenow\starlinedefenders-credentials" "YOUR_API_KEY"
# publish the web app
#

cd "$env:USERPROFILE\projects\starlinedefenders"

$apiKey = Get-Content "$env:USERPROFILE\.herenow\starlinedefenders-credentials" -Raw
$file = Get-Item ".\index.html"

$body = @{
  files = @(
    @{
      path = "index.html"
      size = $file.Length
      contentType = "text/html; charset=utf-8"
    }
  )
  spaMode = $true
} | ConvertTo-Json -Depth 5

$create = Invoke-RestMethod `
  -Uri "https://here.now/api/v1/publish" `
  -Method Post `
  -Headers @{
    "Authorization" = "Bearer $apiKey"
    "X-HereNow-Client" = "manual/powershell"
  } `
  -ContentType "application/json" `
  -Body $body

$upload = $create.upload.uploads[0]

Invoke-WebRequest `
  -Uri $upload.url `
  -Method Put `
  -ContentType $upload.headers."Content-Type" `
  -InFile $file.FullName

$finalBody = @{
  versionId = $create.upload.versionId
} | ConvertTo-Json

$final = Invoke-RestMethod `
  -Uri $create.upload.finalizeUrl `
  -Method Post `
  -Headers @{
    "Authorization" = "Bearer $apiKey"
  } `
  -ContentType "application/json" `
  -Body $finalBody

"Permanent Site URL: $($create.siteUrl)"

After the above script has run, it will display a URL that you can use to access your web app. 

Updating your app is simple, too. After changing the code in index.html as required, just rerun the above deployment script again.

Method 3: Deploy with Hugging Face Spaces

Hugging Face (HF) Spaces is best known for machine learning demos, but it also supports static HTML apps. 

What You Need

  • A Hugging Face account
  • A new HF Space
  • Your index.html file
  • A README.md file containing Space metadata

Step 1: Create an HF  account

Click https://huggingface.co/ and use the Sign Up button at the top right of the page.

Step 2: Create a new Space

Once you’re logged in, click the Spaces button at the top, then click Create a new Space and choose a name for it, e.g., starline-defenders-game. Fill in a description and choose whatever licence term you want.

For the Space SDK, choose Static, and for the Template, choose blank. Choose Public as the app visibility, then click the Create Space button at the bottom.

Step 3: Overwrite the pre-created index.html file

After the Space has been created, click on the Files link near the top of the page; it’s between the App and Community links. You should see a screen that looks a bit like a GitHub repo, with four files HF has pre-created for you. The only one that we need to concern ourselves with is the index.html file. You need to copy over your local index.html to overwrite the existing HF one. Do that using Git Bash, as we did with GitHub pages. 

Note that during the running of the final git push command shown below, a pop-up window will appear where you’ll have to enter your HF username and an access token in order for the command to succeed. You get your access token by going to the following settings page.

https://huggingface.co/settings/tokens

Click the Create Token button. Under Token Type, click Write. Give your token a name and create it. Keep a note of the token value. Now type in the following commands into Git Bash. Replace YOUR_USERNAME and YOUR_SPACE_NAME with your own HF values.

# go the folder where your index.html lives
cd ~/projects/starlinedefenders

git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
cd YOUR_SPACE_NAME
cp ~/projects/starlinedefenders/index.html ./index.html
git add index.html
git commit -m "Replace index with a space invaders type game"
# After the following push command, you'll have to enter
# your HF username and the access token you created previously
# before the command will succeed
git push

Hugging Face will build and publish the Space in the background. After a minute or so, your app will be ready to run. To run it, search for your HF username, and all your available Spaces should be returned. Click on the relevant Space link, and your app should run immediately.

To update the app later, edit your local index.html, then push again:

git add index.html
git commit -m "Update game"
git push

Comparing the Deployment Methods

All three work well for this kind of project. The differences are mostly about workflow and audience.

GitHub Pages

GitHub Pages is the best default choice if your project is already on GitHub. It’s stable, well-documented, and familiar to developers.

Pros:

  • Free for public repositories
  • HTTPS included
  • Very easy to update with Git
  • Good for portfolios and project demos
  • No special platform lock-in beyond GitHub

Cons:

  • Free publishing generally means a public repository
  • Not intended as heavy-duty commercial hosting
  • The deployment settings can confuse beginners the first time
  • Less instant than a drag-and-publish style tool

here.now

here.now is the quickest way to turn a local app into a live URL. It’s particularly well-suited to small static apps produced with an agent or a coding assistant.

Pros:

  • Very fast publishing flow
  • Good for quick demos and previews
  • Free account supports permanent static sites
  • Can host plain HTML, CSS, JavaScript, and assets such as images

Cons:

  • You need an account or claim flow for permanent hosting
  • Newer and less widely recognised than GitHub Pages
  • You should check the current plan limits before using it for high-traffic projects

Hugging Face Spaces

Hugging Face Spaces is the most specialised option. It’s excellent if you want your app to live alongside demos, experiments, or AI-related projects.

Pros:

  • Supports static HTML Spaces
  • Free CPU-backed Spaces are available
  • Nice fit if you already use Hugging Face
  • Can easily grow into a Gradio, Streamlit, Docker, or ML-powered app later

Cons:

  • Deployment steps are a bit more complex than the other two.
  • Requires a README.md metadata block as well as the index.html file
  • The public URL is a Hugging Face Space page rather than a general-purpose static-site URL
  • More platform-specific than GitHub Pages

Summary

The development of a web page or app is usually only half the battle. When you want to share your work with others, deployment becomes the most important aspect. Sure, there are numerous paid services that will get you up and running, but for a really simple app or demo, the ability to deploy for free is a boon.

I’ve shown 3 different methods to deploy a static app to the web for free. To be honest, they all have similar deployment workflows and implementation efforts, and I don’t think you’d go wrong choosing any of them.

Just bear in mind that these methods aren’t designed to cope with your app having thousands of concurrent users. They are free after all. If you’re looking for that, you’ll need to look elsewhere and get your credit card out.

For reference, here are the three free URLs I created for “Starline Defender”

GitHub Starline Defenders

here.now Starline Defenders

Hugging Face Spaces Starline Defenders

Share this Article
Please enter CoinGecko Free Api Key to get this plugin works.