Deploy a static site

Plain HTML, CSS, and JS on a live HTTPS URL.

If your project is just files — an index.html with some CSS and JavaScript — you only need a small server to hand those files out on the port Dockhold assigns. This recipe is the whole path.

In a hurry? Start from the ready-made static-starter template — click Use this template on GitHub, then deploy it. Or follow the steps below to add this to a project you already have.

1. Add a one-line static server

Add the serve package and a start script. If you don't have a package.json yet, create one with npm init -y first.

npm install --save-dev serve

Then in package.json:

{
  "scripts": {
    "start": "serve -l $PORT ."
  }
}

serve -l $PORT . serves the current folder (where your index.html lives) on the assigned port, on all interfaces. If your files live in a subfolder, point at it: serve -l $PORT public.

Your app must listen on 0.0.0.0 and read its port from the PORT environment variable — never localhost, never a hardcoded port. Dockhold assigns PORT at runtime; an app that ignores it can't receive traffic.

2. Connect the repo and deploy

  1. Push the project to a GitHub repository.
  2. Open the dashboard, connect GitHub, and pick the repo.
  3. Dockhold detects the Node project, runs npm install, and starts it with npm run start. No Dockerfile needed.

Your site goes live at https://<your-app>.dockhold.app with HTTPS handled for you. Every later push to your main branch redeploys.

Troubleshooting

  • 404 at the root: the folder you pass to serve must contain an index.html. Use serve -l $PORT public if it's in a subfolder.
  • Build fails with "no start script": confirm the start script is in package.json and spelled exactly as above.
  • A page loads but assets 404: use relative asset paths (./style.css), not absolute ones tied to your local folder.

Next