Last updated on 22nd November 2026

How do I deploy only a subdirectory of my repository?

Yes. DeployHQ can deploy a single folder from your repository instead of the whole thing. This is useful for monorepos, or when your repository holds the website alongside other files such as documentation or tooling.

Setting the subdirectory

The subdirectory is a setting on each server, so different servers in the same project can deploy different folders.

  1. Open your project and go to Servers & Groups.
  2. Edit the server you want to change, or add a new one.
  3. Expand Deployment Options and find Subdirectory to deploy from.
  4. Enter the folder as a path relative to the root of your repository, for example app. A leading slash is not needed.
  5. Save the server and run a deployment.

Only files inside that folder are deployed. If you leave the field blank, the server uses the project's default subdirectory, and if there isn't one, deploys the whole repository.

Two server types handle this differently:

  • Shell servers don't have the setting, because they run commands rather than transfer files.
  • Static Hosting servers have their own Subdirectory to deploy from field, which points at the folder containing your built site.

You'll also see this option when you set up your first server in the onboarding wizard.