Skip to content
Install

Deploy your first app

This guide takes a GitHub repository from code to a running app on your Orchard instance. You connect GitHub, deploy the repository, create a Postgres database, and connect the database to the app. At the end, your app runs on an HTTPS URL and reads its database connection string from a variable.

You can follow each step in the dashboard or with the orchard CLI.

  • A running Orchard instance that you can sign in to. To set one up, refer to Install.
  • A GitHub repository that contains a Dockerfile, or an app that Orchard can detect and build without one.
  • For private repositories, a GitHub App on the instance. To create one, refer to Connect a GitHub App.
  • For the CLI steps, the orchard CLI. To install it, refer to Use the CLI.

Orchard needs access to your GitHub account to list your repositories and to deploy again on each push. For a public repository, you can skip this step.

  1. Open your account menu.
  2. Select Account settings > Connections.
  3. In GitHub, select Connect.
  4. Approve the request on GitHub.
  5. In Repository access, select Add account.
  6. Install the GitHub App on the account that owns your repository.

Orchard clones the repository, builds an image on your cluster, and starts the app.

  1. Open a project.
  2. Select New app.
  3. In Start from scratch, select GitHub repo.
  4. In Repository, select your repository. For a public repository, paste owner/repo into the search field.
  5. In Branch, select a branch.
  6. In Name, enter a name for the app.
  7. In Networking, confirm that the port matches the port your app listens on.
  8. In Reach, select Public link for a URL that anyone can open. The default, Private link, requires people to sign in to Orchard.
  9. Select Deploy.

Orchard opens a progress page with these steps: Starting the builder, Cloning the repo, Building the image, Pushing the image, and Rolling out. The build logs stream on the same page.

The app is live when its status is Running. Its URL appears in the header of the app page. A new URL can show a certificate warning for up to a minute, until its certificate is issued.

If the build fails, refer to Builds.

A managed database is a Postgres instance with its own backups. It has its own lifecycle, separate from any app that connects to it, so a redeploy of the app does not change it.

  1. Open the project.
  2. Select New app.
  3. In Start from scratch, select Postgres.
  4. In Database name, enter a name.
  5. Select Create database.

Connect the database with a reference instead of a copied connection string. A reference follows the database through a password rotation or a restore, so the app keeps working without an edit.

  1. Open the app.
  2. Go to Variables.
  3. Add a variable named DATABASE_URL.
  4. In the value field, select Use a resource.
  5. Select your database.
  6. Select Save.

Orchard restarts the app with the new variable.

At this point, your app runs on an HTTPS URL with a Postgres database behind it. To put it on your own domain, add a custom domain. To deploy on every push, set up auto-deploy.