HubDocs

Guides

Deploy. What hub deploy reads in a folder, and what it prints.

hub deploy            # the folder you are in
hub deploy ./my-app   # another folder

The app takes its name from --name, else from app in hub.yaml, else from the folder name. It deploys to the prod instance unless you pass --instance.

Deploying my-app (node, port 3000) to acme
Uploading 0.4 MB
Building... 31s
Starting...
Live at https://my-app.acme.myhub.host

If the build or the start fails, the CLI prints the last 30 lines of the build log and the reason. The release that was running keeps running. --logs prints the whole build log as it grows, and --detach returns once the upload is done; follow it later with hub app my-app logs.

A new app opens for your org only. hub deploy --public makes a new app public from the start. Access and invitations covers the rest.

What Hub looks for

Hub checks the folder in this order and uses the first match. It adds nothing to your folder.

The folder hasHub runs
compose.yaml, compose.yml, docker-compose.yaml or docker-compose.ymlYour compose project as written. See Compose apps.
A DockerfileYour Dockerfile. The port comes from hub.yaml, else the first EXPOSE, else 3000.
A package.json with a start scriptA Node.js 22 app on port 3000. npm run build runs first when there is a build script.
A package.json with a build script and no startA frontend: Hub builds it and serves whichever of dist, build or out holds an index.html. Unknown paths get index.html, so client-side routing works.
An index.htmlA static site.

What gets uploaded

Inside a git repository, Hub uploads the files git tracks plus new files your .gitignore does not exclude. Outside one, it uploads everything except .git and node_modules. An upload can be 200 MB at most.

If the folder is a git repository with a GitHub remote, hub deploy deploys from GitHub instead. See Deploy from GitHub. hub deploy --local uploads the folder as it is and skips GitHub.

hub.yaml

Hub reads two things from hub.yaml: the app name, and the port of an app that ships its own Dockerfile.

hub.yaml
app: crm
services:
  web:
    port: 8000

hub validate checks the file without deploying. For more than one service, a worker or a database, write a compose file.

Names

App names use a to z, 0 to 9 and -, start with a letter, and are 40 characters at most. Instance names follow the same rules with 20 characters at most. -- is reserved, because URLs use it between the app and the instance.

On this page