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-madestatic-starter template: click Use this template on GitHub, thendeploy 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 withnpm init -y first.
npm install --save-dev serveThen in package.json:
{
"scripts": {
"start": "serve -l $PORT ."
}
}serve -l $PORT . serves the current folder (where yourindex.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 thePORT 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
- Push the project to a GitHub repository.
- Open the dashboard, connect GitHub, and pick the repo.
- On a paid plan (any account with compute added), Dockhold detects the Node project, runs
npm install, and starts it withnpm run start. Nothing else to do. - On a free account, add the
Dockerfilebelow at the root of your repo first. Auto-detection is a paid feature, so without one the deploy stops right away and tells you.
# Dockerfile
FROM node:22-alpine
RUN npm install -g serve@14
WORKDIR /site
COPY . .
CMD serve -l $PORT .Your site goes live at https://<your-app>.dockhold.appwith HTTPS handled for you. Every later push to your main branch redeploys.
Troubleshooting
- 404 at the root: the folder you pass to
servemust contain anindex.html. Useserve -l $PORT publicif it's in a subfolder. - Build fails with "no start script": confirm the
startscript is inpackage.jsonand 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
- Upgrade to a Vite + React app
- Agent rules: make your AI tool generate Dockhold-ready apps.
- All recipes