DeployVeraDocs

TECHNICAL REFERENCE

Deploy a plain HTML site

Publish an index.html site with no package.json or build step, without exposing the rest of the repository.

Last reviewed: Markdown

Why the repository root is not published

Static frontend mode serves one folder with Nginx. The repository root (/) is rejected as the publish directory, because Nginx would then serve every file in the repository, including README, configuration files and anything committed by mistake. Put the files you want online in a subfolder.

Option 1: public folder (recommended)

  • Move index.html and the CSS, JavaScript and image files it uses into a public/ folder at the repository root; relative links stay the same.
  • Do not add a package.json. The automatic build method (Nixpacks) recognises the public/ folder as a static site.
  • In the panel, keep the automatic build method, enable Static frontend / SPA and set the publish directory to /public. The port is set to 80 automatically.
  • Start the deployment and open the address once the build log finishes.
my-site/
├── README.md
└── public/
    ├── index.html
    ├── styles.css
    └── images/
        └── logo.png

Option 2: Dockerfile

To keep index.html at the repository root, add a Dockerfile that copies only the files to publish into the Nginx image. Choose the Dockerfile build method and set the application port to 80. Files that are not copied are not published, so list every file and folder the site needs.

FROM nginx:alpine
COPY index.html /usr/share/nginx/html/index.html
# Copy every other file or folder the site needs, for example:
# COPY assets/ /usr/share/nginx/html/assets/

Unknown paths

Static frontend mode falls back to index.html for paths it cannot find, so a missing page returns the home page instead of a 404. Use the Dockerfile option for a multi-page site that needs real 404 responses.