Deploying a Static Site on Hop3¶
This guide walks you through deploying a plain static site — just HTML, CSS, and JavaScript files — on Hop3. There is no build step and no application server: Hop3's static deployer configures nginx to serve your files directly. It's the simplest possible deployment.
New to static sites on Hop3? Read the Static Sites overview for the two deployment strategies (build at the source vs. build on the server). Using a generator? Its build output is also just static files, so it deploys the same way — see Hugo, Eleventy, Astro, or Jekyll.
Prerequisites¶
Before you begin, ensure you have:
- A Hop3 server - Follow the Installation Guide
- The Hop3 CLI - Installed on your local machine
No language runtime is required — that's the whole point of a static site.
Step 1: Create the Site¶
Create a project directory with a public/ folder to hold the files nginx will serve:
Add a home page:
cat > public/index.html <<'HTML'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Hop3 Static Site</title>
</head>
<body>
<h1>Hello from Hop3</h1>
<p>This page is served as a plain static site — no build, no app server.</p>
</body>
</html>
HTML
Step 2: Configure Hop3¶
Tell Hop3 to serve the public/ directory as static. The recommended way is a short hop3.toml — no Procfile required. The static worker makes Hop3 skip the language toolchains and application servers entirely and serve the directory directly through nginx:
Confirm the configuration:
Prefer a
Procfile?echo "static: public" > Procfileworks too. Hop3 accepts either, buthop3.tomlwins if both declare a static directory — it's Hop3's own config file, whereas aProcfileis a generic, cross-tool convention that may belong to something else.
Deploy to Hop3¶
The following steps require a Hop3 server.
Initialize (First Time Only)¶
Deploy¶
Deploy the site (the first deployment creates the app):
Set Hostname¶
Configure the hostname for the nginx proxy:
Wait for Process Stop¶
Wait for the previous deployment to fully stop:
Apply Configuration¶
Redeploy to apply the hostname configuration:
Verify Deployment¶
How It Works¶
- No build, no runtime. Hop3 sees the
staticdirective (inhop3.tomlor aProcfile) and uses its static deployer instead of a language toolchain or application server. - nginx serves your files. The named directory (
public/) is served directly; requests never reach an app process. - Anything static works. Drop in CSS, JavaScript, images, or the build output of any static-site generator.
Useful Commands¶
hop3 app logs --app hop3-tuto-static # View logs
hop3 app restart --app hop3-tuto-static # Restart the app
hop3 config show --app hop3-tuto-static # Show configuration
hop3 app destroy --app hop3-tuto-static -y # Remove the app